The cinder.volume.drivers.kaminario.kaminario_common Module

The cinder.volume.drivers.kaminario.kaminario_common Module

Volume driver for Kaminario K2 all-flash arrays.

class KaminarioCinderDriver(*args, **kwargs)

Bases: cinder.volume.driver.ISCSIDriver

VENDOR = 'Kaminario'
after_volume_copy(ctxt, volume, new_volume, remote=None)

Driver-specific actions after copyvolume data.

This method will be called after _copy_volume_data during volume migration

check_for_setup_error()
create_cloned_volume(volume, src_vref)

Create a clone from source volume.

  • attach source volume
  • create and attach new volume
  • copy data from attached source volume to attached new volume
  • detach both volumes
create_export(context, volume, connector)

Exports the volume.

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

create_snapshot(snapshot)

Create a snapshot from a volume_group.

create_volume(volume)

Volume creation in K2 needs a volume group.

  • create a volume group
  • create a volume in the volume group
create_volume_from_snapshot(volume, snapshot)

Create volume from snapshot.

  • search for snapshot and retention_policy
  • create a view from snapshot and attach view
  • create a volume and attach volume
  • copy data from attached view to attached volume
  • detach volume and view and finally delete view
delete_snapshot(snapshot)

Delete a snapshot.

delete_volume(volume)

Volume in K2 exists in a volume group.

  • delete the volume
  • delete the corresponding volume group
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)

Extend volume.

failover_host(context, volumes, secondary_id=None, groups=None)

Failover to replication target.

get_initiator_host_name(connector)

Return the initiator host name or unique ID.

Unique ID when configuration’s unique_fqdn_network is false will be the reversed IQN/WWPNS.

Valid characters: 0-9, a-z, A-Z, ‘-‘, ‘_’ All other characters are replaced with ‘_’. Total characters in initiator host name: 32

get_policy()

Return the retention policy.

get_rep_name(name)

Return the corresponding replication names.

get_session_name(vid)

Return the volume name.

get_snap_name(sid)

Return the snapshot name.

get_view_name(vid)

Return the view name.

get_volume_group_name(vid)

Return the volume group name.

get_volume_name(vid)

Return the volume name.

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,
        '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,
    }
}
k2_initialize_connection(volume, connector)
manage_existing(volume, existing_ref)

Brings an existing backend storage object under Cinder management.

existing_ref is passed straight through from the API request’s manage_existing_ref value, and it is up to the driver how this should be interpreted. It should be sufficient to identify a storage object that the driver should somehow associate with the newly-created cinder volume structure.

There are two ways to do this:

  1. Rename the backend storage object so that it matches the, volume[‘name’] which is how drivers traditionally map between a cinder volume and the associated backend storage object.
  2. Place some metadata on the volume, or somewhere in the backend, that allows other driver requests (e.g. delete, clone, attach, detach…) to locate the backend storage object when required.

If the existing_ref doesn’t make sense, or doesn’t refer to an existing backend storage object, raise a ManageExistingInvalidReference exception.

The volume may have a volume_type, and the driver can inspect that and compare against the properties of the referenced backend storage object. If they are incompatible, raise a ManageExistingVolumeTypeMismatch, specifying a reason for the failure.

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

Return size of volume to be managed by manage_existing.

When calculating the size, round up to the next GB.

Parameters:
  • volume – Cinder volume to manage
  • existing_ref – Driver-specific information used to identify a volume
Returns size:

Volume size in GiB (integer)

remove_export(context, volume)

Removes an export for a volume.

retype(ctxt, volume, new_type, diff, host)
stats = {}
terminate_connection(volume, connector)

Terminate connection of volume from host.

update_volume_stats()
class Replication(config, *args, **kwargs)

Bases: object

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.