Package ganeti :: Module storage :: Class LvmPvStorage
[hide private]
[frames] | no frames]

Class LvmPvStorage

source code


LVM Physical Volume storage unit.

Instance Methods [hide private]
 
_SetAllocatable(self, name, allocatable)
Sets the "allocatable" flag on a physical volume.
source code
 
Modify(self, name, changes)
Modifies flags on a physical volume.
source code

Inherited from _LvmBase: List

Inherited from _Base: Execute

Class Methods [hide private]

Inherited from _LvmBase (private): _BuildList

Static Methods [hide private]
 
_GetAllocatable(attr) source code
Class Variables [hide private]
  LIST_COMMAND = "pvs"
  LIST_FIELDS = [(constants.SF_NAME, ["pv_name"], None), (consta...
list of tuples consisting of three elements: SF_* constants, lvm command output fields (list), and conversion function or static value (for static value, the lvm output field can be an empty list)

Inherited from _LvmBase: LIST_SEP

Method Details [hide private]

_SetAllocatable(self, name, allocatable)

source code 

Sets the "allocatable" flag on a physical volume.

Parameters:
  • name (string) - Physical volume name
  • allocatable (bool) - Whether to set the "allocatable" flag

Modify(self, name, changes)

source code 

Modifies flags on a physical volume.

See _Base.Modify.

Parameters:
  • name - Entity name
  • changes - New field values
Overrides: _Base.Modify

Class Variable Details [hide private]

LIST_FIELDS

list of tuples consisting of three elements: SF_* constants, lvm command output fields (list), and conversion function or static value (for static value, the lvm output field can be an empty list)
Value:
[(constants.SF_NAME, ["pv_name"], None), (constants.SF_SIZE, ["pv_size\
"], _ParseSize), (constants.SF_USED, ["pv_used"], _ParseSize), (consta\
nts.SF_FREE, ["pv_free"], _ParseSize), (constants.SF_ALLOCATABLE, ["pv\
_attr"], _GetAllocatable),]