The cinder.volume.drivers.solidfire Module

The cinder.volume.drivers.solidfire Module

class SolidFireDriver(*args, **kwargs)

Bases: cinder.volume.drivers.san.san.SanISCSIDriver

OpenStack driver to enable SolidFire cluster.

Version history:
    1.0 - Initial driver
    1.1 - Refactor, clone support, qos by type and minor bug fixes
    1.2 - Add xfr and retype support
    1.2.1 - Add export/import support
    1.2.2 - Catch VolumeNotFound on accept xfr
    2.0.0 - Move from httplib to requests
    2.0.1 - Implement SolidFire Snapshots
    2.0.2 - Implement secondary account
    2.0.3 - Implement cluster pairing
    2.0.4 - Implement volume replication
    2.0.5 - Try and deal with the stupid retry/clear issues from objects
            and tflow
    2.0.6 - Add a lock decorator around the clone_image method
    2.0.7 - Add scaled IOPS
    2.0.8 - Add active status filter to get volume ops
    2.0.9 - Always purge on delete volume
    2.0.10 - Add response to debug on retryable errors
    2.0.11 - Add ability to failback replicating volumes
    2.0.12 - Fix bug #1744005
CI_WIKI_NAME = 'NetApp_SolidFire_CI'
VERSION = '2.0.12'
accept_transfer(context, volume, new_user, new_project)
attach_volume(context, volume, instance_uuid, host_name, mountpoint)

Callback for volume attached to instance or host.

clone_image(*args, **kwargs)
cluster_stats = {}
create_cloned_volume(*args, **kwargs)
create_group(ctxt, group)

Creates a group.

Parameters:
  • context – the context of the caller.
  • group – the Group object of the group to be created.
Returns:

model_update

model_update will be in this format: {‘status’: xxx, ……}.

If the status in model_update is ‘error’, the manager will throw an exception and it will be caught in the try-except block in the manager. If the driver throws an exception, the manager will also catch it in the try-except block. The group status in the db will be changed to ‘error’.

For a successful operation, the driver can either build the model_update and return it or return None. The group status will be set to ‘available’.

create_group_from_src(ctxt, group, volumes, group_snapshots=None, snapshots=None, source_group=None, source_vols=None)

Creates a group from source.

Parameters:
  • context – the context of the caller.
  • group – the Group object to be created.
  • volumes – a list of Volume objects in the group.
  • group_snapshot – the GroupSnapshot object as source.
  • snapshots – a list of Snapshot objects in group_snapshot.
  • source_group – the Group object as source.
  • source_vols – a list of Volume objects in the source_group.
Returns:

model_update, volumes_model_update

The source can be group_snapshot or a source_group.

param volumes is a list of objects retrieved from the db. It cannot be assigned to volumes_model_update. volumes_model_update is a list of dictionaries. It has to be built by the driver. An entry will be in this format: {‘id’: xxx, ‘status’: xxx, ……}. model_update will be in this format: {‘status’: xxx, ……}.

To be consistent with other volume operations, the manager will assume the operation is successful if no exception is thrown by the driver. For a successful operation, the driver can either build the model_update and volumes_model_update and return them or return None, None.

create_group_snapshot(ctxt, group_snapshot, snapshots)

Creates a group_snapshot.

Parameters:
  • context – the context of the caller.
  • group_snapshot – the GroupSnapshot object to be created.
  • snapshots – a list of Snapshot objects in the group_snapshot.
Returns:

model_update, snapshots_model_update

param snapshots is a list of Snapshot objects. It cannot be assigned to snapshots_model_update. snapshots_model_update is a list of dictionaries. It has to be built by the driver. An entry will be in this format: {‘id’: xxx, ‘status’: xxx, ……}. model_update will be in this format: {‘status’: xxx, ……}.

The driver should populate snapshots_model_update and model_update and return them.

The manager will check snapshots_model_update and update db accordingly for each snapshot. If the driver successfully deleted some snapshots but failed to delete others, it should set statuses of the snapshots accordingly so that the manager can update db correctly.

If the status in any entry of snapshots_model_update is ‘error’, the status in model_update will be set to the same if it is not already ‘error’.

If the status in model_update is ‘error’, the manager will raise an exception and the status of group_snapshot will be set to ‘error’ in the db. If snapshots_model_update is not returned by the driver, the manager will set the status of every snapshot to ‘error’ in the except block.

If the driver raises an exception during the operation, it will be caught by the try-except block in the manager and the statuses of group_snapshot and all snapshots will be set to ‘error’.

For a successful operation, the driver can either build the model_update and snapshots_model_update and return them or return None, None. The statuses of group_snapshot and all snapshots will be set to ‘available’ at the end of the manager function.

create_snapshot(snapshot)

Creates a snapshot.

create_volume(volume)

Create volume on SolidFire device.

The account is where CHAP settings are derived from, volume is created and exported. Note that the new volume is immediately ready for use.

One caveat here is that an existing user account must be specified in the API call to create a new volume. We use a set algorithm to determine account info based on passed in cinder volume object. First we check to see if the account already exists (and use it), or if it does not already exist, we’ll go ahead and create it.

create_volume_from_snapshot(*args, **kwargs)
delete_group(ctxt, group, volumes)

Deletes a group.

Parameters:
  • context – the context of the caller.
  • group – the Group object of the group to be deleted.
  • volumes – a list of Volume objects in the group.
Returns:

model_update, volumes_model_update

param volumes is a list of objects retrieved from the db. It cannot be assigned to volumes_model_update. volumes_model_update is a list of dictionaries. It has to be built by the driver. An entry will be in this format: {‘id’: xxx, ‘status’: xxx, ……}. model_update will be in this format: {‘status’: xxx, ……}.

The driver should populate volumes_model_update and model_update and return them.

The manager will check volumes_model_update and update db accordingly for each volume. If the driver successfully deleted some volumes but failed to delete others, it should set statuses of the volumes accordingly so that the manager can update db correctly.

If the status in any entry of volumes_model_update is ‘error_deleting’ or ‘error’, the status in model_update will be set to the same if it is not already ‘error_deleting’ or ‘error’.

If the status in model_update is ‘error_deleting’ or ‘error’, the manager will raise an exception and the status of the group will be set to ‘error’ in the db. If volumes_model_update is not returned by the driver, the manager will set the status of every volume in the group to ‘error’ in the except block.

If the driver raises an exception during the operation, it will be caught by the try-except block in the manager. The statuses of the group and all volumes in it will be set to ‘error’.

For a successful operation, the driver can either build the model_update and volumes_model_update and return them or return None, None. The statuses of the group and all volumes will be set to ‘deleted’ after the manager deletes them from db.

delete_snapshot(snapshot)

Delete the specified snapshot from the SolidFire cluster.

delete_volume(volume)

Delete SolidFire Volume from device.

SolidFire allows multiple volumes with same name, volumeID is what’s guaranteed unique.

detach_volume(context, volume, attachment=None)

Callback for volume detached.

driver_prefix = 'solidfire'
extend_volume(volume, new_size)

Extend an existing volume.

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

Failover to replication target.

In order to do failback, you MUST specify the original/default cluster using secondary_id option. You can do this simply by specifying: secondary_id=default

freeze_backend(context)

Freeze backend notification.

get_volume_stats(refresh=False)

Get volume status.

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)

Initialize the connection and return connection info.

Optionally checks and utilizes volume access groups.

locked_image_id_operation(external=False)
locked_source_id_operation(external=False)
manage_existing(volume, external_ref)

Manages an existing SolidFire Volume (import to Cinder).

Renames the Volume to match the expected name for the volume. Also need to consider things like QoS, Emulation, account/tenant.

manage_existing_get_size(volume, external_ref)

Return size of an existing LV for manage_existing.

existing_ref is a dictionary of the form: {‘name’: <name of existing volume on SF Cluster>}

retry_exc_tuple = (<class 'cinder.exception.SolidFireRetryableException'>, <class 'requests.exceptions.ConnectionError'>)
retryable_errors = ['xDBVersionMismatch', 'xMaxSnapshotsPerVolumeExceeded', 'xMaxClonesPerVolumeExceeded', 'xMaxSnapshotsPerNodeExceeded', 'xMaxClonesPerNodeExceeded', 'xSliceNotRegistered', 'xNotReadyForIO']
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).
sf_iops_lim_max = {'burstIOPS': 200000, 'maxIOPS': 200000, 'minIOPS': 15000}
sf_iops_lim_min = {'burstIOPS': 100, 'maxIOPS': 100, 'minIOPS': 100}
sf_qos_dict = {'fast': {'burstIOPS': 1000, 'maxIOPS': 1000, 'minIOPS': 500}, 'medium': {'burstIOPS': 400, 'maxIOPS': 400, 'minIOPS': 200}, 'off': None, 'performant': {'burstIOPS': 4000, 'maxIOPS': 4000, 'minIOPS': 2000}, 'slow': {'burstIOPS': 200, 'maxIOPS': 200, 'minIOPS': 100}}
sf_qos_keys = ['minIOPS', 'maxIOPS', 'burstIOPS']
sf_scale_qos_keys = ['scaledIOPS', 'scaleMin', 'scaleMax', 'scaleBurst']
terminate_connection(volume, properties, force)

Disallow connection from connector.

Parameters:
  • volume – The volume to be disconnected.
  • connector – A dictionary describing the connection with details about the initiator. Can be None.
thaw_backend(context)

Thaw backend notification.

unmanage(volume)

Mark SolidFire Volume as unmanaged (export from Cinder).

update_group(ctxt, group, add_volumes=None, remove_volumes=None)

Updates a group.

Parameters:
  • context – the context of the caller.
  • group – the Group object of the group to be updated.
  • add_volumes – a list of Volume objects to be added.
  • remove_volumes – a list of Volume objects to be removed.
Returns:

model_update, add_volumes_update, remove_volumes_update

model_update is a dictionary that the driver wants the manager to update upon a successful return. If None is returned, the manager will set the status to ‘available’.

add_volumes_update and remove_volumes_update are lists of dictionaries that the driver wants the manager to update upon a successful return. Note that each entry requires a {‘id’: xxx} so that the correct volume entry can be updated. If None is returned, the volume will remain its original status. Also note that you cannot directly assign add_volumes to add_volumes_update as add_volumes is a list of volume objects and cannot be used for db update directly. Same with remove_volumes.

If the driver throws an exception, the status of the group as well as those of the volumes to be added/removed will be set to ‘error’.

update_provider_info(vrefs, snaprefs)

Get provider info updates from driver.

Parameters:
  • volumes – List of Cinder volumes to check for updates
  • snapshots – List of Cinder snapshots to check for updates
Returns:

tuple (volume_updates, snapshot_updates)

where volume updates {‘id’: uuid, provider_id: <provider-id>} and snapshot updates {‘id’: uuid, provider_id: <provider-id>}

class SolidFireISCSI(*args, **kwargs)

Bases: cinder.volume.targets.iscsi.SanISCSITarget

create_export(context, volume, volume_path)

Creates an export for a logical volume.

ensure_export(context, volume, volume_path)

Recreates an export for a logical volume.

remove_export(context, volume)

Removes an export for a Target/Volume.

terminate_connection(volume, connector, **kwargs)

Disallow connection from connector.

retry(exc_tuple, tries=5, delay=1, backoff=2)
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.