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

Class PersistentBlockDevice

source code


A block device with persistent node

May be either directly attached, or exposed through DM (e.g. dm-multipath). udev helpers are probably required to give persistent, human-friendly names.

For the time being, pathnames are required to lie under /dev.

Instance Methods [hide private]
 
__init__(self, unique_id, children, size, params, dyn_params)
Attaches to a static block device.
source code
 
Remove(self)
Remove a device
source code
 
Rename(self, new_id)
Rename this device.
source code
 
Attach(self)
Attach to an existing block device.
source code
 
Assemble(self)
Assemble the device.
source code
 
Shutdown(self)
Shutdown the device.
source code
 
Open(self, force=False)
Make the device ready for I/O.
source code
 
Close(self)
Notifies that the device will no longer be used for I/O.
source code
 
Grow(self, amount, dryrun, backingstore, excl_stor)
Grow the logical volume.
source code

Inherited from base.BlockDev: CombinedSyncStatus, GetActualDimensions, GetActualSize, GetActualSpindles, GetSyncStatus, GetUserspaceAccessUri, PauseResumeSync, SetInfo, SetSyncParams, __repr__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
BlockDev
Create(cls, unique_id, children, size, spindles, params, excl_stor, dyn_params)
Create a new device
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, unique_id, children, size, params, dyn_params)
(Constructor)

source code 

Attaches to a static block device.

The unique_id is a path under /dev.

Overrides: object.__init__

Create(cls, unique_id, children, size, spindles, params, excl_stor, dyn_params)
Class Method

source code 

Create a new device

This is a noop, we only return a PersistentBlockDevice instance

Parameters:
  • unique_id - unique identifier; the details depend on the actual device type
  • children - for hierarchical devices, the child devices
  • size - size in MiB
  • spindles - number of physical disk to dedicate to the device
  • params - device-specific options/parameters
  • excl_stor - whether exclusive_storage is active
  • dyn_params - dynamic parameters of the disk only valid for this node. As set by objects.Disk.UpdateDynamicDiskParams.
Returns: BlockDev
the created device, or None in case of an error
Overrides: base.BlockDev.Create

Remove(self)

source code 

Remove a device

This is a noop

Overrides: base.BlockDev.Remove

Rename(self, new_id)

source code 

Rename this device.

Overrides: base.BlockDev.Rename

Attach(self)

source code 

Attach to an existing block device.

Overrides: base.BlockDev.Attach

Assemble(self)

source code 

Assemble the device.

Overrides: base.BlockDev.Assemble

Shutdown(self)

source code 

Shutdown the device.

Overrides: base.BlockDev.Shutdown

Open(self, force=False)

source code 

Make the device ready for I/O.

Overrides: base.BlockDev.Open

Close(self)

source code 

Notifies that the device will no longer be used for I/O.

Overrides: base.BlockDev.Close

Grow(self, amount, dryrun, backingstore, excl_stor)

source code 

Grow the logical volume.

Parameters:
  • amount - the amount (in mebibytes) to grow with
  • dryrun - whether to execute the operation in simulation mode only, without actually increasing the size
  • backingstore - whether to execute the operation on backing storage only, or on "logical" storage only; e.g. DRBD is logical storage, whereas LVM, file, RBD are backing storage
  • excl_stor - Whether exclusive_storage is active
Overrides: base.BlockDev.Grow