module documentation
ExtStorage Interface related functionality
Class |
|
A block device provided by an ExtStorage Provider. |
Function |
|
Create an ExtStorage instance from disk. |
Function | _ |
Check prereqs for an ExtStorage file. |
Function | _ |
Take an External Storage action. |
Function | _ |
Calculate the environment for an External Storage script. |
Function | _ |
Compute the ExtStorage log filename for a given Volume and operation. |
Create an ExtStorage instance from disk.
This function will return an ExtStorage instance if the given name is a valid ExtStorage name.
Parameters | |
name | Undocumented |
base | Base directory containing ExtStorage installations. Defaults to a search in all the ES_SEARCH_PATH dirs. |
Returns | |
tuple | True and the ExtStorage instance if we find a valid one, or False and the diagnose message on error |
Check prereqs for an ExtStorage file.
Check if file exists, if it is a regular file and in case it is one of extstorage scripts if it is executable.
Parameters | |
base | Base directory containing ExtStorage installations. |
filename:string | The basename of the ExtStorage file. |
required:bool | Whether the file is required or not. |
Returns | |
String | The file path if the file is found and is valid, None if the file is not found and not required. |
Raises | |
BlockDeviceError | In case prereqs are not met (found and not valid/executable, not found and required) |
def _ExtStorageAction(action, unique_id, ext_params, size=None, grow=None, metadata=None, name=None, uuid=None, snap_name=None, snap_size=None, exclusive=None):
¶
Take an External Storage action.
Take an External Storage action concerning or affecting a specific Volume inside the External Storage.
Parameters | |
action:string | which action to perform. One of: create / remove / grow / attach / detach / snapshot |
unique | a tuple containing the type of ExtStorage (driver) and the Volume name |
ext | ExtStorage parameters |
size:integer | the size of the Volume in mebibytes |
grow:integer | the new size in mebibytes (after grow) |
metadata:string | metadata info of the Volume, for use by the provider |
name:string | name of the Volume (objects.Disk.name) |
uuid:string | uuid of the Volume (objects.Disk.uuid) |
snap | the name of the snapshot |
snap | the size of the snapshot |
exclusive:boolean | Whether the Volume will be opened exclusively or not |
Returns | |
None or a block device path (during attach) | Undocumented |
def _ExtStorageEnvironment(unique_id, ext_params, size=None, grow=None, metadata=None, name=None, uuid=None, snap_name=None, snap_size=None, exclusive=None):
¶
Calculate the environment for an External Storage script.
Parameters | |
unique | ExtStorage pool and name of the Volume |
ext | the EXT parameters |
size:integer | size of the Volume (in mebibytes) |
grow:integer | new size of Volume after grow (in mebibytes) |
metadata:string | metadata info of the Volume |
name:string | name of the Volume (objects.Disk.name) |
uuid:string | uuid of the Volume (objects.Disk.uuid) |
snap | the name of the snapshot |
snap | the size of the snapshot |
exclusive:boolean | Whether the Volume will be opened exclusively or not |
Returns | |
dict | dict of environment variables |