Package ganeti :: Module objects :: Class Cluster
[hide private]
[frames] | no frames]

Class Cluster

source code


Config object representing the cluster.

Instance Methods [hide private]
 
UpgradeConfig(self)
Fill defaults for missing configuration values.
source code
 
primary_hypervisor(self)
The first hypervisor is the primary.
source code
 
ToDict(self)
Custom function for cluster.
source code
 
SimpleFillDP(self, diskparams)
Fill a given diskparams dict with cluster defaults.
source code
 
GetHVDefaults(self, hypervisor, os_name=None, skip_keys=None)
Get the default hypervisor parameters for the cluster.
source code
dict
SimpleFillHV(self, hv_name, os_name, hvparams, skip_globals=False)
Fill a given hvparams dict with cluster defaults.
source code
dict
FillHV(self, instance, skip_globals=False)
Fill an instance's hvparams dict with cluster defaults.
source code
dict
SimpleFillBE(self, beparams)
Fill a given beparams dict with cluster defaults.
source code
dict
FillBE(self, instance)
Fill an instance's beparams dict with cluster defaults.
source code
dict
SimpleFillNIC(self, nicparams)
Fill a given nicparams dict with cluster defaults.
source code
dict
SimpleFillOS(self, os_name, os_params)
Fill an instance's osparams dict with cluster defaults.
source code
 
FillND(self, node, nodegroup)
Return filled out ndparams for objects.NodeGroup and objects.Node
source code
dict
SimpleFillND(self, ndparams)
Fill a given ndparams dict with defaults.
source code
dict
SimpleFillIPolicy(self, ipolicy)
Fill instance policy dict with defaults.
source code

Inherited from TaggableObject: AddTag, GetTags, RemoveTag

Inherited from ConfigObject: Copy, __getattr__, __getstate__, __init__, __repr__, __setstate__

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

Class Methods [hide private]
 
FromDict(cls, val)
Custom function for cluster.
source code

Inherited from TaggableObject: ValidateTag

Inherited from ConfigObject: GetAllSlots

Inherited from ConfigObject (private): _all_slots

Static Methods [hide private]
 
SimpleFillHvState(hv_state)
Fill an hv_state sub dict with cluster defaults.
source code
 
SimpleFillDiskState(disk_state)
Fill an disk_state sub dict with cluster defaults.
source code
Class Variables [hide private]

Inherited from TaggableObject: VALID_TAG_RE

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

UpgradeConfig(self)

source code 

Fill defaults for missing configuration values.

Overrides: ConfigObject.UpgradeConfig

primary_hypervisor(self)

source code 

The first hypervisor is the primary.

Useful, for example, for Node's hv/disk state.

Decorators:
  • @property

ToDict(self)

source code 

Custom function for cluster.

Overrides: ConfigObject.ToDict

FromDict(cls, val)
Class Method

source code 

Custom function for cluster.

Overrides: ConfigObject.FromDict

SimpleFillDP(self, diskparams)

source code 

Fill a given diskparams dict with cluster defaults.

Parameters:
  • diskparams - The diskparams
Returns:
The defaults dict

GetHVDefaults(self, hypervisor, os_name=None, skip_keys=None)

source code 

Get the default hypervisor parameters for the cluster.

Parameters:
  • hypervisor - the hypervisor name
  • os_name - if specified, we'll also update the defaults for this OS
  • skip_keys - if passed, list of keys not to use
Returns:
the defaults dict

SimpleFillHV(self, hv_name, os_name, hvparams, skip_globals=False)

source code 

Fill a given hvparams dict with cluster defaults.

Parameters:
  • hv_name (string) - the hypervisor to use
  • os_name (string) - the OS to use for overriding the hypervisor defaults
  • skip_globals (boolean) - if True, the global hypervisor parameters will not be filled
Returns: dict
a copy of the given hvparams with missing keys filled from the cluster defaults

FillHV(self, instance, skip_globals=False)

source code 

Fill an instance's hvparams dict with cluster defaults.

Parameters:
  • instance (objects.Instance) - the instance parameter to fill
  • skip_globals (boolean) - if True, the global hypervisor parameters will not be filled
Returns: dict
a copy of the instance's hvparams with missing keys filled from the cluster defaults

SimpleFillBE(self, beparams)

source code 

Fill a given beparams dict with cluster defaults.

Parameters:
  • beparams (dict) - the dict to fill
Returns: dict
a copy of the passed in beparams with missing keys filled from the cluster defaults

FillBE(self, instance)

source code 

Fill an instance's beparams dict with cluster defaults.

Parameters:
Returns: dict
a copy of the instance's beparams with missing keys filled from the cluster defaults

SimpleFillNIC(self, nicparams)

source code 

Fill a given nicparams dict with cluster defaults.

Parameters:
  • nicparams (dict) - the dict to fill
Returns: dict
a copy of the passed in nicparams with missing keys filled from the cluster defaults

SimpleFillOS(self, os_name, os_params)

source code 

Fill an instance's osparams dict with cluster defaults.

Parameters:
  • os_name (string) - the OS name to use
  • os_params (dict) - the dict to fill with default values
Returns: dict
a copy of the instance's osparams with missing keys filled from the cluster defaults

FillND(self, node, nodegroup)

source code 

Return filled out ndparams for objects.NodeGroup and objects.Node

Parameters:
  • node (objects.Node) - A Node object to fill
  • nodegroup (objects.NodeGroup) - A Node object to fill @return a copy of the node's ndparams with defaults filled

SimpleFillND(self, ndparams)

source code 

Fill a given ndparams dict with defaults.

Parameters:
  • ndparams (dict) - the dict to fill
Returns: dict
a copy of the passed in ndparams with missing keys filled from the cluster defaults

SimpleFillIPolicy(self, ipolicy)

source code 

Fill instance policy dict with defaults.

Parameters:
  • ipolicy (dict) - the dict to fill
Returns: dict
a copy of passed ipolicy with missing keys filled from the cluster defaults