Package ganeti :: Package storage :: Module extstorage :: Class ExtStorageDevice
[hide private]
[frames] | no frames]

Class ExtStorageDevice

source code


A block device provided by an ExtStorage Provider.

This class implements the External Storage Interface, which means handling of the externally provided block devices.

Instance Methods [hide private]
 
__init__(self, unique_id, children, size, params, dyn_params, *args)
Attaches to an extstorage block device.
source code
 
Remove(self)
Remove the extstorage device.
source code
 
Rename(self, new_id)
Rename this device.
source code
 
Attach(self)
Attach to an existing extstorage device.
source code
 
Assemble(self)
Assemble the device.
source code
 
Shutdown(self)
Shutdown the device.
source code
 
Open(self, force=False, exclusive=True)
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 Volume.
source code
 
SetInfo(self, text)
Update metadata with info text.
source code
string
GetUserspaceAccessUri(self, hypervisor)
Generate KVM userspace URIs to be used as `-drive file` settings.
source code
tuple
Snapshot(self, snap_name=None, snap_size=None)
Take a snapshot of the block device.
source code

Inherited from base.BlockDev: CombinedSyncStatus, Export, GetActualDimensions, GetActualSize, GetActualSpindles, GetSyncStatus, Import, PauseResumeSync, 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, *args)
Create a new extstorage device.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

Attaches to an extstorage block device.

Overrides: object.__init__

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

source code 

Create a new extstorage device.

Provision a new volume using an extstorage provider, which will then be mapped to a block device.

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 the extstorage device.

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 extstorage device.

This method maps the extstorage volume that matches our name with a corresponding block device and then attaches to this 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, exclusive=True)

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 Volume.

Parameters:
  • amount (integer) - the amount (in mebibytes) to grow with
  • dryrun (boolean) - whether to execute the operation in simulation mode only, without actually increasing the size
Overrides: base.BlockDev.Grow

SetInfo(self, text)

source code 

Update metadata with info text.

Overrides: base.BlockDev.SetInfo

GetUserspaceAccessUri(self, hypervisor)

source code 

Generate KVM userspace URIs to be used as `-drive file` settings.

Returns: string
userspace device URI
Raises:
Overrides: base.BlockDev.GetUserspaceAccessUri

Snapshot(self, snap_name=None, snap_size=None)

source code 

Take a snapshot of the block device.

Parameters:
  • snap_name - The name of the snapshot.
  • snap_size - The size of the snapshot.
Returns: tuple
The logical id of the newly created disk.
Overrides: base.BlockDev.Snapshot