Package ganeti :: Module bdev
[hide private]
[frames] | no frames]

Module bdev

source code

Block device abstraction

Classes [hide private]
  BlockDev
Block device abstract class.
  LogicalVolume
Logical Volume block device.
  DRBD8Status
A DRBD status representation class.
  BaseDRBD
Base DRBD class.
  DRBD8
DRBD v8.x block device.
  FileStorage
File device.
  PersistentBlockDevice
A block device with persistent node
Functions [hide private]
boolean
_IgnoreError(fn, *args, **kwargs)
Executes the given function, ignoring BlockDeviceErrors.
source code
 
_ThrowError(msg, *args)
Log an error to the node daemon and the raise an exception.
source code
 
_CanReadDevice(path)
Check if we can read from the given device.
source code
 
FindDevice(dev_type, unique_id, children, size)
Search for an existing, assembled device.
source code
 
Assemble(dev_type, unique_id, children, size)
Try to attach or assemble an existing device.
source code
 
Create(dev_type, unique_id, children, size)
Create a device.
source code
Variables [hide private]
  _DEVICE_READ_SIZE = 128* 1024
  DEV_MAP = {constants.LD_LV: LogicalVolume, constants.LD_DRBD8:...

Imports: re, time, errno, stat, pyp, os, logging, utils, errors, constants, objects, compat, netutils


Function Details [hide private]

_IgnoreError(fn, *args, **kwargs)

source code 

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

_ThrowError(msg, *args)

source code 

Log an error to the node daemon and the raise an exception.

Parameters:
  • msg (string) - the text of the exception @raise errors.BlockDeviceError

_CanReadDevice(path)

source code 

Check if we can read from the given device.

This tries to read the first 128k of the device.

FindDevice(dev_type, unique_id, children, size)

source code 

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.

Assemble(dev_type, unique_id, children, size)

source code 

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.


Variables Details [hide private]

DEV_MAP

Value:
{constants.LD_LV: LogicalVolume, constants.LD_DRBD8: DRBD8, constants.\
LD_BLOCKDEV: PersistentBlockDevice,}