Package ganeti :: Package utils :: Module lvm
[hide private]
[frames] | no frames]

Module lvm

source code

Utility functions for LVM.

Functions [hide private]
None or str
CheckVolumeGroupSize(vglist, vgname, minsize)
Checks if the volume group list is valid.
source code
tuple
LvmExclusiveCheckNodePvs(pvs_info)
Check consistency of PV sizes in a node for exclusive storage.
source code
 
LvmExclusiveTestBadPvSizes(small, big)
Test if the given PV sizes are permitted with exclusive storage.
source code

Imports: constants


Function Details [hide private]

CheckVolumeGroupSize(vglist, vgname, minsize)

source code 

Checks if the volume group list is valid.

The function will check if a given volume group is in the list of volume groups and has a minimum size.

Parameters:
  • vglist (dict) - dictionary of volume group names and their size
  • vgname (str) - the volume group we should check
  • minsize (int) - the minimum size we accept
Returns: None or str
None for success, otherwise the error message

LvmExclusiveCheckNodePvs(pvs_info)

source code 

Check consistency of PV sizes in a node for exclusive storage.

Parameters:
  • pvs_info (list) - list of LvmPvInfo objects
Returns: tuple
A pair composed of: 1. a list of error strings describing the violations found, or an empty list if everything is ok; 2. a pair containing the sizes of the smallest and biggest PVs, in MiB.

LvmExclusiveTestBadPvSizes(small, big)

source code 

Test if the given PV sizes are permitted with exclusive storage.

Parameters:
  • small - size of the smallest PV
  • big - size of the biggest PV
Returns:
True when the given sizes are bad, False otherwise