The cinder.volume.drivers.rbd Module

RADOS Block Device Driver

class RADOSClient(driver, pool=None)

Bases: object

Context manager to simplify error handling for connecting to ceph.

class RBDDriver(*args, **kwargs)

Bases: cinder.volume.driver.VolumeDriver

Implements RADOS block device (RBD) volume commands.

VERSION = '1.1.0'
backup_volume(context, backup, backup_service)

Create a new backup from an existing volume.

check_for_setup_error()

Returns an error if prerequisites aren’t met.

clone_image(volume, image_location, image_id, image_meta)
copy_image_to_volume(context, volume, image_service, image_id)
copy_volume_to_image(context, volume, image_service, image_meta)
create_cloned_volume(volume, src_vref)

Create a cloned volume from another volume.

Since we are cloning from a volume and not a snapshot, we must first create a snapshot of the source volume.

The user has the option to limit how long a volume’s clone chain can be by setting rbd_max_clone_depth. If a clone is made of another clone and that clone has rbd_max_clone_depth clones behind it, the source volume will be flattened.

create_export(context, volume)

Exports the volume.

create_snapshot(snapshot)

Creates an rbd snapshot.

create_volume(volume)

Creates a logical volume.

create_volume_from_snapshot(volume, snapshot)

Creates a volume from a snapshot.

delete_snapshot(snapshot)

Deletes an rbd snapshot.

delete_volume(volume)

Deletes a logical volume.

ensure_export(context, volume)

Synchronously recreates 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.

initialize_connection(volume, connector)
remove_export(context, volume)

Removes 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 RBDImageIOWrapper(rbd_meta)

Bases: io.RawIOBase

Enables LibRBD.Image objects to be treated as Python IO objects.

Calling unimplemented interfaces will raise IOError.

close()
fileno()

RBD 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()
rbd_conf
rbd_image
rbd_pool
rbd_user
read(length=None)
seek(offset, whence=0)
seekable()
tell()
write(data)
class RBDImageMetadata(image, pool, user, conf)

Bases: object

RBD image metadata to be used with RBDImageIOWrapper.

class RBDVolumeProxy(driver, name, pool=None, snapshot=None, read_only=False)

Bases: object

Context manager for dealing with an existing rbd volume.

This handles connecting to rados and opening an ioctx automatically, and otherwise acts like a librbd Image object.

The underlying librados client and ioctx can be accessed as the attributes ‘client’ and ‘ioctx’.

ascii_str(string)

Convert a string to ascii, or return None if the input is None.

This is useful when a parameter is None by default, or a string. LibRBD only accepts ascii, hence the need for conversion.

Previous topic

The cinder.volume.drivers.nfs Module

Next topic

The cinder.volume.drivers.san.hp.hp_3par_common Module

This Page