module documentation

Block device abstraction.

Class LogicalVolume Logical Volume block device.
Class PersistentBlockDevice A block device with persistent node
Class RADOSBlockDevice A RADOS Block Device (rbd).
Exception RbdShowmappedJsonError `rbd showmmapped' JSON formatting error Exception class.
Function Assemble Try to attach or assemble an existing device.
Function Create Create a device.
Function FindDevice Search for an existing, assembled device.
Constant DEV_MAP Map disk types to disk type classes.
Function _CheckResult Throws an error if the given result is a failed one.
Function _VerifyDiskParams Verifies if all disk parameters are set.
Function _VerifyDiskType Undocumented
def Assemble(disk, children):

Try to attach or assemble an existing device.

This will attach to assemble the device, as needed, to bring it fully up. It must be safe to run on already-assembled devices.

Parameters
disk:objects.Diskthe disk object to assemble
children:list of bdev.BlockDevthe list of block devices that are children of the device represented by the disk parameter
def Create(disk, children, excl_stor):

Create a device.

Parameters
disk:objects.Diskthe disk object to create
children:list of bdev.BlockDevthe list of block devices that are children of the device represented by the disk parameter
excl_stor:booleanWhether exclusive_storage is active
Returns
bdev.BlockDevthe created device, or None in case of an error
def FindDevice(disk, children, **kwargs):

Search for an existing, assembled device.

This will succeed only if the device exists and is assembled, but it does not do any actions in order to activate the device.

Parameters
disk:objects.Diskthe disk object to find
children:list of bdev.BlockDevthe list of block devices that are children of the device represented by the disk parameter
**kwargsUndocumented
def _CheckResult(result):

Throws an error if the given result is a failed one.

Parameters
resultresult from RunCmd
def _VerifyDiskParams(disk):

Verifies if all disk parameters are set.

def _VerifyDiskType(dev_type):

Undocumented