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, _with_private=False)
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_public, os_params_private=None, os_params_secret=None)
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
 
FillNDGroup(self, nodegroup)
Return filled out ndparams for just objects.NodeGroup
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
 
IsDiskTemplateEnabled(self, disk_template)
Checks if a particular disk template is enabled.
source code
 
IsFileStorageEnabled(self)
Checks if file storage is enabled.
source code
 
IsSharedFileStorageEnabled(self)
Checks if shared file storage is enabled.
source code

Inherited from TaggableObject: AddTag, GetTags, RemoveTag

Inherited from ConfigObject: Copy, Validate, __eq__, __getattr__, __getstate__, __repr__, __setstate__

Inherited from outils.ValidatedSlots: __init__

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 outils.ValidatedSlots: GetAllSlots

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, _with_private=False)

source code 

Custom function for cluster.

Parameters:
  • _with_private - if True, the object will leak its private fields in the dictionary representation. If False, the values will be replaced with None.
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_public, os_params_private=None, os_params_secret=None)

source code 

Fill an instance's osparams dict with cluster defaults.

Parameters:
  • os_name (string) - the OS name to use
  • os_params_public (dict) - the dict to fill with default values
  • os_params_private (dict) - the dict with private fields to fill with default values. Not passing this field results in no private fields being added to the return value. Private fields will be wrapped in Private objects.
  • os_params_secret (dict) - the dict with secret fields to fill with default values. Not passing this field results in no secret fields being added to the return value. Private fields will be wrapped in Private objects.
Returns: dict
a copy of the instance's osparams with missing keys filled from the cluster defaults. Private and secret parameters are not included unless the respective optional parameters are supplied.

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

FillNDGroup(self, nodegroup)

source code 

Return filled out ndparams for just objects.NodeGroup

Parameters:
  • nodegroup (objects.NodeGroup) - A Node object to fill @return a copy of the node group'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