The cinder.volume.drivers.dell.dell_storagecenter_api
Module¶
Interface for interacting with the Dell Storage Center array.
-
class
HttpClient
(host, port, user, password, verify, apiversion)¶ Bases:
object
Helper for making the REST calls.
-
delete
(*args, **kwargs)¶
-
get
(*args, **kwargs)¶
-
post
(*args, **kwargs)¶
-
put
(*args, **kwargs)¶
-
-
class
LegacyPayloadFilter
(filter_type='AND')¶ Bases:
object
Simple class for creating filters for interacting with the Dell Storage API 15.1 and 15.2.
-
append
(name, val, filtertype='Equals')¶
-
-
class
PayloadFilter
(filtertype='AND')¶ Bases:
object
Simple class for creating filters for interacting with the Dell Storage API 15.3 and later.
-
append
(name, val, filtertype='Equals')¶
-
-
class
StorageCenterApi
(host, port, user, password, verify, apiversion)¶ Bases:
object
Handles calls to Dell SC and EM via the REST API interface.
- Version history:
- 1.0.0 - Initial driver 1.1.0 - Added extra spec support for Storage Profile selection 1.2.0 - Added consistency group support. 2.0.0 - Switched to inheriting functional objects rather than volume driver. 2.1.0 - Added support for ManageableVD. 2.2.0 - Added API 2.2 support. 2.3.0 - Added Legacy Port Mode Support 2.3.1 - Updated error handling. 2.4.0 - Added Replication V2 support. 2.4.1 - Updated Replication support to V2.1. 2.5.0 - ManageableSnapshotsVD implemented. 3.0.0 - ProviderID utilized. 3.1.0 - Failback supported. 3.2.0 - Live Volume support. 3.3.0 - Support for a secondary DSM. 3.4.0 - Support for excluding a domain. 3.5.0 - Support for AFO. 3.6.0 - Server type support. 3.7.0 - Support for Data Reduction, Group QOS and Volume QOS.
-
APIDRIVERVERSION
= '3.7.0'¶
-
break_replication
(volumename, instance_id, destssn)¶ This just breaks the replication.
If we find the source we just delete the replication. If the source is down then we find the destination and unmap it. Fail pretty much every time this goes south.
Parameters: - volumename – Volume name is the guid from the cinder volume.
- instance_id – Storage Center volume object instance id.
- destssn – Destination ssn.
Returns: Replication SC volume object.
-
cg_except_on_no_support
()¶
-
close_connection
()¶ Logout of Dell REST API.
-
create_cloned_volume
(volumename, scvolume, storage_profile, replay_profile_list, volume_qos, group_qos, dr_profile)¶ Creates a volume named volumename from a copy of scvolume.
Parameters: - volumename – Name of new volume. This is the cinder volume ID.
- scvolume – Dell volume object.
- storage_profile – Storage profile.
- replay_profile_list – List of snapshot profiles.
- volume_qos – Volume QOS Profile to use.
- group_qos – Group QOS Profile to use.
- dr_profile – Data reduction profile to use.
Returns: The new volume’s Dell volume object.
Raises: VolumeBackendAPIException if error doing copy.
-
create_live_volume
(scvolume, remotessn, active=False, sync=False, autofailover=False, primaryqos='CinderQOS', secondaryqos='CinderQOS')¶ This create’s a live volume instead of a replication.
Servers are not created at this point so we cannot map up a remote server immediately.
Parameters: - scvolume – Source SC Volume
- remotessn – Destination SSN.
- active – Replicate the active replay boolean.
- sync – Sync replication boolean.
- autofailover – enable autofailover and failback boolean.
- primaryqos – QOS node name for the primary side.
- secondaryqos – QOS node name for the remote side.
Returns: ScLiveVolume object or None on failure.
-
create_replay
(scvolume, replayid, expire)¶ Takes a snapshot of a volume.
One could snap a volume before it has been activated, so activate by mapping and unmapping to a random server and let them. This should be a fail but the Tempest tests require it.
Parameters: - scvolume – Volume to snapshot.
- replayid – Name to use for the snapshot. This is a portion of the snapshot ID as we do not have space for the entire GUID in the replay description.
- expire – Time in minutes before the replay expires. For most snapshots this will be 0 (never expire) but if we are cloning a volume we will snap it right before creating the clone.
Returns: The Dell replay object or None.
Raises: VolumeBackendAPIException – On failure to intialize volume.
-
create_replay_profile
(name)¶ Creates a replay profile on the Dell SC.
Parameters: name – The ID of the consistency group. This will be matched to the name on the Dell SC. Returns: SC profile or None.
-
create_replication
(scvolume, destssn, qosnode, synchronous, diskfolder, replicate_active)¶ Create repl from scvol to destssn.
Parameters: - scvolume – Dell SC volume object.
- destssn – Destination SSN string.
- qosnode – Name of Dell SC QOS Node for this replication.
- synchronous – Boolean.
- diskfolder – optional disk folder name.
- replicate_active – replicate active replay.
Returns: Dell SC replication object.
-
create_server
(wwnlist, serveros, ssn=-1)¶ Creates a server with multiple WWNS associated with it.
Same as create_server except it can take a list of HBAs.
Parameters: - wwnlist – A list of FC WWNs or iSCSI IQNs associated with this server.
- serveros – Name of server OS to use when creating the server.
- ssn – ssn of the backend SC to use. Default if -1.
Returns: Dell server object.
-
create_view_volume
(volname, screplay, replay_profile_string, volume_qos, group_qos, dr_profile)¶ Creates a new volume named volname from the screplay.
Parameters: - volname – Name of new volume. This is the cinder volume ID.
- screplay – Dell replay object from which to make a new volume.
- replay_profile_string – Profiles to be applied to the volume
- volume_qos – Volume QOS Profile to use.
- group_qos – Group QOS Profile to use.
- dr_profile – Data reduction profile to use.
Returns: Dell volume object or None.
-
create_volume
(name, size, storage_profile=None, replay_profile_string=None, volume_qos=None, group_qos=None, datareductionprofile=None)¶ Creates a new volume on the Storage Center.
It will create it in a folder called self.vfname. If self.vfname does not exist it will create it. If it cannot create it the volume will be created in the root.
Parameters: - name – Name of the volume to be created on the Dell SC backend. This is the cinder volume ID.
- size – The size of the volume to be created in GB.
- storage_profile – Optional storage profile to set for the volume.
- replay_profile_string – Optional replay profile to set for the volume.
- volume_qos – Volume QOS profile name.
- group_qos – Group QOS profile name.
- datareductionprofile – Data reduction profile name
Returns: Dell Volume object or None.
-
delete_cg_replay
(profile, replayid)¶ Finds a Dell cg replay by replayid string and expires it.
Once marked for expiration we do not return the replay as a snapshot even though it might still exist. (Backend requirements.)
Parameters: - cg_name – Consistency Group name. This is the ReplayProfileName.
- replayid – Name to search for. This is a portion of the snapshot ID as we do not have space for the entire GUID in the replay description.
Returns: Boolean for success or failure.
-
delete_live_volume
(sclivevolume, deletesecondaryvolume)¶ Deletes the live volume.
Parameters: sclivevolume – ScLiveVolume object to be whacked. Returns: Boolean on success/fail.
-
delete_replay
(scvolume, replayid)¶ Finds a Dell replay by replayid string and expires it.
Once marked for expiration we do not return the replay as a snapshot even though it might still exist. (Backend requirements.)
Parameters: - scvolume – Dell volume object.
- replayid – Name to search for. This is a portion of the snapshot ID as we do not have space for the entire GUID in the replay description.
Returns: Boolean for success or failure.
-
delete_replay_profile
(profile)¶ Delete the replay profile from the Dell SC.
Parameters: profile – SC replay profile. Returns: Nothing. Raises: VolumeBackendAPIException
-
delete_replication
(scvolume, destssn, deletedestvolume=True)¶ Deletes the SC replication object from scvolume to the destssn.
Parameters: - scvolume – Dell SC Volume object.
- destssn – SC the replication is replicating to.
- deletedestvolume – Delete or keep dest volume.
Returns: True on success. False on fail.
-
delete_volume
(name, provider_id=None)¶ Deletes the volume from the SC backend array.
If the volume cannot be found we claim success.
Parameters: - name – Name of the volume to search for. This is the cinder volume ID.
- provider_id – This is the instanceId
Returns: Boolean indicating success or failure.
-
expand_volume
(scvolume, newsize)¶ Expands scvolume to newsize GBs.
Parameters: - scvolume – Dell volume object to be expanded.
- newsize – The new size of the volume object.
Returns: The updated Dell volume object on success or None on failure.
-
find_common_replay
(svolume, dvolume)¶ Finds the common replay between two volumes.
This assumes that one volume was replicated from the other. This should return the most recent replay.
Parameters: - svolume – Source SC Volume.
- dvolume – Destination SC Volume.
Returns: Common replay or None.
-
find_iscsi_properties
(scvolume, scserver)¶ Finds target information for a given Dell scvolume object mapping.
The data coming back is both the preferred path and all the paths.
Parameters: - scvolume – The dell sc volume object.
- scserver – The dell sc server object.
Returns: iSCSI property dictionary.
Raises: VolumeBackendAPIException
-
find_repl_volume
(name, destssn, instance_id=None, source=False, destination=True)¶ Find our replay destination volume on the destssn.
Parameters: - name – Name to search for.
- destssn – Where to look for the volume.
- instance_id – If we know our exact volume ID use that.
- source – Replication source boolen.
- destination – Replication destination boolean.
Returns: SC Volume object or None
-
find_replay
(scvolume, replayid)¶ Searches for the replay by replayid.
replayid is stored in the replay’s description attribute.
Parameters: - scvolume – Dell volume object.
- replayid – Name to search for. This is a portion of the snapshot ID as we do not have space for the entire GUID in the replay description.
Returns: Dell replay object or None.
-
find_replay_profile
(name)¶ Finds the Dell SC replay profile object name.
Parameters: name – Name of the replay profile object. This is the consistency group id. Returns: Dell SC replay profile or None. Raises: VolumeBackendAPIException
-
find_sc
(ssn=-1)¶ Check that the SC is there and being managed by EM.
Returns: The SC SSN. Raises: VolumeBackendAPIException
-
find_server
(instance_name, ssn=-1)¶ Hunts for a server on the Dell backend by instance_name.
The instance_name is the same as the server’s HBA. This is the IQN or WWN listed in the connector. If found, the server the HBA is attached to, if any, is returned.
Parameters: - instance_name – instance_name is a FC WWN or iSCSI IQN from the connector. In cinder a server is identified by its HBA.
- ssn – Storage center to search.
Returns: Dell server object or None.
-
find_volume
(name, provider_id, islivevol=False)¶ Find the volume by name or instanceId.
We check if we can use provider_id before using it. If so then we expect to find it by provider_id.
We also conclude our failover at this point. If we are failed over we run _import_one to rename the volume.
Parameters: - name – Volume name.
- provider_id – instanceId of the volume if known.
- islivevol – Is this a live volume.
Returns: sc volume object or None.
Raises: VolumeBackendAPIException – if unable to import.
-
find_wwns
(scvolume, scserver)¶ Finds the lun and wwns of the mapped volume.
Parameters: - scvolume – Storage Center volume object.
- scserver – Storage Center server opbject.
Returns: Lun, wwns, initiator target map
-
flip_replication
(svolume, dvolume, name, replicationtype, qosnode, activereplay)¶ Enables replication from current destination volume to source.
Parameters: - svolume – Current source. New destination.
- dvolume – Current destination. New source.
- name – Volume name.
- replicationtype – Sync or async
- qosnode – qos node for the new source ssn.
- activereplay – replicate the active replay.
Returns: True/False.
-
get_live_volume
(primaryid, name=None)¶ Get’s the live ScLiveVolume object for the vol with primaryid.
Parameters: - primaryid – InstanceId of the primary volume.
- name – Volume name associated with this live volume.
Returns: ScLiveVolume object or None
-
get_screplication
(scvolume, destssn)¶ Find the screplication object for the volume on the dest backend.
Parameters: - scvolume –
- destssn –
Returns:
-
get_storage_usage
()¶ Gets the storage usage object from the Dell backend.
This contains capacity and usage information for the SC.
Returns: The SC storageusage object.
-
get_unmanaged_volume_size
(existing)¶ Looks up the volume named existing and returns its size string.
Parameters: existing – Existing volume dict. Returns: The SC configuredSize string. Raises: ManageExistingInvalidReference
-
get_volume
(provider_id)¶ Returns the scvolume associated with provider_id.
Parameters: provider_id – This is the instanceId Returns: Dell SCVolume object.
-
get_volume_count
(scserver)¶ Returns the number of volumes attached to specified Dell server.
Parameters: scserver – The Dell backend server object. Returns: Mapping count. -1 if there was an error.
-
is_failed_over
(provider_id, sclivevolume)¶
-
is_swapped
(provider_id, sclivevolume)¶
-
manage_existing
(newname, existing)¶ Finds the volume named existing and renames it.
This checks a few things. The volume has to exist. There can only be one volume by that name. Since cinder manages volumes by the GB it has to be defined on a GB boundary.
This renames existing to newname. newname is the guid from the cinder volume[‘id’]. The volume is moved to the defined cinder volume folder.
Parameters: - newname – Name to rename the volume to.
- existing – The existing volume dict..
Returns: scvolume.
Raises: VolumeBackendAPIException, ManageExistingInvalidReference
-
manage_replay
(screplay, replayid)¶ Basically renames the screplay and sets it to never expire.
Parameters: - screplay – DellSC object.
- replayid – New name for replay.
Returns: True on success. False on fail.
-
map_secondary_volume
(sclivevol, scdestsrv)¶ Map’s the secondary volume or a LiveVolume to destsrv.
Parameters: - sclivevol – ScLiveVolume object.
- scdestsrv – ScServer object for the destination.
Returns: ScMappingProfile object or None on failure.
-
map_volume
(scvolume, scserver)¶ Maps the Dell backend volume object to the Dell server object.
The check for the Dell server object existence is elsewhere; does not create the Dell server object.
Parameters: - scvolume – Storage Center volume object.
- scserver – Storage Center server object.
Returns: SC mapping profile or None
-
open_connection
()¶ Authenticate with Dell REST interface.
Raises: VolumeBackendAPIException.
-
remove_mappings
(scvol)¶ Peels all the mappings off of scvol.
Parameters: scvol – Storage Center volume object. Returns: True/False on Success/Failure.
-
rename_volume
(scvolume, name)¶ Rename scvolume to name.
This is mostly used by update_migrated_volume.
Parameters: - scvolume – The Dell volume object to be renamed.
- name – The new volume name.
Returns: Boolean indicating success or failure.
-
replicate_to_common
(svolume, dvolume, qosnode)¶ Reverses a replication between two volumes.
Parameters: - fovolume – Failed over volume. (Current)
- ovolume – Original source volume.
- qosnode – QOS node name to use to create the replay.
Returns: ScReplication object or None.
-
replication_progress
(screplid)¶ Get’s the current progress of the replication.
Parameters: screplid – instanceId of the ScReplication object. Returns: Boolean for synced, float of remaining bytes. (Or None, None.)
-
static
size_to_gb
(spacestring)¶ Splits a SC size string into GB and a remainder.
Space is returned in a string like ... 7.38197504E8 Bytes Need to split that apart and convert to GB.
Parameters: spacestring – SC size string. Returns: Size in GB and remainder in byte.
-
snap_cg_replay
(profile, replayid, expire)¶ Snaps a replay of a consistency group.
Parameters: - profile – The name of the consistency group profile.
- replayid – The name of the replay.
- expire – Time in mintues before a replay expires. 0 means no expiration.
Returns: Dell SC replay object.
-
start_replication
(svolume, dvolume, replicationtype, qosnode, activereplay)¶ Starts a replication between volumes.
Requires the dvolume to be in an appropriate state to start this.
Parameters: - svolume – Source SC Volume.
- dvolume – Destiation SC Volume
- replicationtype – Asynchronous or synchronous.
- qosnode – QOS node name.
- activereplay – Boolean to replicate the active replay or not.
Returns: ScReplication object or None.
-
swap_roles_live_volume
(sclivevolume)¶ Swap live volume roles.
Parameters: sclivevolume – Dell SC live volume object. Returns: True/False on success/failure.
-
unmanage
(scvolume)¶ Unmanage our volume.
We simply rename with with a prefix of Unmanaged_ That’s it.
Parameters: scvolume – The Dell SC volume object. Returns: Nothing. Raises: VolumeBackendAPIException
-
unmanage_replay
(screplay)¶ Basically sets the expireTime
Parameters: screplay – DellSC object. Returns: True on success. False on fail.
-
unmap_volume
(scvolume, scserver)¶ Unmaps the Dell volume object from the Dell server object.
Deletes all mappings to a Dell server object, not just the ones on the path defined in cinder.conf.
Parameters: - scvolume – Storage Center volume object.
- scserver – Storage Center server object.
Returns: True or False.
-
update_cg_volumes
(profile, add_volumes=None, remove_volumes=None)¶ Adds or removes the profile from the specified volumes
Parameters: - profile – Dell SC replay profile object.
- add_volumes – List of volumes we are adding to the consistency group. (Which is to say we are adding the profile to this list of volumes.)
- remove_volumes – List of volumes we are removing from the consistency group. (Which is to say we are removing the profile from this list of volumes.)
Returns: True/False on success/failure.
-
update_datareduction_profile
(scvolume, dr_profile)¶ Update a volume’s Data Reduction Profile
Changes the volume setting to use a different data reduction profile. If dr_profile is None, will reset to the default profile for the cinder user account.
Parameters: - scvolume – The Storage Center volume to be updated.
- dr_profile – The requested data reduction profile name.
Returns: True if successful, False otherwise.
-
update_qos_profile
(scvolume, qosprofile, grouptype=False)¶ Update a volume’s QOS profile
Changes the volume setting to use a different QOS Profile.
Parameters: - scvolume – The Storage Center volume to be updated.
- qosprofile – The requested QOS profile name.
- grouptype – Is this a group QOS profile?
Returns: True if successful, False otherwise.
-
update_replay_profiles
(scvolume, replay_profile_string)¶ Update our replay profiles.
If the replay_profile_string is empty we look for the user’s default profiles. If those aren’t found we look for the Daily profile.
Note that this is in addition to the CG profiles which we do not touch.
Parameters: - scvolume – SC Volume object.
- replay_profile_string – Comma separated string of replay profile names.
Returns: True/False.
-
update_replicate_active_replay
(scvolume, replactive)¶ Enables or disables replicating the active replay for given vol.
Parameters: - scvolume – SC Volume object.
- replactive – True or False
Returns: True or False
-
update_storage_profile
(scvolume, storage_profile)¶ Update a volume’s Storage Profile.
Changes the volume setting to use a different Storage Profile. If storage_profile is None, will reset to the default profile for the cinder user account.
Parameters: - scvolume – The Storage Center volume to be updated.
- storage_profile – The requested Storage Profile name.
Returns: True if successful, False otherwise.
-
class
StorageCenterApiHelper
(config, active_backend_id, storage_protocol)¶ Bases:
object
Helper class for API access. Handles opening and closing the connection to the Dell REST API.
-
open_connection
()¶ Creates the StorageCenterApi object.
Returns: StorageCenterApi object. Raises: VolumeBackendAPIException
-