The cinder.volume.drivers.sheepdog Module

SheepDog Volume Driver.

class SheepdogClient(node_list, port)

Bases: object

Sheepdog command executor.

DOG_RESP_CLUSTER_NOT_FORMATTED = 'Cluster status: Waiting for cluster to be formatted'
DOG_RESP_CLUSTER_RUNNING = 'Cluster status: running'
DOG_RESP_CLUSTER_WAITING = 'Cluster status: Waiting for other nodes to join cluster'
DOG_RESP_CONNECTION_ERROR = 'failed to connect to'
DOG_RESP_SNAPSHOT_EXISTED = 'tag (%(snapname)s) is existed'
DOG_RESP_SNAPSHOT_NOT_FOUND = ': Failed to find requested tag'
DOG_RESP_SNAPSHOT_VDI_NOT_FOUND = ': No VDI found'
DOG_RESP_VDI_ALREADY_EXISTS = ': VDI exists already'
DOG_RESP_VDI_NOT_FOUND = ': No VDI found'
DOG_RESP_VDI_SHRINK_NOT_SUPPORT = 'Shrinking VDIs is not implemented'
DOG_RESP_VDI_SIZE_TOO_LARGE = 'New VDI size is too large'
QEMU_IMG_RESP_ALREADY_EXISTS = ': VDI exists already'
QEMU_IMG_RESP_CONNECTION_ERROR = 'Failed to connect socket: Connection refused'
QEMU_IMG_RESP_SIZE_TOO_LARGE = 'An image is too large.'
QEMU_IMG_RESP_SNAPSHOT_NOT_FOUND = 'Failed to find the requested tag'
QEMU_IMG_RESP_VDI_NOT_FOUND = 'No vdi found'
QEMU_SHEEPDOG_PREFIX = 'sheepdog:'
check_cluster_status()
clone(src_vdiname, src_snapname, dst_vdiname, size)
create(vdiname, size)
create_snapshot(vdiname, snapname)
delete(vdiname)
delete_snapshot(vdiname, snapname)
get_addr()

Get a random node in sheepdog cluster.

get_vdi_info(vdiname)
get_volume_stats()
local_path(volume)

Return a sheepdog location path.

resize(vdiname, size)
update_node_list()
class SheepdogDriver(*args, **kwargs)

Bases: cinder.volume.driver.VolumeDriver

Executes commands relating to Sheepdog Volumes.

CI_WIKI_NAME = 'Cinder_Jenkins'
VERSION = '1.0.0'
backup_volume(context, backup, backup_service)

Create a new backup from an existing volume.

check_for_setup_error()

Check cluster status and update node list.

clone_image(context, volume, image_location, image_meta, image_service)

Create a volume efficiently from an existing image.

copy_image_to_volume(context, volume, image_service, image_id)
copy_volume_to_image(context, volume, image_service, image_meta)

Copy the volume to the specified image.

create_cloned_volume(volume, src_vref)

Clone a sheepdog volume from another volume.

create_export(context, volume, connector)

Export a volume.

create_snapshot(snapshot)

Create a sheepdog snapshot.

create_volume(volume)

Create a sheepdog volume.

create_volume_from_snapshot(volume, snapshot)

Create a sheepdog volume from a snapshot.

delete_snapshot(snapshot)

Delete a sheepdog snapshot.

delete_volume(volume)

Delete a logical volume.

ensure_export(context, volume)

Safely and synchronously recreate an export for a logical volume.

extend_volume(volume, new_size)

Extend an Existing Volume.

get_volume_stats(refresh=False)
initialize_connection(volume, connector)
remove_export(context, volume)

Remove an export for a logical volume.

restore_backup(context, backup, volume, backup_service)

Restore an existing backup to a new or existing volume.

terminate_connection(volume, connector, **kwargs)
class SheepdogIOWrapper(addr, port, volume, snapshot_name=None)

Bases: io.RawIOBase

File-like object with Sheepdog backend.

fileno()

Sheepdog does not have support for fileno so we raise IOError.

Raising IOError is recommended way to notify caller that interface is not supported - see http://docs.python.org/2/library/io.html#io.IOBase

flush()
read(length=None)
seek(offset, whence=0)
tell()
write(data)