Package ganeti :: Module cmdlib :: Class IAllocator
[hide private]
[frames] | no frames]

Class IAllocator

source code


IAllocator framework.

An IAllocator instance has three sets of attributes:

Instance Methods [hide private]
 
__init__(self, cfg, rpc, mode, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_ComputeClusterData(self)
Compute the generic allocator input data.
source code
 
_AddNewInstance(self)
Add new instance data to allocator structure.
source code
 
_AddRelocateInstance(self)
Add relocate instance data to allocator structure.
source code
 
_AddEvacuateNodes(self)
Add evacuate nodes data to allocator structure.
source code
 
_BuildInputData(self, fn)
Build input data structures.
source code
 
Run(self, name, validate=True, call_fn=None)
Run an instance allocator and return the results.
source code
 
_ValidateResult(self)
Process the allocator results.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
_ComputeNodeGroupData(cfg)
Compute node groups data.
source code
dict
_ComputeBasicNodeData(node_cfg)
Compute global node data.
source code
 
_ComputeDynamicNodeData(node_cfg, node_data, node_iinfo, i_list, node_results)
Compute global node data.
source code
 
_ComputeInstanceData(cluster_info, i_list)
Compute global instance data.
source code
Class Variables [hide private]
  _ALLO_KEYS = ["name", "mem_size", "disks", "disk_template", "o...
  _RELO_KEYS = ["name", "relocate_from",]
  _EVAC_KEYS = ["evac_nodes",]
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cfg, rpc, mode, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

_ComputeClusterData(self)

source code 

Compute the generic allocator input data.

This is the data that is independent of the actual operation.

_ComputeBasicNodeData(node_cfg)
Static Method

source code 

Compute global node data.

Returns: dict
a dict of name: (node dict, node config)

_ComputeDynamicNodeData(node_cfg, node_data, node_iinfo, i_list, node_results)
Static Method

source code 

Compute global node data.

Parameters:
  • node_results - the basic node structures as filled from the config

_AddNewInstance(self)

source code 

Add new instance data to allocator structure.

This in combination with _AllocatorGetClusterData will create the correct structure needed as input for the allocator.

The checks for the completeness of the opcode must have already been done.

_AddRelocateInstance(self)

source code 

Add relocate instance data to allocator structure.

This in combination with _IAllocatorGetClusterData will create the correct structure needed as input for the allocator.

The checks for the completeness of the opcode must have already been done.

_ValidateResult(self)

source code 

Process the allocator results.

This will process and if successful save the result in self.out_data and the other parameters.


Class Variable Details [hide private]

_ALLO_KEYS

Value:
["name", "mem_size", "disks", "disk_template", "os", "tags", "nics", "\
vcpus", "hypervisor",]