Logo Search packages:      
Sourcecode: ganeti version File versions  Download package

lib::bdev::BlockDev Class Reference

Inheritance diagram for lib::bdev::BlockDev:

lib::bdev::BaseDRBD lib::bdev::LogicalVolume lib::bdev::MDRaid1 lib::bdev::DRBD8 lib::bdev::DRBDev

List of all members.


Detailed Description

Block device abstract class.

A block device can be in the following states:
  - not existing on the system, and by `Create()` it goes into:
  - existing but not setup/not active, and by `Assemble()` goes into:
  - active read-write and by `Open()` it goes into
  - online (=used, or ready for use)

A device can also be online but read-only, however we are not using
the readonly state (MD and LV have it, if needed in the future)
and we are usually looking at this like at a stack, so it's easier
to conceptualise the transition from not-existing to online and back
like a linear one.

The many different states of the device are due to the fact that we
need to cover many device types:
  - logical volumes are created, lvchange -a y $lv, and used
  - md arrays are created or assembled and used
  - drbd devices are attached to a local disk/remote peer and made primary

The status of the device can be examined by `GetStatus()`, which
returns a numerical value, depending on the position in the
transition stack of the device.

A block device is identified by three items:
  - the /dev path of the device (dynamic)
  - a unique ID of the device (static)
  - it's major/minor pair (dynamic)

Not all devices implement both the first two as distinct items. LVM
logical volumes have their unique ID (the pair volume group, logical
volume name) in a 1-to-1 relation to the dev path. For MD devices,
the /dev path is dynamic and the unique ID is the UUID generated at
array creation plus the slave list. For DRBD devices, the /dev path
is again dynamic and the unique id is the pair (host1, dev1),
(host2, dev2).

You can get to a device in two ways:
  - creating the (real) device, which returns you
    an attached instance (lvcreate, mdadm --create)
  - attaching of a python instance to an existing (real) device

The second point, the attachement to a device, is different
depending on whether the device is assembled or not. At init() time,
we search for a device with the same unique_id as us. If found,
good. It also means that the device is already assembled. If not,
after assembly we'll have our correct major/minor.

Definition at line 35 of file bdev.py.


Public Member Functions

def __init__
def __repr__
def Assemble
def Attach
def Close
def CombinedSyncStatus
def Create
def GetStatus
def GetSyncStatus
def Open
def Remove
def Rename
def SetInfo
def SetSyncSpeed
def Shutdown

Public Attributes

 dev_path
 major
 minor
 unique_id

Static Public Attributes

int STATUS_EXISTING = 1
dictionary STATUS_MAP
int STATUS_ONLINE = 3
int STATUS_STANDBY = 2
int STATUS_UNKNOWN = 0

Private Attributes

 _children

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index