cinder.volume.targets.driver module

class Target(*args, **kwargs)

Bases: object

Target object for block storage devices.

Base class for target object, where target is data transport mechanism (target) specific calls. This includes things like create targets, attach, detach etc.

Base class here does nothing more than set an executor and db as well as force implementation of required methods.

static are_same_connector(A, B)

Whether 2 connectors belong to the same host or not.

This is used for multi attach volumes, to be able to know when there are no more attachments on a given host.

This is the generic implementation, but specific targets may overwrite it. For example iSCSI would check the the “initiator” key instead, and NVMe-oF would check the “nqn” key.

abstract create_export(context, volume, volume_path)

Exports a Target/Volume.

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

abstract ensure_export(context, volume, volume_path)

Synchronously recreates an export for a volume.


Reinitializes a target after the volume has been extended.

Most drivers don’t need to do anything, but in other cases this may cause IO disruption.

abstract initialize_connection(volume, connector)

Allow connection to connector and return connection info.

abstract remove_export(context, volume)

Removes an export for a Target/Volume.

storage_protocol = None
abstract terminate_connection(volume, connector, **kwargs)

Disallow connection from connector.