module documentation

Utility functions for LVM.

Function CheckVolumeGroupSize Checks if the volume group list is valid.
Function LvmExclusiveCheckNodePvs Check consistency of PV sizes in a node for exclusive storage.
Function LvmExclusiveTestBadPvSizes Test if the given PV sizes are permitted with exclusive storage.
def CheckVolumeGroupSize(vglist, vgname, minsize):

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:dictdictionary of volume group names and their size
vgname:strthe volume group we should check
minsize:intthe minimum size we accept
Returns
None or strNone for success, otherwise the error message
def LvmExclusiveCheckNodePvs(pvs_info):

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

Parameters
pvs_info:listlist of LvmPvInfo objects
Returns
tupleA 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.
def LvmExclusiveTestBadPvSizes(small, big):

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

Parameters
smallsize of the smallest PV
bigsize of the biggest PV
Returns
True when the given sizes are bad, False otherwise