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_uuid=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, 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 instances.
source code

Inherited from TaggableObject: ValidateTag

Inherited from outils.ValidatedSlots: GetAllSlots

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

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_uuid=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 (dict) - optional dictionary to receive the 'node' : ['lv', ...] data.
  • devs (list of Disk) - disks to get the LV name for. If None, all disk of this instance are used.
  • node_uuid (string) - UUID of the node to get the LV names for. If None, the primary node of this instance is used.
Returns:
None if lvmap arg is given, otherwise, a dictionary of the form { 'node_uuid' : ['volume1', 'volume2', ...], ... }; volumeN is of the form "vg_name/lv_name", compatible with GetVolumeList()

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 names of seconda\
ry nodes")

all_nodes

Value:
property(_ComputeAllNodes, None, None, "List of names of all the nodes\
 of the instance")