Package ganeti :: Package storage :: Module gluster :: Class GlusterStorage
[hide private]
[frames] | no frames]

Class GlusterStorage

source code


File device using the Gluster backend.

This class represents a file storage backend device stored on Gluster. Ganeti mounts and unmounts the Gluster devices automatically.

The unique_id for the file device is a (file_driver, file_path) tuple.

Instance Methods [hide private]
 
__init__(self, unique_id, children, size, params, dyn_params, *args)
Initalizes a file device backend.
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
boolean
Remove(self)
Remove the file backing the block device.
source code
 
Rename(self, new_id)
Renames the file.
source code
 
Grow(self, amount, dryrun, backingstore, excl_stor)
Grow the file
source code
boolean
Attach(self)
Attach to an existing file.
source code
 
GetActualSize(self)
Return the actual disk size.
source code
string
GetUserspaceAccessUri(self, hypervisor)
Generate KVM userspace URIs to be used as `-drive file` settings.
source code

Inherited from base.BlockDev: CombinedSyncStatus, Export, GetActualDimensions, GetActualSpindles, GetSyncStatus, Import, PauseResumeSync, SetInfo, SetSyncParams, Snapshot, __repr__

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

Class Methods [hide private]
bdev.FileStorage
Create(cls, unique_id, children, size, spindles, params, excl_stor, dyn_params, *args)
Create a new file.
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 

Initalizes a file device backend.

Overrides: object.__init__

Assemble(self)

source code 

Assemble the device.

Checks whether the file device exists, raises BlockDeviceError otherwise.

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.

This is a no-op for the file type.

Overrides: base.BlockDev.Open

Close(self)

source code 

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

This is a no-op for the file type.

Overrides: base.BlockDev.Close

Remove(self)

source code 

Remove the file backing the block device.

Returns: boolean
True if the removal was successful
Overrides: base.BlockDev.Remove

Rename(self, new_id)

source code 

Renames the file.

Overrides: base.BlockDev.Rename

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

source code 

Grow the file

Parameters:
  • amount - the amount (in mebibytes) to grow with
Overrides: base.BlockDev.Grow

Attach(self)

source code 

Attach to an existing file.

Check if this file already exists.

Returns: boolean
True if file exists
Overrides: base.BlockDev.Attach

GetActualSize(self)

source code 

Return the actual disk size.

Overrides: base.BlockDev.GetActualSize

Note: the device needs to be active when this is called

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
See Also:
BlockDev.GetUserspaceAccessUri, https://github.com/qemu/qemu/commit/8d6d89cb63c57569864ecdeb84d3a1c2eb

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

source code 

Create a new file.

Parameters:
  • size - the size of file in MiB
Returns: bdev.FileStorage
an instance of FileStorage
Overrides: base.BlockDev.Create