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

Class Instance

source code


Config object representing an instance.

Instance Methods [hide private]
 
_ComputeSecondaryNodes(self)
Compute the list of secondary nodes.
source code
 
_ComputeAllNodes(self)
Compute the list of all nodes.
source code
 
MapLVsByNode(self, lvmap=None, devs=None, node=None)
Provide a mapping of nodes to LVs this instance owns.
source code
Disk
FindDisk(self, idx)
Find a disk given having a specified index.
source code
 
ToDict(self)
Instance-specific conversion to standard python types.
source code
 
UpgradeConfig(self)
Fill defaults for missing configuration values.
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 instances.
source code

Inherited from TaggableObject: ValidateTag

Inherited from ConfigObject (private): _all_slots

Static Methods [hide private]
Class Variables [hide private]
  secondary_nodes = property(_ComputeSecondaryNodes, None, None,...
  all_nodes = property(_ComputeAllNodes, None, None, "List of al...

Inherited from TaggableObject: VALID_TAG_RE

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_ComputeSecondaryNodes(self)

source code 

Compute the list of secondary nodes.

This is a simple wrapper over _ComputeAllNodes.

_ComputeAllNodes(self)

source code 

Compute the list of all nodes.

Since the data is already there (in the drbd disks), keeping it as a separate normal attribute is redundant and if not properly synchronised can cause problems. Thus it's better to compute it dynamically.

MapLVsByNode(self, lvmap=None, devs=None, node=None)

source code 

Provide a mapping of nodes to LVs this instance owns.

This function figures out what logical volumes should belong on which nodes, recursing through a device tree.

Parameters:
  • lvmap - optional dictionary to receive the 'node' : ['lv', ...] data.
Returns:
None if lvmap arg is given, otherwise, a dictionary of the form { 'nodename' : ['volume1', 'volume2', ...], ... }

FindDisk(self, idx)

source code 

Find a disk given having a specified index.

This is just a wrapper that does validation of the index.

Parameters:
  • idx (int) - the disk index
Returns: Disk
the corresponding disk
Raises:

ToDict(self)

source code 

Instance-specific conversion to standard python types.

This replaces the children lists of objects with lists of standard python types.

Overrides: ConfigObject.ToDict

FromDict(cls, val)
Class Method

source code 

Custom function for instances.

Overrides: ConfigObject.FromDict

UpgradeConfig(self)

source code 

Fill defaults for missing configuration values.

Overrides: ConfigObject.UpgradeConfig

Class Variable Details [hide private]

secondary_nodes

Value:
property(_ComputeSecondaryNodes, None, None, "List of secondary nodes"\
)

all_nodes

Value:
property(_ComputeAllNodes, None, None, "List of all nodes of the insta\
nce")