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)

Bases: object

HttpClient

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

LegacyPayloadFilter

Simple class for creating filters for interacting with the Dell Storage API pre DropTop2.

append(name, val, filtertype='Equals')
class PayloadFilter(filtertype='AND')

Bases: object

PayloadFilter

Simple class for creating filters for interacting with the Dell Storage API DropTop2 and later.

append(name, val, filtertype='Equals')
class StorageCenterApi(host, port, user, password, verify)

Bases: object

StorageCenterApi

Handles calls to Dell Enterprise Manager (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.

APIVERSION = '2.3.1'
cg_except_on_no_support()
close_connection()

Logout of Dell Enterprise Manager.

create_cloned_volume(volumename, scvolume)

Creates a volume named volumename from a copy of scvolume.

This is done by creating a replay and then a view volume from that replay. The replay is set to expire after an hour. It is only needed long enough to create the volume. (1 minute should be enough but we set an hour in case the world has gone mad.)

Parameters:
  • volumename – Name of new volume. This is the cinder volume ID.
  • scvolume – Dell volume object.
Returns:

The new volume’s Dell volume object.

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.

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_server(wwnoriscsiname, isfc=False)

Creates a Dell server object on the the Storage Center.

Adds the first HBA identified by wwnoriscsiname to it.

Parameters:
  • wwnoriscsiname – A list of FC WWNs or iSCSI IQNs associated with this Dell server object.
  • isfc – Boolean indicating whether this is an FC HBA or not.
Returns:

Dell server object.

create_server_multiple_hbas(wwns)

Creates a server with multiple WWNS associated with it.

Same as create_server except it can take a list of HBAs.

Parameters:wwns – A list of FC WWNs or iSCSI IQNs associated with this server.
Returns:Dell server object.
create_view_volume(volname, screplay)

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.
Returns:

Dell volume object or None.

create_volume(name, size, storage_profile=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.
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_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_volume(name)

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.
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_iscsi_properties(scvolume, ip=None, port=None)

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.
  • ip – The preferred target portal ip.
  • port – The preferred target portal port.
Returns:

iSCSI property dictionary.

Raises:

VolumeBackendAPIException

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()

Check that the SC is there and being managed by EM.

Returns:The SC SSN.
Raises:VolumeBackendAPIException
find_server(instance_name)

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.
Returns:Dell server object or None.
find_volume(name)

Search self.ssn for volume of name.

This searches the folder self.vfname (specified in the cinder.conf) for the volume first. If not found it searches the entire array for the volume.

Parameters:name – Name of the volume to search for. This is the cinder volume ID.
Returns:Dell Volume object or None if not found.
Raises VolumeBackendAPIException:
 If multiple copies are found.
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

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_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.
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 boundry.

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:

Nothing.

Raises:

VolumeBackendAPIException, ManageExistingInvalidReference

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 opbject.
Returns:

SC mapping profile or None

open_connection()

Authenticate against Dell Enterprise Manager.

Raises:VolumeBackendAPIException.
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.

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.

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
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 opbject.
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_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)

Bases: object

StorageCenterApiHelper

Helper class for API access. Handles opening and closing the connection to the Dell Enterprise Manager.

open_connection()

Creates the StorageCenterApi object.

Returns:StorageCenterApi object.
Raises:VolumeBackendAPIException

Previous topic

The cinder.volume.drivers.datera Module

Next topic

The cinder.volume.drivers.dell.dell_storagecenter_common Module

Project Source

This Page