The cinder.volume.drivers.sheepdog Module

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'
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)

Fetch image from image_service and write to unencrypted volume.

This does not attach an encryptor layer when connecting to the volume.

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)

Return the current state of the volume service.

If ‘refresh’ is True, run the update first.

For replication the following state should be reported: replication = True (None or false disables replication)

initialize_connection(volume, connector)

Allow connection to connector and return connection info.

Parameters:
  • volume – The volume to be attached
  • connector – Dictionary containing information about what is being connected to.
Returns conn_info:
 

A dictionary of connection information.

remove_export(context, volume)

Remove an export for a logical volume.

terminate_connection(volume, connector, **kwargs)

Disallow connection from connector

Parameters:
  • volume – The volume to be disconnected.
  • connector – A dictionary describing the connection with details about the initiator. Can be None.
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()

Flush write buffers, if applicable.

This is not implemented for read-only and non-blocking streams.

read(length=None)
seek(offset, whence=0)

Change stream position.

Change the stream position to the given byte offset. The offset is interpreted relative to the position indicated by whence. Values for whence are:

  • 0 – start of stream (the default); offset should be zero or positive
  • 1 – current stream position; offset may be negative
  • 2 – end of stream; offset is usually negative

Return the new absolute position.

tell()

Return current stream position.

write(data)
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.