Module bdev
source code
Block device abstraction
boolean
|
|
|
|
|
|
|
|
|
_VerifyDiskParams(disk)
Verifies if all disk parameters are set. |
source code
|
|
|
|
|
|
|
|
|
_DEVICE_READ_SIZE = 128* 1024
|
|
DEV_MAP = {constants.LD_LV: LogicalVolume, constants.LD_DRBD8:...
|
Imports:
re,
time,
errno,
shlex,
stat,
pyp,
os,
logging,
utils,
errors,
constants,
objects,
compat,
netutils
Executes the given function, ignoring BlockDeviceErrors.
This is used in order to simplify the execution of cleanup or rollback
functions.
- Returns: boolean
- True when fn didn't raise an exception, False otherwise
|
Log an error to the node daemon and the raise an exception.
- Parameters:
msg (string) - the text of the exception @raise errors.BlockDeviceError
|
Check if we can read from the given device.
This tries to read the first 128k of the device.
|
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.Disk) - the disk object to find
children (list of bdev.BlockDev) - the list of block devices that are children of the device
represented by the disk parameter
|
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.Disk) - the disk object to assemble
children (list of bdev.BlockDev) - the list of block devices that are children of the device
represented by the disk parameter
|
Create a device.
- Parameters:
disk (objects.Disk) - the disk object to create
children (list of bdev.BlockDev) - the list of block devices that are children of the device
represented by the disk parameter
|
DEV_MAP
- Value:
{constants.LD_LV: LogicalVolume, constants.LD_DRBD8: DRBD8, constants.
LD_BLOCKDEV: PersistentBlockDevice, constants.LD_RBD: RADOSBlockDevice
,}
|
|