class RADOSBlockDevice(base.BlockDev):
A RADOS Block Device (rbd).
This class implements the RADOS Block Device for the backend. You need the rbd kernel driver, the RADOS Tools and a working RADOS cluster for this to be functional.
Class Method |
|
Create a new rbd device. |
Method | __init__ |
Attaches to an rbd device. |
Method |
|
Assemble the device. |
Method |
|
Attach to an existing rbd device. |
Method |
|
Notifies that the device will no longer be used for I/O. |
Method |
|
Builds the shell command for exporting data from device. |
Method |
|
Generate KVM userspace URIs to be used as `-drive file` settings. |
Method |
|
Grow the Volume. |
Method |
|
Builds the shell command for importing data to device. |
Method |
|
Make the device ready for I/O. |
Method |
|
Remove the rbd device. |
Method |
|
Rename this device. |
Method |
|
Shutdown the device. |
Instance Variable | attached |
Undocumented |
Instance Variable | dev |
Undocumented |
Instance Variable | driver |
Undocumented |
Instance Variable | major |
Undocumented |
Instance Variable | minor |
Undocumented |
Instance Variable | rbd |
Undocumented |
Instance Variable | rbd |
Undocumented |
Class Method | _ |
Do the 'volume name'-to-'rbd block device' resolving. |
Static Method | _ |
Parse the json output of `rbd showmapped'. |
Static Method | _ |
Parse the (plain / text) output of `rbd showmapped'. |
Method | _ |
Maps existing rbd volumes to block devices. |
Method | _ |
Unmaps the rbd device from the Volume it is mapped. |
Inherited from BlockDev
:
Method | __eq__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method |
|
Calculate the mirror status recursively for our children. |
Method |
|
Return the actual disk size and number of spindles used. |
Method |
|
Return the actual disk size. |
Method |
|
Return the actual number of spindles used. |
Method |
|
Returns the sync status of the device. |
Method |
|
Pause/Resume the sync of the mirror. |
Method |
|
Update metadata with info text. |
Method |
|
Adjust the synchronization parameters of the mirror. |
Method |
|
Creates a snapshot of the block device. |
Instance Variable | dyn |
Undocumented |
Instance Variable | params |
Undocumented |
Instance Variable | size |
Undocumented |
Instance Variable | unique |
Undocumented |
Instance Variable | _children |
Undocumented |
def Create(cls, unique_id, children, size, spindles, params, excl_stor, dyn_params, **kwargs): ¶
ganeti.storage.base.BlockDev.Create
Create a new rbd device.
Provision a new rbd volume inside a RADOS pool.
ganeti.storage.base.BlockDev.Attach
Attach to an existing rbd device.
This method maps the rbd volume that matches our name with an rbd device and then attaches to this device.
ganeti.storage.base.BlockDev.Close
Notifies that the device will no longer be used for I/O.
ganeti.storage.base.BlockDev.Export
Builds the shell command for exporting data from device.
See Also | |
BlockDev.Export for details |
Generate KVM userspace URIs to be used as `-drive file` settings.
See Also | |
BlockDev.GetUserspaceAccessUri |
ganeti.storage.base.BlockDev.Grow
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 |
backingstore | Undocumented |
excl | Undocumented |
ganeti.storage.base.BlockDev.Import
Builds the shell command for importing data to device.
See Also | |
BlockDev.Import for details |
Do the 'volume name'-to-'rbd block device' resolving.
Parameters | |
pool:string | RADOS pool to use |
volume | the name of the volume whose device we search for |
Returns | |
string or None | block device path if the volume is mapped, else None |
Parse the json output of `rbd showmapped'.
This method parses the json output of `rbd showmapped' and returns the rbd block device path (e.g. /dev/rbd0) that matches the given rbd volume.
Parameters | |
output:string | the json output of `rbd showmapped' |
volume | name of the volume whose device we search for |
volume | name of the pool in which we search |
Returns | |
string or None | block device path if the volume is mapped, else None |
Parse the (plain / text) output of `rbd showmapped'.
This method parses the output of `rbd showmapped' and returns the rbd block device path (e.g. /dev/rbd0) that matches the given rbd volume.
Parameters | |
output:string | the plain text output of `rbd showmapped' |
volume | the name of the volume whose device we search for |
Returns | |
string or None | block device path if the volume is mapped, else None |
Maps existing rbd volumes to block devices.
This method should be idempotent if the mapping already exists.
Returns | |
string | the block device path that corresponds to the volume |