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
 
ToDict(self)
Custom function for cluster.
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

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 (private): _all_slots

Static Methods [hide private]
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

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

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