cinder.volume.targets.iscsi module

class ISCSITarget(*args, **kwargs)

Bases: Target

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.

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.

create_export(context, volume, volume_path)

Creates an export for a logical volume.

abstract create_iscsi_target(name, tid, lun, path, chap_auth, **kwargs)
ensure_export(context, volume, volume_path)

Recreates an export for a logical volume.

extend_target(volume)

Reinitializes a target after the LV has been extended.

Note: This will cause IO disruption in most cases.

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': '9a0d35d0-175a-11e4-8c21-0800200c9a66',
        'discard': False,
    }
}
remove_export(context, volume)

Removes an export for a Target/Volume.

abstract remove_iscsi_target(tid, lun, vol_id, vol_name, **kwargs)
show_target(iscsi_target, iqn, **kwargs)
terminate_connection(volume, connector, **kwargs)

Disallow connection from connector.

validate_connector(connector)
class SanISCSITarget(*args, **kwargs)

Bases: ISCSITarget

iSCSI target for san devices.

San devices are slightly different, they don’t need to implement all of the same things that we need to implement locally fro LVM and local block devices when we create and manage our own targets.

abstract create_export(context, volume, volume_path)

Creates an export for a logical volume.

create_iscsi_target(name, tid, lun, path, chap_auth, **kwargs)
abstract ensure_export(context, volume, volume_path)

Recreates an export for a logical volume.

abstract remove_export(context, volume)

Removes an export for a Target/Volume.

remove_iscsi_target(tid, lun, vol_id, vol_name, **kwargs)
abstract terminate_connection(volume, connector, **kwargs)

Disallow connection from connector.