The cinder.volume.drivers.datera.datera_iscsi Module

The cinder.volume.drivers.datera.datera_iscsi Module

class DateraDriver(*args, **kwargs)

Bases: cinder.volume.drivers.san.san.SanISCSIDriver, cinder.volume.drivers.datera.datera_api2.DateraApi, cinder.volume.drivers.datera.datera_api21.DateraApi

The OpenStack Datera Driver

Version history:
  • 1.0 - Initial driver
  • 1.1 - Look for lun-0 instead of lun-1.
  • 2.0 - Update For Datera API v2
  • 2.1 - Multipath, ACL and reorg
  • 2.2 - Capabilites List, Extended Volume-Type Support
    Naming convention change, Volume Manage/Unmanage support
  • 2.3 - Templates, Tenants, Snapshot Polling,
    2.1 Api Version Support, Restructure
  • 2.3.1 - Scalability bugfixes
  • 2.3.2 - Volume Placement, ACL multi-attach bugfix
  • 2.4.0 - Fast Retype Support
CI_WIKI_NAME = 'datera-ci'
HEADER_DATA = {'Datera-Driver': 'OpenStack-Cinder-2.4.0'}
VERSION = '2.4.0'
create_cloned_volume(volume, src_vref)

Creates a clone of the specified volume.

If volume_type extra specs includes ‘replication: <is> True’ the driver needs to create a volume replica (secondary) and setup replication between the newly created volume and the secondary volume.

create_export(context, volume, connector)

Exports the volume.

create_snapshot(snapshot)

Creates a snapshot.

create_volume(volume)

Create a logical volume.

create_volume_from_snapshot(volume, snapshot)

Creates a volume from a snapshot.

If volume_type extra specs includes ‘replication: <is> True’ the driver needs to create a volume replica (secondary), and setup replication between the newly created volume and the secondary volume.

delete_snapshot(snapshot)

Deletes a snapshot.

delete_volume(volume)

Deletes a volume.

If volume_type extra specs includes ‘replication: <is> True’ then the driver needs to delete the volume replica too.

detach_volume(context, volume, attachment=None)

Callback for volume detached.

do_setup(context)

Any initialization the volume driver does while starting.

ensure_export(context, volume, connector=None)

Gets the associated account, retrieves CHAP info and updates.

extend_volume(volume, new_size)
get_manageable_volumes(cinder_volumes, marker, limit, offset, sort_keys, sort_dirs)

List volumes on the backend available for management by Cinder.

Returns a list of dictionaries, each specifying a volume in the host, with the following keys:

  • reference (dictionary): The reference for a volume, which can be passed to ‘manage_existing’.
  • size (int): The size of the volume according to the storage backend, rounded up to the nearest GB.
  • safe_to_manage (boolean): Whether or not this volume is safe to manage according to the storage backend. For example, is the volume in use or invalid for any reason.
  • reason_not_safe (string): If safe_to_manage is False, the reason why.
  • cinder_id (string): If already managed, provide the Cinder ID.
  • extra_info (string): Any extra information to return to the user
Parameters:
  • cinder_volumes – A list of volumes in this host that Cinder currently manages, used to determine if a volume is manageable or not.
  • marker – The last item of the previous page; we return the next results after this value (after sorting)
  • limit – Maximum number of items to return
  • offset – Number of items to skip after marker
  • sort_keys – List of keys to sort results by (valid keys are ‘identifier’ and ‘size’)
  • sort_dirs – List of directions to sort by, corresponding to sort_keys (valid directions are ‘asc’ and ‘desc’)
get_volume_stats(refresh=False)

Get volume stats.

If ‘refresh’ is True, run update first. The name is a bit misleading as the majority of the data here is cluster data.

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,
        'discard': False,
    }
}

If the backend driver supports multiple connections for multipath and for single path with failover, “target_portals”, “target_iqns”, “target_luns” are also populated:

{
    'driver_volume_type': 'iscsi',
    'data': {
        'target_discovered': False,
        'target_iqn': 'iqn.2010-10.org.openstack:volume1',
        'target_iqns': ['iqn.2010-10.org.openstack:volume1',
                        'iqn.2010-10.org.openstack:volume1-2'],
        'target_portal': '10.0.0.1:3260',
        'target_portals': ['10.0.0.1:3260', '10.0.1.1:3260'],
        'target_lun': 1,
        'target_luns': [1, 1],
        'volume_id': 1,
        'discard': False,
    }
}
login()
manage_existing(volume, existing_ref)

Manage an existing volume on the Datera backend

The existing_ref must be either the current name or Datera UUID of an app_instance on the Datera backend in a colon separated list with the storage instance name and volume name. This means only single storage instances and single volumes are supported for managing by cinder.

Eg.

(existing_ref[‘source-name’] ==
tenant:app_inst_name:storage_inst_name:vol_name)

if using Datera 2.1 API

or

(existing_ref[‘source-name’] ==
app_inst_name:storage_inst_name:vol_name)

if using 2.0 API

Parameters:
  • volume – Cinder volume to manage
  • existing_ref – Driver-specific information used to identify a volume
manage_existing_get_size(volume, existing_ref)

Get the size of an unmanaged volume on the Datera backend

The existing_ref must be either the current name or Datera UUID of an app_instance on the Datera backend in a colon separated list with the storage instance name and volume name. This means only single storage instances and single volumes are supported for managing by cinder.

Eg.

existing_ref == app_inst_name:storage_inst_name:vol_name

Parameters:
  • volume – Cinder volume to manage
  • existing_ref – Driver-specific information used to identify a volume on the Datera backend
retype(ctxt, volume, new_type, diff, host)

Convert the volume to be of the new type.

Returns a boolean indicating whether the retype occurred.

Parameters:
  • ctxt – Context
  • volume – A dictionary describing the volume to migrate
  • new_type – A dictionary describing the volume type to convert to
  • diff – A dictionary with the difference between the two types
  • host – A dictionary describing the host to migrate to, where host[‘host’] is its name, and host[‘capabilities’] is a dictionary of its reported capabilities (Not Used).
unmanage(volume)

Unmanage a currently managed volume in Cinder

Parameters:volume – Cinder volume to unmanage
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.