The cinder.volume.driver Module

Drivers for volumes.

class FakeISCSIDriver(*args, **kwargs)

Bases: cinder.volume.driver.ISCSIDriver

Logs calls instead of executing.

check_for_setup_error()

No setup necessary in fake mode.

create_volume(volume)
static fake_execute(cmd, *_args, **_kwargs)

Execute that simply logs the command.

initialize_connection(volume, connector)
terminate_connection(volume, connector, **kwargs)
class FakeISERDriver(*args, **kwargs)

Bases: cinder.volume.driver.FakeISCSIDriver

Logs calls instead of executing.

static fake_execute(cmd, *_args, **_kwargs)

Execute that simply logs the command.

initialize_connection(volume, connector)
class FibreChannelDriver(*args, **kwargs)

Bases: cinder.volume.driver.VolumeDriver

Executes commands relating to Fibre Channel volumes.

initialize_connection(volume, connector)

Initializes the connection and returns connection info.

The driver returns a driver_volume_type of ‘fibre_channel’. The target_wwn can be a single entry or a list of wwns that correspond to the list of remote wwn(s) that will export the volume. Example return values:

{

‘driver_volume_type’: ‘fibre_channel’ ‘data’: {

‘target_discovered’: True, ‘target_lun’: 1, ‘target_wwn’: ‘1234567890123’, ‘access_mode’: ‘rw’

}

}

or

{

‘driver_volume_type’: ‘fibre_channel’ ‘data’: {

‘target_discovered’: True, ‘target_lun’: 1, ‘target_wwn’: [‘1234567890123’, ‘0987654321321’], ‘access_mode’: ‘rw’

}

}

class ISCSIDriver(*args, **kwargs)

Bases: cinder.volume.driver.VolumeDriver

Executes commands relating to ISCSI volumes.

We make use of model provider properties as follows:

provider_location
if present, contains the iSCSI target information in the same format as an ietadm discovery i.e. ‘<ip>:<port>,<portal> <target IQN>’
provider_auth
if present, contains a space-separated triple: ‘<auth method> <auth username> <auth password>’. CHAP is the only auth_method in use at the moment.
accept_transfer(context, volume, new_user, new_project)
get_target_admin()
get_volume_stats(refresh=False)

Get volume stats.

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

initialize_connection(volume, connector)

Initializes the connection and returns connection info.

The iscsi driver returns a driver_volume_type of ‘iscsi’. The format of the driver data is defined in _get_iscsi_properties. Example return value:

{
    'driver_volume_type': 'iscsi'
    'data': {
        'target_discovered': True,
        'target_iqn': 'iqn.2010-10.org.openstack:volume-00000001',
        'target_portal': '127.0.0.0.1:3260',
        'volume_id': 1,
        'access_mode': 'rw'
    }
}
terminate_connection(volume, connector, **kwargs)
validate_connector(connector)
class ISERDriver(*args, **kwargs)

Bases: cinder.volume.driver.ISCSIDriver

Executes commands relating to ISER volumes.

We make use of model provider properties as follows:

provider_location
if present, contains the iSER target information in the same format as an ietadm discovery i.e. ‘<ip>:<port>,<portal> <target IQN>’
provider_auth
if present, contains a space-separated triple: ‘<auth method> <auth username> <auth password>’. CHAP is the only auth_method in use at the moment.
get_target_admin()
initialize_connection(volume, connector)

Initializes the connection and returns connection info.

The iser driver returns a driver_volume_type of ‘iser’. The format of the driver data is defined in _get_iser_properties. Example return value:

{
    'driver_volume_type': 'iser'
    'data': {
        'target_discovered': True,
        'target_iqn':
        'iqn.2010-10.org.iser.openstack:volume-00000001',
        'target_portal': '127.0.0.0.1:3260',
        'volume_id': 1,
    }
}
class VolumeDriver(execute=<function execute at 0x7f5a4c4b4b18>, *args, **kwargs)

Bases: object

Executes commands relating to Volumes.

VERSION = 'N/A'
attach_volume(context, volume, instance_uuid, host_name, mountpoint)

Callback for volume attached to instance or host.

backup_volume(context, backup, backup_service)

Create a new backup from an existing volume.

check_for_setup_error()
clear_download(context, volume)

Clean up after an interrupted image copy.

clone_image(volume, image_location, image_id)

Create a volume efficiently from an existing image.

image_location is a string whose format depends on the image service backend in use. The driver should use it to determine whether cloning is possible.

image_id is a string which represents id of the image. It can be used by the driver to introspect internal stores or registry to do an efficient image clone.

Returns a dict of volume properties eg. provider_location, boolean indicating whether cloning occurred

copy_image_to_volume(context, volume, image_service, image_id)

Fetch the image from image_service and write it to the volume.

copy_volume_data(context, src_vol, dest_vol, remote=None)

Copy data from src_vol to dest_vol.

copy_volume_to_image(context, volume, image_service, image_meta)

Copy the volume to the specified image.

create_cloned_volume(volume, src_vref)

Creates a clone of the specified volume.

create_export(context, volume)

Exports the volume. Can optionally return a Dictionary of changes to the volume object to be persisted.

create_snapshot(snapshot)

Creates a snapshot.

create_volume(volume)

Creates a volume. Can optionally return a Dictionary of changes to the volume object to be persisted.

create_volume_from_snapshot(volume, snapshot)

Creates a volume from a snapshot.

delete_snapshot(snapshot)

Deletes a snapshot.

delete_volume(volume)

Deletes a volume.

detach_volume(context, volume)

Callback for volume detached.

do_setup(context)

Any initialization the volume driver does while starting

ensure_export(context, volume)

Synchronously recreates an export for a volume.

extend_volume(volume, new_size)
get_version()

Get the current version of this driver.

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)

Allow connection to connector and return connection info.

initialized
local_path(volume)
migrate_volume(context, volume, host)

Migrate the volume to the specified host.

Returns a boolean indicating whether the migration occurred, as well as model_update.

remove_export(context, volume)

Removes an export for a volume.

restore_backup(context, backup, volume, backup_service)

Restore an existing backup to a new or existing volume.

set_execute(execute)
set_initialized()
terminate_connection(volume, connector, **kwargs)

Disallow connection from connector

validate_connector(connector)

Fail if connector doesn’t contain all the data needed by driver

Previous topic

The cinder.volume.configuration Module

Next topic

The cinder.volume.drivers.block_device Module

This Page