This patch fixed errors in docstrings in the VMAX driver.
Change-Id: I7079ac25bd44e6faecc8a025c0522a7cd5837ef6
EMCNumberOfMembers is what the user specifies.
:param volume: volume Object
- :returns: volumeInstance, the volume instance
- :raises: VolumeBackendAPIException
+ :returns: dict -- volumeDict - the volume dictionary
"""
volumeSize = int(self.utils.convert_gb_to_bits(volume['size']))
volumeName = volume['id']
For VMAX, replace snapshot with clone.
- :param volume - volume Object
- :param snapshot - snapshot object
- :returns: cloneVolumeDict - the cloned volume dictionary
+ :param volume: volume Object
+ :param snapshot: snapshot object
+ :returns: dict -- the cloned volume dictionary
+ :raises: VolumeBackendAPIException
"""
LOG.debug("Entering create_volume_from_snapshot.")
self.extraSpecs = self._initial_setup(volume)
def create_cloned_volume(self, cloneVolume, sourceVolume):
"""Creates a clone of the specified volume.
- :param CloneVolume - clone volume Object
- :param sourceVolume - volume object
- :returns: cloneVolumeDict - the cloned volume dictionary
+ :param cloneVolume: clone volume Object
+ :param sourceVolume: volume object
+ :returns: cloneVolumeDict -- the cloned volume dictionary
"""
return self._create_cloned_volume(cloneVolume, sourceVolume, False)
:param snapshot: snapshot object
:param volume: volume Object to create snapshot from
- :returns: cloneVolumeDict,the cloned volume dictionary
+ :returns: dict -- the cloned volume dictionary
"""
return self._create_cloned_volume(snapshot, volume, True)
policy is in the extra specs and tiering is enabled on the array.
:param controllerConfigService: instance name of
- ControllerConfigurationService
- :param volume: volume Object
- :param extraSpecs: the volume extra specs
+ ControllerConfigurationService
+ :param volumeInstance: volume Object
:param connector: the connector object
+ :returns: storageGroupInstanceName
"""
volumeName = volumeInstance['ElementName']
LOG.debug("Detaching volume %s.", volumeName)
:param volume: volume Object
:param connector: the connector Object
- :returns: deviceInfoDict, device information tuple
+ :returns: dict -- deviceInfoDict - device information dict
:raises: VolumeBackendAPIException
"""
self.extraSpecs = self._initial_setup(volume)
:params volume: the volume object
:params connector: the connector object
- :params extraSpecs: the volume extra specs
:param isLiveMigration: boolean, can be None
- :returns: deviceInfoDict
+ :returns: dict -- deviceInfoDict
+ :raises: VolumeBackendAPIException
"""
volumeName = volume['name']
maskingViewDict = self._populate_masking_dict(
live migration.
:params connector: the connector object
- :params deviceInfoDict: the device information
- :returns: boolean True/False
+ :params deviceInfoDict: the device information dictionary
+ :returns: boolean -- True if the host is the same, False otherwise.
"""
if 'host' in connector:
currentHost = connector['host']
"""Disallow connection from connector.
:params volume: the volume Object
- :params connectorL the connector Object
+ :params connector: the connector Object
"""
self.extraSpecs = self._initial_setup(volume)
:params volume: the volume Object
:params newSize: the new size to increase the volume to
+ :returns: dict -- modifiedVolumeDict - the extended volume Object
:raises: VolumeBackendAPIException
"""
originalVolumeSize = volume['size']
:param emcConfigFileName: the EMC configuration file
:param arrayName: the array
:param poolName: the pool
- :returns: location_info, total_capacity_gb, free_capacity_gb
+ :returns: location_info
+ :returns: totalManagedSpaceGbs
+ :returns: remainingManagedSpaceGbs
"""
totalManagedSpaceGbs, remainingManagedSpaceGbs = (
:param ctxt: context
:param volume: the volume object including the volume_type_id
:param new_type: the new volume type.
+ :param diff: Unused parameter.
:param host: The host dict holding the relevant target(destination)
- information
- :returns: boolean True/False
- :returns: list
+ information
+ :returns: boolean -- True if retype succeeded, Fasle if error
"""
volumeName = volume['name']
:param ctxt: context
:param volume: the volume object including the volume_type_id
:param host: the host dict holding the relevant target(destination)
- information
+ information
:param new_type: None
- :returns: boolean True/False
- :returns: list
+ :returns: boolean -- Always returns True
+ :returns: dict -- Empty dict {}
"""
LOG.warn(_LW("The VMAX plugin only supports Retype. "
"If a pool based migration is necessary "
:param targetFastPolicyName: the target FAST policy name, can be None
:param sourceFastPolicyName: the source FAST policy name, can be None
:param new_type: None
- :returns: boolean True/False
- :returns: empty list
+ :returns: boolean -- True/False
+ :returns: list -- empty list
"""
volumeName = volume['name']
storageSystemName = volumeInstance['SystemName']
:param storageSystemName: the storage system name
:param sourceFastPolicyName: the source FAST policy name
:param volumeName: the volume Name
-
- :returns: boolean True/False
- :returns: int, the return code from migrate operation
+ :param sourcePoolInstanceName: the instance name of the source pool
"""
LOG.warn(_LW("_migrate_rollback on : %(volumeName)s."),
:param storageSystemName: the storage system name
:param sourceFastPolicyName: the source FAST policy name
:param volumeName: the volume Name
-
- :returns: boolean True/False
- :returns: int, the return code from migrate operation
"""
LOG.warn(_LW("_migrate_cleanup on : %(volumeName)s."),
:param storageSystemName: the storage system name
:param targetFastPolicyName: the target fast policy name
:param volumeName: the volume name
- :returns: boolean True/False
+ :returns: boolean -- True/False
"""
falseRet = False
LOG.info(_LI(
:param volumeInstance: the volume instance
:param targetPoolName: the target poolName
:param sourceFastPolicyName: the source FAST policy name, can be None
- :returns: boolean True/False
- :returns: int, the return code from migrate operation
+ :returns: boolean -- True/False
+ :returns: int -- the return code from migrate operation
"""
falseRet = (False, -1)
volumeName = volume['name']
:param storageSystemName: the storage system name
:param sourceFastPolicyName: the source FAST policy name
:param volumeName: the volume Name
-
- :returns: boolean True/False
- :returns: int, the return code from migrate operation
+ :raises: VolumeBackendAPIException
"""
controllerConfigurationService = (
self.utils.find_controller_configuration_service(
:param storageSystemName: the storage system name
:param targetFastPolicyName: the target FAST policy name
:param volumeName: the volume Name
-
- :returns: boolean True/False
- :returns: int, the return code from migrate operation
"""
controllerConfigurationService = (
self.utils.find_controller_configuration_service(
:param volumeInstanceName: the volume instance id
:param host: the host object
:param sourceArraySerialNumber: the array serial number of
- the original volume
- :param sourcePoolName: the pool name
- the original volume
+ the original volume
+ :param sourcePoolName: the pool name of the original volume
:param volumeName: the name of the volume to be migrated
:param volumeStatus: the status of the volume e.g
- :returns: boolean, True/False
- :returns: string, targetSlo
- :returns: string, targetWorkload
+ :returns: boolean -- True/False
+ :returns: string -- targetSlo
+ :returns: string -- targetWorkload
"""
falseRet = (False, None, None)
if 'location_info' not in host['capabilities']:
:param volumeInstanceName: the volume instance id
:param host: the host object
:param sourceArraySerialNumber: the array serial number of
- the original volume
+ the original volume
:param volumeName: the name of the volume to be migrated
:param volumeStatus: the status of the volume e.g
- :returns: boolean, True/False
- :returns: string, targetPool
- :returns: string, targetFastPolicy
+ :returns: boolean -- True/False
+ :returns: string -- targetPool
+ :returns: string -- targetFastPolicy
"""
falseRet = (False, None, None)
if 'location_info' not in host['capabilities']:
Based on the name of the config group, register the config file
:param volume: the volume object including the volume_type_id
- :returns: tuple the extra specs tuple
- :returns: string configuration file
+ :param volumeTypeId: Optional override of volume['volume_type_id']
+ :returns: dict -- the extra specs dict
+ :returns: string -- configuration file
"""
extraSpecs = self.utils.get_volumetype_extraspecs(volume, volumeTypeId)
configGroup = None
def _get_ecom_connection(self):
"""Get the ecom connection.
- :returns: conn,the ecom connection
+ :returns: pywbem.WBEMConnection -- conn, the ecom connection
+ :raises: VolumeBackendAPIException
"""
if self.ecomUseSSL:
:param arrayStr: the array Serial number (String)
:param poolNameInStr: the name of the poolname (String)
:param isv3: True/False
- :returns: foundPoolInstanceName, the CIM Instance Name of the Pool
+ :returns: foundPoolInstanceName - the CIM Instance Name of the Pool
+ :returns: string -- systemNameStr
+ :raises: VolumeBackendAPIException
"""
foundPoolInstanceName = None
systemNameStr = None
def _find_lun(self, volume):
"""Given the volume get the instance from it.
- :param conn: connection the the ecom server
:param volume: volume object
:returns: foundVolumeinstance
"""
:param snapshot: snapshot object
:param volume: volume object
- :returns: foundsyncname (String)
- :returns: storage_system (String)
+ :param waitforsync: boolean -- Wait for Solutions Enabler sync.
+ :returns: string -- foundsyncname
+ :returns: string -- storage_system
"""
snapshotname = snapshot['name']
volumename = volume['name']
for a volume.
:param volume: the volume dict
- :returns: data, the data dict
-
+ :returns: dict -- the data dict
"""
foundNumDeviceNumber = None
foundMaskingViewName = None
:param storageSystem: the storage system name
:param connector: the connector dict
- :returns: targetWwns, the target WWN list
+ :returns: list -- targetWwns, the target WWN list
+ :raises: VolumeBackendAPIException
"""
targetWwns = []
:param connector: the connector dict
:param hardwareIdManagementService: the storage Hardware
- management service
- :returns: foundInstances, the list of storage hardware ID instances
+ management service
+ :returns: list -- the list of storage hardware ID instances
"""
foundHardwareIdList = []
wwpns = self._find_initiator_names(connector)
"""Given the config group name register the file.
:param configGroupName: the config group name
- :returns: string configurationFile
+ :returns: string -- configurationFile - name of the configuration file
"""
if configGroupName is None:
self._set_ecom_credentials(CINDER_EMC_CONFIG_FILE)
the composite volume should be concatenated or striped.
:param volume: the volume Object
- :returns: tuple extra spec tuple
- :returns: string the configuration file
+ :param volumeTypeId: Optional override of volume['volume_type_id']
+ :returns: dict -- extra spec dict
+ :raises: VolumeBackendAPIException
"""
try:
self.extraSpecs, configurationFile = (
"""Given the extra specs get the pool and storage system name.
:returns: poolInstanceName The pool instance name
- :returns: String the storage system name
+ :returns: string -- the storage system name
+ :raises: VolumeBackendAPIException
"""
try:
:param volume: the volume object
:param connector: the connector object
- :param extraSpecs: the extra spec tuple
- :returns: tuple maskingViewDict a tuple with masking view information
+ :returns: dict -- a dictionary with masking view information
"""
maskingViewDict = {}
hostName = connector['host']
:param storageConfigService: the storage configuration service
:param storageSystemName: the storage system name (String)
:param fastPolicyName: the fast policy name (String)
- :returns: tuple maskingViewDict with masking view information
+ :returns: dict -- maskingViewDict with masking view information
+ :raises: VolumeBackendAPIException
"""
try:
volumeInstance = self.utils.find_volume_instance(
:params poolInstanceName: the pool instance name
:params volumeName: the volume name
:params volumeSize: the size to create the volume
- :returns: volumeInstance the volume instance
+ :returns: volumeInstance -- the volume instance
"""
volumeDict, _ = (
self.provision.create_volume_from_pool(
:param poolInstanceName: the pool instance name
:param volumeInstanceName: the volume instance name
:param volumeName: string the volumeName
- :returns: unboundVolumeInstance the unbound volume instance
+ :returns: unboundVolumeInstance -- the unbound volume instance
"""
_, job = (
:param conn: the connection information to the ecom server
:param elementCompositionServiceInstanceName: the storage element
- composition service
- instance name
- :param volumeInstanceName: the volume instance name
+ composition service instance name
+ :param volumeInstance: the volume instance
:param appendVolumeInstanceName: the appended volume instance name
:param volumeName: the volume name
:param compositeType: concatenated
- :returns: int rc the return code
- :returns: modifiedVolumeDict the modified volume Dict
+ :returns: int -- the return code
+ :returns: dict -- modifiedVolumeDict - the modified volume dict
"""
isComposite = self.utils.check_if_volume_is_composite(
self.conn, volumeInstance)
:param cloneVolume: clone volume
:param sourceVolume: source of the clone volume
- :returns: cloneDict the cloned volume dictionary
+ :param isSnapshot: boolean -- Defaults to False
+ :returns: dict -- cloneDict the cloned volume dictionary
"""
self.extraSpecs = self._initial_setup(cloneVolume)
:param storageSystemName: the storage system name
:param cloneDict: clone dictionary
:param cloneName: clone name
+ :raises: VolumeBackendAPIException
"""
# Check if the clone/snapshot volume already part of the default sg.
cloneInstance = self.utils.find_volume_instance(
if self.fast.is_volume_in_default_SG(self.conn, cloneInstance.path):
return
- # FAST enabled place clone volume or volume from snapshot to
+ # If FAST enabled place clone volume or volume from snapshot to
# default storage group.
LOG.debug("Adding volume: %(cloneName)s to default storage group "
"for FAST policy: %(fastPolicyName)s.",
"""Helper function to delete the specified volume.
:param volume: volume object to be deleted
- :returns: cloneDict the cloned volume dictionary
+ :returns: tuple -- rc (int return code), volumeName (string vol name)
"""
volumeName = volume['name']
:param volume: volume object to be deleted
:param connector: volume object to be deleted
- :returns: int numVolumesMapped
+ :returns: int -- numVolumesMapped
+ :raises: VolumeBackendAPIException
"""
volumename = volume['name']
"""Helper function to delete the specified snapshot.
:param snapshot: snapshot object to be deleted
- :returns: None
+ :raises: VolumeBackendAPIException
"""
LOG.debug("Entering delete_snapshot.")
self._delete_volume(snapshot)
def create_consistencygroup(self, context, group):
- """Creates a consistencygroup.
+ """Creates a consistency group.
- :param context:
+ :param context: the context
:param group: the group object to be created
- :returns:
+ :returns: dict -- modelUpdate = {'status': 'available'}
+ :raises: VolumeBackendAPIException
"""
LOG.info(_LI("Create Consistency Group: %(group)s."),
{'group': group['id']})
def delete_consistencygroup(self, context, group, volumes):
"""Deletes a consistency group.
- :param context:
+ :param context: the context
:param group: the group object to be deleted
- :returns:
+ :param volumes: the list of volumes in the consisgroup to be deleted
+ :returns: dict -- modelUpdate
+ :returns: list -- list of volume objects
+ :raises: VolumeBackendAPIException
"""
LOG.info(_LI("Delete Consistency Group: %(group)s."),
{'group': group['id']})
:param memberInstanceNames: volume Instance names
:param storageConfigservice: storage config service
:param volumes: volume objects
- :param modelUpdate:
- :param isV3: true/false
- :returns: volumes, modelUpdate
+ :param modelUpdate: dict
+ :param isV3: boolean
+ :returns: list -- list of volume objects
+ :returns: dict -- modelUpdate
"""
try:
controllerConfigurationService = (
def create_cgsnapshot(self, context, cgsnapshot, db):
"""Creates a cgsnapshot.
- :param context:
+ :param context: the context
:param cgsnapshot: the consistency group snapshot to be created
:param db: cinder database
- :returns: modelUpdate, list of snapshots
+ :returns: dict -- modelUpdate
+ :returns: list -- list of snapshots
+ :raises: VolumeBackendAPIException
"""
consistencyGroup = db.consistencygroup_get(
context, cgsnapshot['consistencygroup_id'])
def delete_cgsnapshot(self, context, cgsnapshot, db):
"""Delete a cgsnapshot.
- :param context:
+ :param context: the context
:param cgsnapshot: the consistency group snapshot to be created
:param db: cinder database
- :returns: modelUpdate, list of snapshots
+ :returns: dict -- modelUpdate
+ :returns: list -- list of snapshots
+ :raises: VolumeBackendAPIException
"""
consistencyGroup = db.consistencygroup_get(
context, cgsnapshot['consistencygroup_id'])
:param replicationService: the replication service
:param cgName: the consistency group name
- :returns:
+ :returns: foundCgInstanceName
"""
foundCgInstanceName = None
cgInstanceNames = (
"""Get the members of consistency group.
:param cgInstanceName: the CG instance name
- :returns:
+ :returns: list -- memberInstanceNames
"""
memberInstanceNames = self.conn.AssociatorNames(
cgInstanceName,
"""Create a composite volume (V2).
:param volume: the volume object
- :param extraSpecs:
- :param volumeName:
- :param volumeSize:
- :returns:
+ :param volumeName: the name of the volume
+ :param volumeSize: the size of the volume
+ :returns: int -- return code
+ :returns: dict -- volumeDict
+ :returns: string -- storageSystemName
+ :raises: VolumeBackendAPIException
"""
memberCount, errorDesc = self.utils.determine_member_count(
volume['size'], self.extraSpecs[MEMBERCOUNT],
:param volume: the volume object
:param volumeName: the volume name
:param volumeSize: the volume size
- :returns:
+ :returns: int -- return code
+ :returns: dict -- volumeDict
+ :returns: string -- storageSystemName
+ :raises: VolumeBackendAPIException
"""
isValidSLO, isValidWorkload = self.utils.verify_slo_workload(
self.extraSpecs[SLO], self.extraSpecs[WORKLOAD])
:param slo: the SLO
:param workload: the workload
:param storageSystemName: storage system name
- :returns:
+ :returns: sgInstanceName
"""
storageGroupName = self.utils.get_v3_storage_group_name(
poolName, slo, workload)
:param volumeInstance: the volume instance
:param volumeName: the name of the volume
:param newSize: in GBs
- :param additionalVolumeSize:
- :returns:
+ :param additionalVolumeSize: additional volume size
+ :returns: int -- return code
+ :returns: dict -- modifiedVolumeDict
+ :raises: VolumeBackendAPIException
"""
# Is the volume extendable.
isConcatenated = self.utils.check_if_volume_is_extendable(
:param host: the host object
:param volumeName: the name of the volume
:param volumeStatus: the volume status
- :param newType:
- :returns: boolean
+ :param newType: the type to migrate to
+ :returns: boolean -- True if migration succeeded, False if error.
"""
volumeInstanceName = volumeInstance.path
isValid, targetSlo, targetWorkload = (
:param targetSlo: the target SLO
:param targetWorkload: the target workload
:param storageSystemName: the storage system name
- :param newType:
- :returns: boolean
+ :param newType: the type to migrate to
+ :returns: boolean -- True if migration succeeded, False if error.
"""
volumeName = volume['name']
:param volumeName: the name of the volume
:param volumeStatus: the volume status
:param fastPolicyName: the FAST policy Name
- :param newType:
- :returns: boolean
+ :param newType: the type to migrate to
+ :returns: boolean -- True if migration succeeded, False if error.
"""
storageSystemName = volumeInstance['SystemName']
isValid, targetPoolName, targetFastPolicyName = (
:param emcConfigFileName: the EMC configuration file
:param backendName: the backend name
- :param arrayName: the array Name
+ :param arrayName: the array name
+ :param poolName: the pool name
:returns: location_info, total_capacity_gb, free_capacity_gb
"""
# This value can be None.
:param configurationFile: the EMC configuration file
:param arrayName: the array serial number
- :returns: extraSpecs (out)
+ :returns: dict -- the extraSpecs
+ :raises: VolumeBackendAPIException
"""
try:
stripedMetaCount = self.extraSpecs[STRIPECOUNT]
values are NONE and the Optimized SLO will be assigned to the
volume.
- :param extraSpecs: the extraSpecs (input)
:param configurationFile: the EMC configuration file
:param arrayName: the array serial number
- :returns: extraSpecs (out)
+ :returns: dict -- the extraSpecs
"""
self.extraSpecs[SLO] = self.utils.parse_slo_from_file(
configurationFile)
"""Get user defined extra specs around job intervals and retries.
:param configurationFile: the EMC configuration file
- :param arrayName: the array serial number
- :returns: extraSpecs (out)
+ :returns: dict -- extraSpecs
"""
intervalInSecs = self.utils.parse_interval_from_file(
configurationFile)
:param volumeName: the volume Name
:param deviceId: the device ID of the volume
:param fastPolicyName: the FAST policy name(if it exists)
- :returns: rc
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
storageSystemName = volumeInstance['SystemName']
controllerConfigurationService = (
:param volumeName: the volume Name
:param deviceId: the device ID of the volume
:param storageGroupName: the name of the default SG
- :returns: rc
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
storageSystemName = volumeInstance['SystemName']
controllerConfigurationService = (
:param sourceVolume: the source volume object
:param sourceInstance: the device ID of the volume
:param isSnapshot: check to see if it is a snapshot
- :returns: rc
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
# Check if the source volume contains any meta devices.
metaHeadInstanceName = self.utils.get_volume_meta_head(
def _create_v2_replica_and_delete_clone_relationship(
self, repServiceInstanceName, cloneVolume, sourceVolume,
sourceInstance, targetInstance, isSnapshot=False):
- """Create clone and delete relationship (v2).
+ """Create a replica and delete the clone relationship.
:param repServiceInstanceName: the replication service
:param cloneVolume: the clone volume object
:param sourceInstance: the source volume instance
:param targetInstance: the target volume instance
:param isSnapshot: check to see if it is a snapshot
- :returns: rc
+ :returns: int -- return code
+ :returns: dict -- cloneDict
"""
sourceName = sourceVolume['name']
cloneName = cloneVolume['name']
:param storageSystem: the storage system name
:param volume: volume to be attached
:param connector: the connector dict
- :returns: targetWwns, the target WWN list
+ :returns: list -- the target WWN list
"""
targetWwns = []
mvInstanceName = self.get_masking_view_by_volume(volume, connector)
return targetWwns
def get_port_group_from_masking_view(self, maskingViewInstanceName):
+ """Get the port groups in a masking view.
+
+ :param maskingViewInstanceName: masking view instance name
+ :returns: portGroupInstanceName
+ """
return self.masking.get_port_group_from_masking_view(
self.conn, maskingViewInstanceName)
:param volume: the volume
:param connector: the connector object
- :returns maskingviewInstanceName
+ :returns: maskingviewInstanceName
"""
LOG.debug("Finding Masking View for volume %(volume)s.",
{'volume': volume})
def get_masking_views_by_port_group(self, portGroupInstanceName):
"""Given port group, retrieve the masking view instance name.
- :param : the volume
- :param mvInstanceName: masking view instance name
- :returns: maksingViewInstanceNames
+ :param portGroupInstanceName: port group instance name
+ :returns: list -- maskingViewInstanceNames
"""
LOG.debug("Finding Masking Views for port group %(pg)s.",
{'pg': portGroupInstanceName})
def _create_replica_v3(
self, repServiceInstanceName, cloneVolume,
sourceVolume, sourceInstance, isSnapshot):
- """V3 specific function, create replica for source volume.
+ """Create a replica.
- This includes clone and snapshot.
+ V3 specific function, create replica for source volume,
+ including clone and snapshot.
:param repServiceInstanceName: the replication service
:param cloneVolume: the clone volume object
+ :param sourceVolume: the source volume object
:param sourceInstance: the device ID of the volume
- :param isSnapshot: check to see if it is a snapshot
- :returns: rc
+ :param isSnapshot: boolean -- check to see if it is a snapshot
+ :returns: int -- return code
+ :returns: dict -- cloneDict
"""
cloneName = cloneVolume['name']
syncType = self.utils.get_num(8, '16') # Default syncType 8: clone.
def _delete_cg_and_members(
self, storageSystem, cgName, modelUpdate, volumes):
- """Helper function to delete a consistency group and its member volumes.
+ """Helper function to delete a consistencygroup and its member volumes.
:param storageSystem: storage system
- :param repServiceInstanceName: the replication service
- :param cgInstanceName: consistency group instance name
+ :param cgName: consistency group name
+ :param modelUpdate: dict -- the model update dict
+ :param volumes: the list of member volumes
+ :returns: dict -- modelUpdate
+ :returns: list -- the updated list of member volumes
+ :raises: VolumeBackendAPIException
"""
replicationService = self.utils.find_replication_service(
self.conn, storageSystem)
def _check_if_fast_supported(self, conn, storageSystemInstanceName):
"""Check to see if fast is supported on the array.
- :param conn: the connection to the ecom server
+ :param conn: the ecom connection
:param storageSystemInstanceName: the storage system Instance name
+ :returns: boolean -- isTieringPolicySupported
"""
tierPolicyServiceInstanceName = self.utils.get_tier_policy_service(
:param conn: the connection information to the ecom server
:param tierPolicyServiceInstanceName: the tier policy service
- instance name
- :returns: foundIsSupportsTieringPolicies - True/False
+ instance name
+ :returns: boolean -- foundIsSupportsTieringPolicies
"""
foundIsSupportsTieringPolicies = None
tierPolicyCapabilityInstanceNames = conn.AssociatorNames(
:param fastPolicyName: the fast policy name (String)
:param extraSpecs: additional info
:returns: assocStorageGroupInstanceName - the storage group
- associated with the volume
+ associated with the volume
"""
failedRet = None
defaultSgGroupName = (DEFAULT_SG_PREFIX + fastPolicyName +
:param volumeInstance: the volume instance
:param extraSpecs: additional info
:returns: defaultstorageGroupInstanceName - instance name of the
- default storage group
+ default storage group
"""
failedRet = None
firstVolumeInstance = self._create_volume_for_default_volume_group(
:param storageGroupName: the storage group name (String)
:param fastPolicyName: the fast policy name (String)
:param extraSpecs: additional info
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
# 5 is ("Add InElements to Policy").
modificationType = '5'
:param tierPolicyServiceInstanceName: the policy service
:param fastPolicyName: the fast policy name e.g BRONZE1
:returns: foundTierPolicyRuleInstanceName - the short name,
- everything after the :
+ everything after the :
"""
foundTierPolicyRuleInstanceName = None
:param conn: the connection information to the ecom server
:param tierPolicyServiceInstanceName: the tier policy service
- instance Name
- :returns: tierPolicyRuleInstanceNames - the tier policy rule
- instance names
+ instance Name
+ :returns: list -- the tier policy rule instance names
"""
tierPolicyRuleInstanceNames = conn.AssociatorNames(
tierPolicyServiceInstanceName, ResultClass='Symm_TierPolicyRule')
:param conn: the connection information to the ecom server
:param storageGroupInstanceName: the storage group instance name
- :returns: tierPolicyInstanceNames - the list of tier policy
- instance names
+ :returns: list -- the list of tier policy instance names
"""
tierPolicyInstanceName = None
:param conn: the connection information to the ecom server
:param tierPolicyRuleInstanceName: the tier policy rule instance name
- :returns: storageTierInstanceNames - a list of storage tier
- instance names
+ :returns: list -- a list of storage tier instance names
"""
storageTierInstanceNames = conn.AssociatorNames(
tierPolicyRuleInstanceName,
:param conn: the connection information to the ecom server
:param controllerConfigService: ControllerConfigurationService
- instance name
+ instance name
:param policyName: string value
:returns: storageGroupInstanceName - instance name of the default
- storage group
+ storage group
"""
foundStorageMaskingGroupInstanceName = None
storageMaskingGroupInstances = conn.Associators(
:param conn: the connection information to the ecom server
:param tierPolicyInstanceName: tier policy instance name
- :returns: managedElementInstanceNames - the list of storage
- instance names
+ :returns: list -- the list of storage instance names
"""
managedElementInstanceNames = conn.AssociatorNames(
tierPolicyInstanceName,
:param conn: the connection information to the ecom server
:param storageTierInstanceName: the storage tier instance name
- :returns: storagePoolInstanceNames - a list of storage tier
- instance names
+ :returns: list -- a list of storage tier instance names
"""
storagePoolInstanceNames = conn.AssociatorNames(
storageTierInstanceName,
:param conn: the connection information to the ecom server
:param storageGroupInstanceName: storage group instance name
:returns: foundTierPolicyInstanceName - instance name of the
- tier policy object
+ tier policy object
"""
foundTierPolicyInstanceName = None
:param conn: connection the ecom server
:param tierPolicyServiceInstanceName: instance name of the tier policy
- service
+ service
:param storageGroupInstanceName: instance name of the storage group
:param tierPolicyRuleInstanceName: instance name of the tier policy
- associated with the storage group
+ associated with the storage group
:param extraSpecs: additional information
"""
modificationType = '6'
:param arraySN: the array serial number (String)
:param storageConfigService: the storage Config Service
:param poolInstanceName: the pool instance we want to check for
- association with the fast storage tier
+ association with the fast storage tier
:returns: foundPoolInstanceName
"""
storageSystemInstanceName = self.utils.find_storage_system(
True if FAST policy enabled on the given storage system;
False otherwise.
+ :param conn: the ecom connection
:param storageSystemInstanceName: a storage system instance name
- :returns: boolean
+ :returns: boolean -- isTieringPolicySupported
"""
try:
tierPolicyServiceInstanceName = self.utils.get_tier_policy_service(
self, conn, arrayName, policyName):
"""Given the name of the policy, get the TierPolicyRule instance name.
- :param policyName: the name of policy rule, a string value
- :returns: tierPolicyInstanceName - tier policy instance name
+ :param conn: the ecom connection
+ :param arrayName: the array
+ :param policyName: string -- the name of policy rule
+ :returns: tier policy instance name. None if not found
"""
tierPolicyInstanceNames = conn.EnumerateInstanceNames(
'Symm_TierPolicyRule')
Given the name of the policy, get the total capacity and un-used
capacity in GB of all the storage pools associated with the policy.
+ :param conn: the ecom connection
+ :param arrayName: the array
:param policyName: the name of policy rule, a string value
- :returns: total_capacity_gb - total capacity in GB of all pools
- associated with the policy
- :returns: free_capacity_gb - (total capacity-EMCSubscribedCapacity)
- in GB of all pools associated with
- the policy
+ :returns: int -- total capacity in GB of all pools associated with
+ the policy
+ :returns: int -- (total capacity-EMCSubscribedCapacity) in GB of all
+ pools associated with the policy
"""
policyInstanceName = self.get_tier_policy_by_name(
conn, arrayName, policyName)
:param conn: the connection information to the ecom server
:param poolInstanceName: the pool instance name
- :param fastPolicyName: the FAST Policy name (if it exists)
+ :returns: the FAST Policy name (if it exists)
"""
fastPolicyName = None
def is_volume_in_default_SG(self, conn, volumeInstanceName):
"""Check if the volume is already part of the default storage group.
+ :param conn: the ecom connection
:param volumeInstanceName: the volume instance
- :returns: True if the volume is already in default storage group
- False otherwise
+ :returns: boolean -- True if the volume is already in default
+ storage group. False otherwise
"""
sgInstanceNames = conn.AssociatorNames(
volumeInstanceName,
or
- {
+ {
'driver_volume_type': 'fibre_channel'
'data': {
'target_discovered': True,
if there isn't an initiator_target_map in the
return of terminate_connection.
- :returns: data - the target_wwns and initiator_target_map if the
- zone is to be removed, otherwise empty
+ :param volume: the volume object
+ :param connector: the connector object
+ :returns: dict -- the target_wwns and initiator_target_map if the
+ zone is to be removed, otherwise empty
"""
data = {}
loc = volume['provider_location']
def get_volume_stats(self, refresh=False):
"""Get volume stats.
- If 'refresh' is True, run update the stats first.
+ :param refresh: boolean -- If True, run update the stats first.
+ :returns: dict -- the stats dict
"""
if refresh:
self.update_volume_stats()
def migrate_volume(self, ctxt, volume, host):
"""Migrate a volume from one Volume Backend to another.
- :param self: reference to class
- :param ctxt:
+ :param ctxt: context
:param volume: the volume object including the volume_type_id
:param host: the host dict holding the relevant target(destination)
- information
- :returns: moved
- :returns: list
+ information
+ :returns: boolean -- Always returns True
+ :returns: dict -- Empty dict {}
"""
return self.common.migrate_volume(ctxt, volume, host)
def retype(self, ctxt, volume, new_type, diff, host):
"""Migrate volume to another host using retype.
- :param self: reference to class
- :param ctxt:
+ :param ctxt: context
:param volume: the volume object including the volume_type_id
:param new_type: the new volume type.
+ :param diff: Unused parameter.
:param host: the host dict holding the relevant
- target(destination) information
- :returns: moved
- "returns: list
+ target(destination) information
+ :returns: boolean -- True if retype succeeded, Fasle if error
"""
return self.common.retype(ctxt, volume, new_type, diff, host)
def get_default_ca_certs():
- """Try to find out system path with ca certificates. This path is cached and
+ """Gets the default CA certificates if found, otherwise None.
+
+ Try to find out system path with ca certificates. This path is cached and
returned. If no path is found out, None is returned.
"""
if not hasattr(get_default_ca_certs, '_path'):
def migrate_volume(self, ctxt, volume, host):
"""Migrate a volume from one Volume Backend to another.
- :param self: reference to class
- :param ctxt:
+
+ :param ctxt: context
:param volume: the volume object including the volume_type_id
- :param host: the host dict holding the relevant target(destination)
- information
- :returns: moved
- :returns: list
+ :param host: the host dict holding the relevant target information
+ :returns: boolean -- Always returns True
+ :returns: dict -- Empty dict {}
"""
return self.common.migrate_volume(ctxt, volume, host)
def retype(self, ctxt, volume, new_type, diff, host):
"""Migrate volume to another host using retype.
- :param self: reference to class
- :param ctxt:
+ :param ctxt: context
:param volume: the volume object including the volume_type_id
:param new_type: the new volume type.
- :param host: the host dict holding the relevant target(destination)
- information
- :returns: moved
- {}
+ :param diff: Unused parameter in common.retype
+ :param host: the host dict holding the relevant target information
+ :returns: boolean -- True if retype succeeded, Fasle if error
"""
return self.common.retype(ctxt, volume, new_type, diff, host)
def _check_for_iscsi_ip_address(self):
"""Check to see if iscsi_ip_address is set in cinder.conf
- :returns: True/False
+ :returns: boolean -- True if iscsi_ip_address id defined in config.
"""
bExists = os.path.exists(CINDER_CONF)
if bExists:
the volume from any storage group (default or otherwise).
:param conn: the connection to ecom
- :para maskingViewDict: the masking view tuple
+ :param maskingViewDict: the masking view dict
:param extraSpecs: additional info
- :returns: dict rollbackDict
+ :returns: dict -- rollbackDict
+ :raises: VolumeBackendAPIException
"""
rollbackDict = {}
defaultStorageGroupInstanceName):
"""Validate all the individual pieces of the masking view.
- :param conn - the ecom connection
- :param maskingViewDict - the masking view dictionary
- :param defaultStorageGroupInstanceName - the default SG
- :returns: maskingViewInstanceName, storageGroupInstanceName,
- errorMessage
+ :param conn: the ecom connection
+ :param maskingViewDict: the masking view dictionary
+ :param defaultStorageGroupInstanceName: the default SG
+ :returns: maskingViewInstanceName
+ :returns: storageGroupInstanceName,
+ :returns: string -- errorMessage
"""
storageSystemName = maskingViewDict['storageSystemName']
maskingViewName = maskingViewDict['maskingViewName']
defaultStorageGroupInstanceName):
"""Validate the creation of a new masking view.
- :param conn - the ecom connection
- :param maskingViewDict - the masking view dictionary
- :param defaultStorageGroupInstanceName - the default SG
- :returns: maskingViewInstanceName, storageGroupInstanceName,
- errorMessage
+ :param conn: the ecom connection
+ :param maskingViewDict: the masking view dictionary
+ :param defaultStorageGroupInstanceName: the default SG
+ :returns: maskingViewInstanceName
+ :returns: storageGroupInstanceName,
+ :returns: string -- errorMessage
"""
controllerConfigService = maskingViewDict['controllerConfigService']
igGroupName = maskingViewDict['igGroupName']
maskingViewInstanceName):
"""Validate the components of an existing masking view.
- :param conn - the ecom connection
- :param maskingViewDict - the masking view dictionary
- :param maskingViewInstanceName - the masking view instance name
- :returns: storageGroupInstanceName, errorMessage
+ :param conn: the ecom connection
+ :param maskingViewDict: the masking view dictionary
+ :param maskingViewInstanceName: the masking view instance name
+ :returns: storageGroupInstanceName
+ :returns: string -- errorMessage
"""
storageGroupInstanceName = None
controllerConfigService = maskingViewDict['controllerConfigService']
maskingViewDict, storageGroupInstanceName):
"""Get the storage group and return it.
- :param conn - the ecom connection
- :param maskingViewDict - the masking view dictionary
- :param defaultStorageGroupInstanceName - the default SG
- :returns: storageGroupInstanceName, msg
+ :param conn: the ecom connection
+ :param maskingViewDict: the masking view dictionary
+ :param storageGroupInstanceName: default storage group instance name
+ :returns: storageGroupInstanceName
+ :returns: string -- msg, the error message
"""
msg = None
storageGroupInstanceName = (
sgGroupName, maskingViewInstanceName):
"""Check that we can get the existing storage group.
- :param conn - the ecom connection
- :param controllerConfigService - controller configuration service
- :param sgGroupName - the storage group name
- :param maskingViewInstanceName - the masking view instance name
-
- :returns: storageGroupInstanceName, msg
+ :param conn: the ecom connection
+ :param controllerConfigService: controller configuration service
+ :param sgGroupName: the storage group name
+ :param maskingViewInstanceName: the masking view instance name
+ :returns: storageGroupInstanceName
+ :returns: string -- msg, the error message
"""
msg = None
controllerConfigService, pgGroupName):
"""Check that you can either get or create a port group.
- :param conn - the ecom connection
- :param controllerConfigService - controller configuration service
- :param pgGroupName - the port group Name
- :returns: portGroupInstanceName, msg
+ :param conn: the ecom connection
+ :param controllerConfigService: controller configuration service
+ :param pgGroupName: the port group Name
+ :returns: portGroupInstanceName
+ :returns: string -- msg, the error message
"""
msg = None
portGroupInstanceName = self._get_port_group_instance_name(
connector, storageSystemName):
"""Check that initiator group can be either retrieved or created.
- :param conn - the ecom connection
- :param controllerConfigService - controller configuration service
- :param igGroupName - the initiator group Name
- :param connector
- :param storageSystemName - the storage system name
- :returns: initiatorGroupInstanceName, msg
+ :param conn: the ecom connection
+ :param controllerConfigService: controller configuration service
+ :param igGroupName: the initiator group Name
+ :param connector: the connector object
+ :param storageSystemName: the storage system name
+ :returns: initiatorGroupInstanceName
+ :returns: string -- the error message
"""
msg = None
initiatorGroupInstanceName = (
Check if the initiators in the initiator group match those in the
system.
- :param controllerConfigService - controller configuration service
- :param maskingViewName - the masking view name
- :param connector - the connector object
- :param storageSystemName - the storage system name
- :param igGroupName - the initiator group name
- :returns: maskingViewInstanceName, msg
+ :param conn: the ecom connection
+ :param controllerConfigService: controller configuration service
+ :param maskingViewName: the masking view name
+ :param connector: the connector object
+ :param storageSystemName: the storage system name
+ :param igGroupName: the initiator group name
+ :returns: string -- msg, the error message
"""
msg = None
if not self._verify_initiator_group_from_masking_view(
portGroupInstanceName, initiatorGroupInstanceName):
"""Check that masking view can be either got or created.
- :param controllerConfigService - controller configuration service
- :param maskingViewName - the masking view name
- :param storageGroupInstanceName - storage group instance name
- :param portGroupInstanceName - port group instance name
- :param initiatorGroupInstanceName - the initiator group instance name
- :returns: maskingViewInstanceName, msg
+ :param conn: the ecom connection
+ :param controllerConfigService: controller configuration service
+ :param maskingViewName: the masking view name
+ :param storageGroupInstanceName: storage group instance name
+ :param portGroupInstanceName: port group instance name
+ :param initiatorGroupInstanceName: the initiator group instance name
+ :returns: maskingViewInstanceName
+ :returns: string -- msg, the error message
"""
msg = None
maskingViewInstanceName = (
self, conn, maskingViewDict, storageGroupInstanceName):
"""Add the volume to the storage group and double check it is there.
- :param conn - the ecom connection
- :param maskingViewDict - the masking view dictionary
- :returns: msg
+ :param conn: the ecom connection
+ :param maskingViewDict: the masking view dictionary
+ :param storageGroupInstanceName: storage group instance name
+ :returns: string -- the error message
"""
controllerConfigService = maskingViewDict['controllerConfigService']
sgGroupName = maskingViewDict['sgGroupName']
volumeName, fastPolicyName, extraSpecs):
"""Get the storage group and remove volume from it.
- :param controllerConfigService - controller configuration service
- :param volumeInstanceName - volume instance name
- :param volumeName - volume name
- :param fastPolicyName - fast name
+ :param conn: the ecom connection
+ :param controllerConfigService: controller configuration service
+ :param volumeInstanceName: volume instance name
+ :param volumeName: volume name
+ :param fastPolicyName: fast name
:param extraSpecs: additional info
+ :returns: defaultStorageGroupInstanceName
+ :raises: VolumeBackendAPIException
"""
defaultStorageGroupInstanceName = (
self.fast.get_and_verify_default_storage_group(
volumeName, maskingViewDict, storageGroupInstanceName):
"""Get the storage group and remove volume from it.
- :param controllerConfigService - controller configuration service
- :param volumeInstanceName - volume instance name
- :param volumeName - volume name
- :param fastPolicyName - fast name
+ :param conn: the ecom connection
+ :param controllerConfigService: controller configuration service
+ :param volumeInstanceName: volume instance name
+ :param volumeName: volume name
+ :param maskingViewDict: the masking view dictionary
+ :param storageGroupInstanceName: storage group instance name
+ :raises: VolumeBackendAPIException
"""
assocVolumeInstanceNames = self.get_devices_from_storage_group(
:param conn: the connection to ecom
:param storageGroupInstanceName: the storage group instance name
:param volumeInstance: the volume instance
- :returns: boolean True/False
+ :returns: boolean
"""
foundStorageGroupInstanceName = (
self.utils.get_storage_group_from_volume(
:param conn: connection to the ecom server
:param maskingViewName: the masking view name
:param storageSystemName: the storage system name(String)
- :returns: foundMaskingViewInstanceName masking view instance name
+ :returns: dict -- foundMaskingViewInstanceName
"""
foundMaskingViewInstanceName = None
return foundMaskingViewInstanceName
def _create_storage_group(
- self, conn, maskingViewDict,
- defaultStorageGroupInstanceName):
+ self, conn, maskingViewDict, defaultStorageGroupInstanceName):
"""Create a new storage group that doesn't already exist.
If fastPolicyName is not none we attempt to remove it from the
default storage group of that policy and associate to the new storage
group that will be part of the masking view.
+ Will not handle any exception in this method it will be handled
+ up the stack.
:param conn: connection the ecom server
- :param controllerConfigService: the controller configuration service
- :param storageGroupName: the proposed group name (String)
- :param volumeInstance: useful information on the volume
- :param fastPolicyName: the fast policy name (String) can be None
- :param volumeName: the volume name (String)
- :param storageSystemName: the storage system name (String)
+ :param maskingViewDict: the masking view dictionary
:param defaultStorageGroupInstanceName: the default storage group
- instance name (Can be None)
+ instance name (Can be None)
:returns: foundStorageGroupInstanceName the instance Name of the
- storage group
+ storage group
"""
failedRet = None
controllerConfigService = maskingViewDict['controllerConfigService']
:param conn: connection to the ecom server
:param controllerConfigService: the controller configuration service
:param portGroupName: the name of the port group you are getting
- :returns: foundPortGroup storage group instance name
+ :returns: foundPortGroupInstanceName
"""
foundPortGroupInstanceName = None
portMaskingGroupInstances = conn.Associators(
:param conn: the connection to the ecom
:param connector: the connector object
- :returns list foundinitiatornames list of string initiator names
+ :returns: list -- list of found initiator names
+ :raises: VolumeBackendAPIException
"""
foundinitiatornames = []
name = 'initiator name'
:param conn: the connection to the ecom server
:param controllerConfigService: the controller configuration service
- :param initiatorName: the list of initiator names
+ :param initiatorNames: the list of initiator names
:returns: foundInitiatorMaskingGroup
"""
foundInitiatorMaskingGroupInstanceName = None
"""Given a list of initiator names find CIM_StorageHardwareID instance.
:param conn: the connection to the ecom server
- :param initiatorName: the list of initiator names
+ :param initiatorNames: the list of initiator names
:param storageSystemName: the storage system name
- :returns: foundHardwardIDsInstanceNames
+ :returns: list -- foundHardwardIDsInstanceNames
"""
foundHardwardIDsInstanceNames = []
storageId = hardwareIdInstance['StorageID']
for initiatorName in initiatorNames:
if storageId.lower() == initiatorName.lower():
- # Check that the found hardwareId has been delete.
+ # Check that the found hardwareId has been deleted.
# If it has, we don't want to add it to the list.
instance = self.utils.get_existing_instance(
conn, hardwareIdInstance.path)
:param conn: the connection to the ecom server
:param job: the create initiator group job
- :returns: dict initiatorDict
+ :returns: dict -- initiatorDict
"""
associators = conn.Associators(
job['Job'],
:param deviceMaskingGroup: device(storage) masking group (instanceName)
:param targetMaskingGroup: target(port) masking group (instanceName)
:param initiatorMaskingGroup: initiator masking group (instanceName)
- :returns: int rc return code
- :returns: dict job
+ :returns: int -- return code
+ :returns: dict -- job
+ :raises: VolumeBackendAPIException
"""
rc, job = conn.InvokeMethod(
'CreateMaskingView', configService, ElementName=maskingViewName,
"""Find the newly created volume.
:param conn: the connection to the ecom server
- :param jobDict: the job tuple
- :returns: instance maskingViewInstance
+ :param jobDict: the job dictionary
+ :returns: dict -- maskingViewInstance
"""
associators = conn.Associators(
jobDict['Job'],
"""Gets the Device Masking Group from masking view instance.
:param conn: the connection to the ecom server
- :param maskingViewInstance
+ :param maskingViewInstance: the masking view instance
:returns: instance name foundStorageGroupInstanceName
"""
foundStorageGroupInstanceName = None
defaultStorageGroupInstanceName):
"""Gets the storage group instance name.
- If fastPolicy name is None
- then NON FAST is assumed. If it is a valid fastPolicy name
- then associate the new storage group with the fast policy.
+ If fastPolicy name is None then NON FAST is assumed.
+ If it is a valid fastPolicy name then associate the new storage
+ group with the fast policy.
If we are using an existing storage group then we must check that
it is associated with the correct fast policy.
:param conn: the connection to the ecom server
- :param maskingViewDict - the masking view dictionary
+ :param maskingViewDict: the masking view dictionary
:param defaultStorageGroupInstanceName: default storage group instance
- name (can be None for Non FAST)
+ name (can be None for Non FAST)
:returns: instance name storageGroupInstanceName
+ :raises: VolumeBackendAPIException
"""
storageGroupInstanceName = self.utils.find_storage_masking_group(
conn, maskingViewDict['controllerConfigService'],
:param controllerConfigService: the controller configuration server
:param igGroupName: the port group name
:param connector: the connector object
- :param storageSystemName = the storage system name
- :returns: instance name foundInitiatorGroupInstanceName
+ :param storageSystemName: the storage system name
+ :returns: foundInitiatorGroupInstanceName
"""
foundInitiatorGroupInstanceName = (self._create_or_get_initiator_group(
conn, controllerConfigService, igGroupName, connector,
the exception occurred.
:param conn: the connection to the ecom server
- :param controllerConfigService: the controller config service
- :param volumeInstanceName: the volume instance name
- :param volumeName: the volume name (String)
- :param fastPolicyName: the fast policy name (String)
- :param defaultStorageGroupInstanceName: the default storage group
- instance name
+ :param rollbackDict: the rollback dictionary
+ :raises: VolumeBackendAPIException
"""
try:
if rollbackDict['isV3']:
:param conn: connection the ecom server
:param maskingGroupDict: the maskingGroupDict dict
- :param storageGroupName: storage group name (String)
:returns: instance name foundInitiatorGroupInstanceName
"""
foundInitiatorGroupInstanceName = None
:param connector: the connector dict
:param storageSystemName: the storage System Name (string)
:param igGroupName: the initiator group name (String)
+ :returns: boolean
"""
initiatorNames = self._find_initiator_names(conn, connector)
foundInitiatorGroupFromConnector = self._find_initiator_masking_group(
:param controllerConfigService: the controller configuration service
:param igGroupName: the initiator group name (String)
:param hardwareIdinstanceNames: one or more hardware id instance names
+ :returns: foundInitiatorGroupInstanceName
+ :raises: VolumeBackendAPIException
"""
rc, job = conn.InvokeMethod(
'CreateGroup', controllerConfigService, GroupName=igGroupName,
:param controllerConfigService: the controller configuration service
:param maskingViewName: maskingview name (String)
:param maskingViewInstanceName: the masking view instance name
+ :raises: VolumeBackendAPIException
"""
rc, job = conn.InvokeMethod('DeleteMaskingView',
controllerConfigService,
:param conn: connection to ecom server
:param controllerConfigService: the controller configuration service
- :param storageGroup: storage group instance
+ :param storageGroupInstanceName: storage group instance name
:param volumeInstance: the volume instance
:param volumeName: the name of the volume (String)
:param sgGroupName: the name of the storage group (String)
:param extraSpecs: additional info
- :returns: int rc the return code of the job
- :returns: dict the job dict
+ :returns: int -- rc the return code of the job
+ :returns: dict -- the job dict
"""
self.provision.add_members_to_masking_group(
conn, controllerConfigService, storageGroupInstanceName,
return defaultStorageGroupInstanceName
def _wrap_get_storage_group_from_volume(self, conn, volumeInstanceName):
-
"""Wrapper for get_storage_group_from_volume.
Needed for override in tests.
:param volumeInstanceName: the volume instance name
:returns: emptyStorageGroupInstanceName
"""
+
return self.utils.get_storage_group_from_volume(
conn, volumeInstanceName)
:param conn: connection the the ecom server
:param storageGroupInstanceName: the storage group instance name
- :returns: list volumeInstanceNames list of volume instance names
+ :returns: list -- volumeInstanceNames list of volume instance names
"""
volumeInstanceNames = conn.AssociatorNames(
storageGroupInstanceName,
:param conn: connection the the ecom server
:param volumeInstanceName: the volume instance name
- :returns: list of storage group instance names
+ :returns: list -- list of storage group instance names
"""
maskingGroupInstanceNames = conn.AssociatorNames(
volumeInstanceName,
:param controllerConfigService: the controller configuration service
:param volumeInstance: the volume Instance
:param volumeName: the volume name
+ :param extraSpecs: additional info
:param connector: optional
:param noReset: optional, if none, then reset
- :returns: maskingGroupInstanceName
+ :returns: storageGroupInstanceName
"""
isV3 = extraSpecs[ISV3]
fastPolicyName = extraSpecs.get(FASTPOLICY, None)
:param conn: the ecom connection
:param controllerConfigService: storage system instance name
- :param volumeInstanceName
- :param volumeName
- :param connector
+ :param volumeInstanceName: the volume instance name
+ :param volumeName: the volume name (String)
+ :param connector: the connector object
:returns: storageGroupInstanceName(can be None)
"""
return self._get_sg_or_mv_associated_with_initiator(
:param conn: the ecom connection
:param storageSystemInstanceName: storage system instance name
- :param fastPolicyName
-
- :returns: isTieringPolicySupported, tierPolicyServiceInstanceName
-
+ :param fastPolicyName:
+ :returns: boolean -- isTieringPolicySupported
+ :returns: tierPolicyServiceInstanceName
"""
isTieringPolicySupported = False
tierPolicyServiceInstanceName = None
"""Remove the storage group from the policy rule.
:param conn: the ecom connection
+ :param fastPolicyName: the fast policy name
:param isTieringPolicySupported: boolean
:param tierPolicyServiceInstanceName: the tier policy instance name
:param storageSystemName: storage system name
:param conn: the ecom connection
:param controllerConfigService: controller config service
- :param storageGroupInstanceName: storage group instance name
+ :param storageGroupName: storage group name
:param volumeInstance: volumeInstance
:param volumeName: the volume name
:param storageSystemInstanceName: the storage system instance name
:param extraSpecs: additional info
+ :raises: VolumeBackendAPIException
"""
# First strip the shortHostname from the storage group name.
defaultStorageGroupName, shorthostName = (
def _cleanup_tiering(
self, conn, controllerConfigService, fastPolicyName,
volumeInstance, volumeName, extraSpecs):
- """Clea nup tiering.
+ """Clean up tiering.
:param conn: the ecom connection
:param controllerConfigService: the controller configuration service
:param conn: the ecom connection
:param mvInstanceName: masking view instance name
+ :returns: list -- the list of target wwns for the masking view
"""
targetWwns = []
targetPortInstanceNames = conn.AssociatorNames(
def get_masking_view_by_volume(self, conn, volumeInstance, connector):
"""Given volume, retrieve the masking view instance name.
+ :param conn: the ecom connection
:param volumeInstance: the volume instance
:param connector: the connector object
- :returns mvInstanceName: masking view instance name
+ :returns: masking view instance name
"""
storageSystemName = volumeInstance['SystemName']
def get_masking_views_by_port_group(self, conn, portGroupInstanceName):
"""Given port group, retrieve the masking view instance name.
- :param : the volume
- :param mvInstanceName: masking view instance name
- :returns: maksingViewInstanceNames
+ :param conn: the ecom connection
+ :param portGroupInstanceName: the instance name of the port group
+ :returns: masking view instance names
"""
mvInstanceNames = conn.AssociatorNames(
portGroupInstanceName, ResultClass='Symm_LunMaskingView')
def get_port_group_from_masking_view(self, conn, maskingViewInstanceName):
"""Get the port group in a masking view.
+ :param conn: the ecom connection
:param maskingViewInstanceName: masking view instance name
:returns: portGroupInstanceName
"""
self, conn, maskingViewInstanceName):
"""Get initiator group in a masking view.
+ :param conn: the ecom connection
:param maskingViewInstanceName: masking view instance name
:returns: initiatorGroupInstanceName or None if it is not found
"""
:param conn: the ecom connection
:param controllerConfigService: storage system instance name
- :param volumeInstanceName - volume instance name
- :param volumeName - volume element name
- :param connector - the connector object
- :param getSG - True if to get storage group; otherwise get masking
+ :param volumeInstanceName: volume instance name
+ :param volumeName: volume element name
+ :param connector: the connector object
+ :param getSG: True if to get storage group; otherwise get masking
:returns: foundInstanceName(can be None)
"""
foundInstanceName = None
:param volumeInstanceName: the volume instance name
:param volumeName: the volume name (String)
:param extraSpecs: additional info
- :param rc: return code
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param storageConfigService: the storage configuration service
:param volumeName: the volume name (String)
:param poolInstanceName: the pool instance name to create
- the dummy volume in
+ the dummy volume in
:param volumeSize: volume size (String)
:param extraSpecs: additional info
- :returns: volumeDict - the volume dict
+ :returns: dict -- the volume dict
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param volumeInstanceName: the volume instance name
:param extraSpecs: additional info
:returns: foundStorageGroupInstanceName - instance name of the
- default storage group
+ default storage group
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param controllerConfigService: the controller configuration service
:param groupName: the proposed group name
:param extraSpecs: additional info
- :returns: foundStorageGroupInstanceName - the instance Name of
- the storage group
+ :returns: foundStorageGroupInstanceName
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the ecom connection
:param jobInstance: the instance of a job
- :returns: volumeDict - an instance of a volume
+ :returns: dict -- volumeDict - an instance of a volume
"""
associators = conn.Associators(
jobInstance,
:param volumeInstanceName: the instance name of the volume
:param volumeName: the volume name (String)
:param extraSpecs: additional info
- :returns: rc - the return code of the job
+ :returns: int -- the return code of the job
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param volumeInstanceName: the instance name of the volume
:param volumeName: the volume name (String)
:param extraSpecs: additional info
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection information to the ecom server
:param storageConfigService: the storage configuration service
- instance name
+ instance name
:param poolInstanceName: the pool instance name
:param volumeInstanceName: the volume instance name
:param volumeName: the volume name
:param extraSpecs: additional info
- :returns: unboundVolumeInstance - the unbound volume instance
+ :returns: int -- return code
+ :returns: the job object
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param elementCompositionService: the element composition service
:param theVolumeInstanceName: the existing composite volume
:param inVolumeInstanceName: the volume you wish to add to the
- composite volume
+ composite volume
:param extraSpecs: additional info
- :returns: rc - return code
- :returns: job - job
+ :returns: int -- rc - return code
+ :returns: the job object
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param volumeName: user friendly name
:param poolInstanceName: the pool to bind the composite volume to
:param compositeType: the proposed composite type of the volume
- e.g striped/concatenated
+ e.g striped/concatenated
:param numMembers: the number of meta members to make up the composite.
- If it is 1 then a non composite is created
+ If it is 1 then a non composite is created
:param extraSpecs: additional info
- :returns: rc
- :returns: errordesc
+ :returns: dict -- volumeDict
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection the the ecom server
:param elementCompositionService: the element composition service
:param compositeHeadInstanceName: the composite head. This can be bound
- :param compositeMemberInstanceName: the composite member.
- This must be unbound
+ :param compositeMemberInstanceName: the composite member. This must be
+ unbound
:param compositeType: the composite type e.g striped or concatenated
:param extraSpecs: additional info
- :returns: rc - return code
- :returns: errordesc - descriptions of the error
+ :returns: int -- return code
+ :returns: the job object
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection to the ecom server
:param storageRelocationServiceInstanceName: the storage relocation
- service
+ service
:param volumeInstanceName: the volume to be migrated
:param targetPoolInstanceName: the target pool to migrate the volume to
:param extraSpecs: additional info
- :returns: rc - return code
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection to the ecom server
:param storageRelocationServiceInstanceName: the storage relocation
- service
+ service
:param volumeInstanceName: the volume to be migrated
:param targetPoolInstanceName: the target pool to migrate the
- volume to.
+ volume to.
:param extraSpecs: additional info
- :returns: rc
+ :returns: int -- rc, return code
+ :raises: VolumeBackendAPIException
"""
LOG.debug(
"Volume instance name is %(volumeInstanceName)s. "
:param conn: the connection to the ecom server
:param volumeInstanceName: the volume to be migrated
:param extraSpecs: additional info
- :returns: rc
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
copyOnWrite=False):
"""Make SMI-S call to create replica for source element.
- :param conn - the connection to the ecom server
- :param repServiceInstanceName - replication service
- :param cloneName - replica name
- :param sourceName - source volume name
- :param sourceInstance - source volume instance
+ :param conn: the connection to the ecom server
+ :param repServiceInstanceName: replication service
+ :param cloneName: replica name
+ :param sourceName: source volume name
+ :param sourceInstance: source volume instance
+ :param targetInstance: the target instance
:param extraSpecs: additional info
:param copyOnWrite: optional
-
- :returns: rc - return code
- :returns: job - job object of the replica creation operation
+ :returns: int -- return code
+ :returns: job object of the replica creation operation
+ :raises: VolumeBackendAPIException
"""
if copyOnWrite:
startTime = time.time()
"""Deletes the relationship between the clone and source volume.
Makes an SMI-S call to break clone relationship between the clone
- volume and the source. 8/Detach - Delete the synchronization between
- two storage objects. Treat the objects as independent after the
- synchronization is deleted.
+ volume and the source.
+ 8/Detach - Delete the synchronization between two storage objects.
+ Treat the objects as independent after the synchronization is deleted.
:param conn: the connection to the ecom server
:param repServiceInstanceName: instance name of the replication service
:param syncInstanceName: instance name of the
- SE_StorageSynchronized_SV_SV object
- :param extraSpecs - additional info
- :param force - optional param
- :returns: rc - return code
- :returns: job - job object of the replica creation operation
+ SE_StorageSynchronized_SV_SV object
+ :param extraSpecs: additional info
+ :param force: optional param
+ :returns: int -- return code
+ :returns: job object of the replica creation operation
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection to the ecom server
:param storageHardwareService: the storage HardwareId Service
:param hardwareId: the hardware Id
- :returns: rc
- :returns: targetendpoints
+ :returns: int -- return code
+ :returns: targetEndpoints
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection to the ecom server
:param replicationService: the replication Service
:param consistencyGroupName: the CG group name
- :param extraSpecs - additional info
- :returns: rc
- :returns: job
+ :param extraSpecs: additional info
+ :returns: int -- return code
+ :returns: job object
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param replicationService: the replication Service
:param cgInstanceName: the CG instance name
:param consistencyGroupName: the CG group name
- :param extraSpecs - additional info
- :returns: rc
- :returns: job
+ :param extraSpecs: additional info
+ :returns: int -- return code
+ :returns: job object
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection to the ecom server
:param replicationService: the replication Service
- :param volumeInstanceName: the volume instance name
:param cgInstanceName: the CG instance name
+ :param volumeInstanceName: the volume instance name
:param cgName: the CG group name
:param volumeName: the volume name
- :param extraSpecs - additional info
- :returns: rc
- :returns: job
+ :param extraSpecs: additional info
+ :returns: int -- return code
+ :returns: job object
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection to the ecom server
:param replicationService: the replication Service
- :param volumeInstanceName: the volume instance name
:param cgInstanceName: the CG instance name
+ :param volumeInstanceName: the volume instance name
:param cgName: the CG group name
:param volumeName: the volume name
- :param extraSpecs - additional info
- :returns: rc
- :returns: job
+ :param extraSpecs: additional info
+ :returns: int -- return code
+ :returns: job object
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
extraSpecs):
"""Make SMI-S call to create replica for source group.
- :param conn - the connection to the ecom server
- :param repServiceInstanceName - replication service
- :param srcGroupInstanceName - source group instance name
- :param tgtGroupInstanceName - target group instance name
- :param relationName -
- :param extraSpecs - additional info
-
- :returns: rc - return code
- :returns: job - job object of the replica creation operation
+ :param conn: the connection to the ecom server
+ :param replicationService: replication service
+ :param srcGroupInstanceName: source group instance name
+ :param tgtGroupInstanceName: target group instance name
+ :param relationName: relation name
+ :param extraSpecs: additional info
+ :returns: int -- return code
+ :returns: job object of the replica creation operation
+ :raises: VolumeBackendAPIException
"""
LOG.debug(
"Parameters for CreateGroupReplica: "
:param volumeInstanceName: the volume instance name
:param volumeName: the volume name (String)
:param extraSpecs: additional info
- :returns: rc -- return code
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param storageConfigService: the storage configuration service
:param volumeName: the volume name (String)
:param sgInstanceName: the storage group instance name
- associated with an SLO
+ associated with an SLO
:param volumeSize: volume size (String)
:param extraSpecs: additional info
- :returns: volumeDict - the volume dict
- :returns: rc - return code
+ :returns: dict -- volumeDict - the volume dict
+ :returns: int -- return code
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the ecom connection
:param jobInstance: the instance of a job
- :returns: volumeDict - an instance of a volume
+ :returns: dict -- volumeDict - an instance of a volume
"""
associators = conn.Associators(
jobInstance,
targetInstance=None):
"""Make SMI-S call to create replica for source element.
- :param conn - the connection to the ecom server
- :param repServiceInstanceName - replication service
- :param cloneName - clone volume name
- :param syncType - 7: snapshot, 8: clone
- :param sourceInstance - source volume instance
+ :param conn: the connection to the ecom server
+ :param repServiceInstanceName: replication service
+ :param cloneName: clone volume name
+ :param syncType: 7=snapshot, 8=clone
+ :param sourceInstance: source volume instance
:param extraSpecs: additional info
- :param targetInstance - target volume instance
- :returns: rc - return code
+ :param targetInstance: target volume instance. Defaults to None
+ :returns: int -- rc - return code
:returns: job - job object of the replica creation operation
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection to the ecom server
:param repServiceInstanceName: instance name of the replication service
:param syncInstanceName: instance name of the
- SE_StorageSynchronized_SV_SV object
+ SE_StorageSynchronized_SV_SV object
:param operation: operation code
:param extraSpecs: additional info
:param force: force to break replication relationship if True
:param workload: the workload (String)
:param extraSpecs: additional info
:returns: storageGroupInstanceName - storage group instance name
-
"""
startTime = time.time()
:param conn: the connection information to the ecom server
:param poolInstanceName: the pool instance
- :returns: storagePoolCapability - the storage pool capability instance
- None - if not found
+ :returns: the storage pool capability instance. None if not found
"""
storagePoolCapability = None
:param storagePoolCapability: the storage pool capability instance
:param slo: the slo string e.g Bronze
:param workload: the workload string e.g DSS_REP
- :returns: foundStoragePoolSetting - the storage pool setting instance
+ :returns: the storage pool setting instance
"""
foundStoragePoolSetting = None
:param conn: the connection information to the ecom server
:param storageConfigService: the storage configuration service instance
:param srpPoolInstanceName: the SRP storage pool instance
- :param storagePoolSettingInstanceName: the SLO type
- e.g Bronze
+ :param storagePoolSettingInstanceName: the SLO type, e.g Bronze
:param extraSpecs: additional info
- :returns: supportedSizeDict - the supported size dict
+ :returns: dict -- supportedSizeDict - the supported size dict
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
:param conn: the connection to the ecom server
:param repServiceInstanceName: instance name of the replication service
:param syncInstanceName: instance name of the
- SE_StorageSynchronized_SV_SV object
+ SE_StorageSynchronized_SV_SV object
:param extraSpecs: additional info
- :returns: rc - return code
- :returns: job - job object of the replica creation operation
+ :returns: int -- return code
+ :returns: job object of the replica creation operation
"""
# Operation 4: activate the snapVx.
operation = self.utils.get_num(4, '16')
:param syncInstanceName: instance name of the
:param extraSpecs: additional info
:returns: rc - return code
- :returns: job - job object of the replica creation operation
+ :returns: job object of the replica creation operation
"""
# Operation 4: activate the snapVx.
operation = self.utils.get_num(19, '16')
:param conn: the connection to the ecom server
:param repServiceInstanceName: instance name of the replication service
:param syncInstanceName: instance name of the
- SE_StorageSynchronized_SV_SV object
- :param operation: opeation code
+ SE_StorageSynchronized_SV_SV object
+ :param operation: operation code
:param extraSpecs: additional info
:param force: force to modify replication synchronization if True
- :returns: rc - return code
- :returns: job - job object of the replica creation operation
+ :returns: int -- return code
+ :returns: job object of the replica creation operation
+ :raises: VolumeBackendAPIException
"""
startTime = time.time()
extraSpecs):
"""Make SMI-S call to create replica for source group.
- :param conn - the connection to the ecom server
- :param replicationService - replication service
- :param srcGroupInstanceName - source group instance name
- :param tgtGroupInstanceName - target group instance name
- :param relationName - replica relationship name
+ :param conn: the connection to the ecom server
+ :param replicationService: replication service
+ :param srcGroupInstanceName: source group instance name
+ :param tgtGroupInstanceName: target group instance name
+ :param relationName: replica relationship name
:param extraSpecs: additional info
- :returns: rc - return code
- :returns: job - job object of the replica creation operation
+ :returns: int -- return code
+ :returns: job object of the replica creation operation
+ :raises: VolumeBackendAPIException
"""
LOG.debug(
"Creating CreateGroupReplica V3: "
:param conn: connection to the ecom server
:param storageSystemName: the storage system name
- :returns: foundconfigService
+ :returns: foundConfigService
+ :raises: VolumeBackendAPIException
"""
foundConfigService = None
configservices = conn.EnumerateInstanceNames(
:param conn: connection to the ecom server
:param storageSystemName: the storage system name
:returns: foundconfigService
+ :raises: VolumeBackendAPIException
"""
foundConfigService = None
configservices = conn.EnumerateInstanceNames(
:param conn: the connection to the ecom server
:param storageSystemName: the storage system name
:returns: foundElementCompositionService
+ :raises: VolumeBackendAPIException
"""
foundElementCompositionService = None
elementCompositionServices = conn.EnumerateInstanceNames(
:param conn: the connection to the ecom server
:param storageSystemName: the storage system name
:returns: foundStorageRelocationService
+ :raises: VolumeBackendAPIException
"""
foundStorageRelocationService = None
storageRelocationServices = conn.EnumerateInstanceNames(
:param conn: the connection to the ecom server
:param storageSystemName: the storage system name
:returns: foundStorageRelocationService
+ :raises: VolumeBackendAPIException
"""
foundHardwareService = None
storageHardwareservices = conn.EnumerateInstanceNames(
:param conn: the connection to the ecom server
:param storageSystemName: the storage system name
:returns: foundRepService
+ :raises: VolumeBackendAPIException
"""
foundRepService = None
repservices = conn.EnumerateInstanceNames(
:param conn: the connection information to the ecom server
:param storageSystemInstanceName: the storageSystem instance Name
:returns: foundTierPolicyService - the tier policy
- service instance name
+ service instance name
+ :raises: VolumeBackendAPIException
"""
foundTierPolicyService = None
groups = conn.AssociatorNames(
:param conn: connection to the ecom server
:param job: the job dict
- :returns: rc - the return code
+ :param extraSpecs: the extraSpecs dict. Defaults to None
+ :returns: int -- the return code
:returns: errorDesc - the error description string
"""
:param conn: connection to the ecom server
:param job: the job dict
+ :param extraSpecs: the extraSpecs dict. Defaults to None
+ :raises: loopingcall.LoopingCallDone
+ :raises: VolumeBackendAPIException
"""
def _wait_for_job_complete():
def _get_max_job_retries(self, extraSpecs):
"""Get max job retries either default or user defined
- :param extraSpecs: extraSpecs
-
+ :param extraSpecs: extraSpecs dict
:returns: JOB_RETRIES or user defined
"""
if extraSpecs:
def _get_interval_in_secs(self, extraSpecs):
"""Get interval in secs, either default or user defined
- :param extraSpecs: extraSpecs
-
+ :param extraSpecs: extraSpecs dict
:returns: INTERVAL_10_SEC or user defined
"""
if extraSpecs:
:param conn: connection to the ecom server
:param job: the job dict
-
- :returns: True if finished; False if not finished;
+ :returns: boolean -- True if finished; False if not finished;
"""
jobInstanceName = job['Job']
def wait_for_sync(self, conn, syncName):
"""Given the sync name wait for it to fully synchronize.
- Called at an interval until the synchronization is finished.
-
:param conn: connection to the ecom server
:param syncName: the syncName
+ :raises: loopingcall.LoopingCallDone
+ :raises: VolumeBackendAPIException
"""
def _wait_for_sync():
+ """Called at an interval until the synchronization is finished.
+
+ :raises: loopingcall.LoopingCallDone
+ :raises: VolumeBackendAPIException
+ """
retries = kwargs['retries']
wait_for_sync_called = kwargs['wait_for_sync_called']
if self._is_sync_complete(conn, syncName):
:param conn: connection to the ecom server
:param syncName: the sync name
-
:returns: True if fully synchronized; False if not;
"""
syncInstance = conn.GetInstance(syncName,
from it.
:param conn: the connection to the ecom server
- :param storageConfigService: the storage configuration service
- :returns: rc - the return code of the job
- :returns: jobDict - the job dict
+ :param configService: the storage configuration service
+ :returns: int -- rc - the return code of the job
+ :returns: dict -- jobDict - the job dict
"""
foundStorageSystemInstanceName = None
groups = conn.AssociatorNames(
:param conn: connection to the ecom server
:param volumeInstanceName: the volume instance name
- :returns: foundStorageGroupInstanceName - the storage group
- instance name
+ :returns: foundStorageGroupInstanceName
"""
foundStorageGroupInstanceName = None
:param conn: connection to the ecom server
:param controllerConfigService: the controllerConfigService
:param storageGroupName: the name of the storage group you are getting
- :param foundStorageGroup: storage group instance name
+ :returns: foundStorageMaskingGroupInstanceName
"""
foundStorageMaskingGroupInstanceName = None
"""Given any service get the storage system name from it.
:param configService: the configuration service
- :returns: configService['SystemName'] - storage system name (String)
+ :returns: string -- configService['SystemName'] - storage system name
"""
return configService['SystemName']
:param conn: connection to the ecom server
:param volumeDict: the volume Dict
:param volumeName: the user friendly name of the volume
- :returns: foundVolumeInstance - the volume instance
+ :returns: foundVolumeInstance - the found volume instance
"""
volumeInstanceName = self.get_instance_name(volumeDict['classname'],
volumeDict['keybindings'])
the full hostName is returned.
:param hostName: the fully qualified host name ()
- :param shortHostName: the short hostName
+ :returns: string -- the short hostName
"""
shortHostName = None
:param classname: class name for the volume instance
:param bindings: volume created from job
- :returns: foundVolumeInstance - the volume instance
-
+ :returns: pywbem.CIMInstanceName -- instanceName
"""
instanceName = None
try:
"""Given the filename get the ecomUser and ecomPasswd.
:param filename: the path and filename of the emc configuration file
- :returns: ecomUser - the ecom user
- :returns: ecomPasswd - the ecom password
+ :returns: string -- ecomUseSSL
+ :returns: string -- ecomCACert
+ :returns: string -- ecomNoVerification
"""
ecomUseSSL = self._parse_from_file(filename, 'EcomUseSSL')
ecomCACert = self._parse_from_file(filename, 'EcomCACert')
portGroupElements and choose one randomly.
:param fileName: the path and name of the file
- :returns: portGroupName - the name of the port group chosen
+ :returns: string -- portGroupName - the name of the port group chosen
+ :raises: VolumeBackendAPIException
"""
portGroupName = None
myFile = open(fileName, 'r')
Remove newlines, tabs and trailing spaces.
:param fileName: the path and name of the file
- :returns: retString - the returned string
+ :param stringToParse: the name of the tag to get the value for
+ :returns: string -- the returned string; value of the tag
"""
retString = None
myFile = open(fileName, 'r')
the ecom. If there is more than one then erroneous results can occur.
:param fileName: the path and name of the file
- :returns: arrayName - the array name
+ :returns: string -- arrayName - the array name
"""
arrayName = self._parse_from_file(fileName, 'Array')
if arrayName:
If it is not there then we will attempt to get it from extra specs.
:param fileName: the path and name of the file
- :returns: poolName - the pool name
+ :returns: string -- poolName - the pool name
"""
poolName = self._parse_from_file(fileName, 'Pool')
if poolName:
Please note that the string 'NONE' is returned if it is not found.
:param fileName: the path and name of the file
- :returns: slo - the slo or 'NONE'
+ :returns: string -- the slo or 'NONE'
"""
slo = self._parse_from_file(fileName, 'SLO')
if slo:
Please note that the string 'NONE' is returned if it is not found.
:param fileName: the path and name of the file
- :returns: workload - the workload or 'NONE'
+ :returns: string -- the workload or 'NONE'
"""
workload = self._parse_from_file(fileName, 'Workload')
if workload:
If it is not there then the default will be used.
:param fileName: the path and name of the file
- :returns: interval - the interval in seconds
+ :returns: string -- interval - the interval in seconds
"""
interval = self._parse_from_file(fileName, 'Interval')
if interval:
If it is not there then the default will be used.
:param fileName: the path and name of the file
- :returns: retries - the max number of retries
+ :returns: string -- retries - the max number of retries
"""
retries = self._parse_from_file(fileName, 'Retries')
if retries:
Example of pool InstanceId: Symmetrix+0001233455555+U+Pool 0
:param poolInstanceId: the path and name of the file
- :returns: poolName - the pool name
- :returns: systemName - the system name
+ :returns: string -- poolName - the pool name
+ :returns: string -- systemName - the system name
"""
poolName = None
systemName = None
return poolName, systemName
def convert_gb_to_bits(self, strGbSize):
- """Convert GB(string) to bits(string).
+ """Convert GB(string) to bytes(string).
:param strGB: string -- The size in GB
- :returns: strBitsSize string -- The size in bits
+ :returns: string -- The size in bytes
"""
strBitsSize = six.text_type(int(strGbSize) * 1024 * 1024 * 1024)
:param conn: the connection information to the ecom server
:param volumeInstance: the volume Instance
- :returns: 'True', 'False' or 'Undetermined'
+ :returns: string -- 'True', 'False' or 'Undetermined'
"""
propertiesList = volumeInstance.properties.items()
for properties in propertiesList:
:param conn: the connection information to the ecom server
:param volumeInstance: the volume instance
- :returns: 'True', 'False' or 'Undetermined'
+ :returns: string -- 'True', 'False' or 'Undetermined'
"""
isConcatenated = None
The default is '2' concatenated.
:param compositeTypeStr: 'concatenated' or 'striped'. Cannot be None
- :returns: compositeType = 2 or 3
+ :returns: int -- compositeType = 2 for concatenated, or 3 for striped
"""
compositeType = 2
stripedStr = 'striped'
"""Check if volume is bound to a pool.
:param conn: the connection information to the ecom server
- :param storageServiceInstanceName: the storageSystem instance Name
- :returns: foundIsSupportsTieringPolicies - true/false
+ :param volumeInstance: the volume instance
+ :returns: string -- 'True' 'False' or 'Undetermined'
"""
propertiesList = volumeInstance.properties.items()
for properties in propertiesList:
return foundSpaceConsumed
def get_volume_size(self, conn, volumeInstance):
- """Get the volume size. ConsumableBlocks * BlockSize.
+ """Get the volume size which is ConsumableBlocks * BlockSize.
:param conn: the connection information to the ecom server
:param volumeInstance: the volume Instance
- :returns: volumeSizeOut
+ :returns: string -- volumeSizeOut
"""
volumeSizeOut = 'Undetermined'
numBlocks = 0
:param sizeStr: the size in GBs of the proposed volume
:param memberCount: the initial member count
:param compositeType: the composite type
- :returns: memberCount - string
- :returns: errorDesc - the error description
+ :returns: string -- memberCount
+ :returns: string -- errorDesc - the error description
"""
errorDesc = None
if compositeType in 'concatenated' and int(sizeStr) > 240:
capacity in GB.
:param conn: connection to the ecom server
- :param storagePoolName: string value of the storage pool name
- :returns: total_capacity_gb - total capacity of the storage pool in GB
- :returns: free_capacity_gb - remaining capacity of the
- storage pool in GB
+ :param poolName: string value of the storage pool name
+ :param storageSystemName: the storage system name
+ :returns: tuple -- (total_capacity_gb, free_capacity_gb)
"""
LOG.debug(
"Retrieving capacity for pool %(poolName)s on array %(array)s.",
:param conn: connection to the ecom server
:param storagePoolName: string value of the storage pool name
:param storageSystemName: string value of array
- :returns: poolInstanceName - instance name of storage pool
+ :returns: foundPoolInstanceName - instance name of storage pool
"""
foundPoolInstanceName = None
LOG.debug(
return foundPoolInstanceName
def convert_bits_to_gbs(self, strBitSize):
- """Convert Bits(string) to GB(string).
+ """Convert bytes(string) to GB(string).
- :param strBitSize: string -- The size in bits
- :returns: gbSize string -- The size in GB
+ :param strBitSize: string -- The size in bytes
+ :returns: int -- The size in GB
"""
gbSize = int(strBitSize) / 1024 / 1024 / 1024
return gbSize
:param size1Str: the first bit size (String)
:param size2Str: the second bit size (String)
- :returns: size1GBs - size2GBs (int)
+ :returns: int -- size1GBs - size2GBs
"""
size1GBs = self.convert_bits_to_gbs(size1Str)
size2GBs = self.convert_bits_to_gbs(size2Str)
"""Compare the bit sizes to an approximate.
:param volume: the volume dictionary
- :returns: extraSpecs - the extra specs
+ :param volumeTypeId: Optional override for volume['volume_type_id']
+ :returns: dict -- extraSpecs - the extra specs
"""
extraSpecs = {}
"""Get the volume type name.
:param volume: the volume dictionary
- :returns: volumeTypeName - the volume type name
+ :returns: string -- volumeTypeName - the volume type name
"""
volumeTypeName = None
"""Check the space consumed of a volume.
:param conn: the connection information to the ecom server
- :param volumeInstance: the volume Instance
- :returns: spaceConsumed
+ :param poolInstanceName: the pool instance name
+ :returns: the volumes in the pool
"""
return conn.AssociatorNames(
poolInstanceName, AssocClass='CIM_AllocatedFromStoragePool',
:param conn: the connection information to the ecom server
:param volumeInstance: the volume Instance
- :returns: spaceConsumed
+ :returns: string -- 'True', 'False' or 'Undetermined'
"""
foundSpaceConsumed = None
unitnames = conn.References(
"""Given the protocol type, return I for iscsi and F for fc.
:param protocol: iscsi or fc
- :returns: 'I' or 'F'
+ :returns: string -- 'I' for iscsi or 'F' for fc
"""
if protocol.lower() == ISCSI.lower():
return 'I'
:param conn: connection to the ecom server
:param: hardwareIdManagementService - hardware id management service
:returns: hardwareIdInstances - the list of hardware
- id instances
+ id instances
"""
hardwareIdInstances = (
conn.Associators(hardwareIdManagementService,
:param strToTruncate: the string to be truncated
:param maxNum: the maximum number of characters
- :returns: truncated string or original string
+ :returns: string -- truncated string or original string
"""
if len(strToTruncate) > maxNum:
newNum = len(strToTruncate) - maxNum / 2
:param startTime: the start time
:param endTime: the end time
- :returns: delta in string H:MM:SS
+ :returns: string -- delta in string H:MM:SS
"""
delta = endTime - startTime
return str(datetime.timedelta(seconds=int(delta)))
:param storageSystem: the storage system name
:param target: target volume object
:param waitforsync: wait for the synchronization to complete if True
- :returns: foundSyncName (String)
+ :returns: foundSyncInstanceName
"""
foundSyncInstanceName = None
syncInstanceNames = conn.EnumerateInstanceNames(
self, context, db, cgsnapshot_id, status='available'):
"""Update cgsnapshot status in the cinder database.
- :param context:
+ :param context: the context
:param db: cinder database
:param cgsnapshot_id: cgsnapshot id
:param status: string value reflects the status of the member snapshot
- :return snapshots: updated snapshots
+ :returns: snapshots - updated snapshots
"""
snapshots = db.snapshot_get_all_for_cgsnapshot(context, cgsnapshot_id)
LOG.info(_LI(
:param conn: the connection to the ecom server
:param arrayName: the array name
- :returns: firmwareVersion (String)
+ :returns: string -- firmwareVersion
"""
firmwareVersion = None
softwareIdentities = conn.EnumerateInstanceNames(
:param conn: the connection to the ecom server
:param arrayName: the array name
:param poolName: the pool name
- :returns: totalManagedSpace, remainingManagedSpace
+ :returns: totalCapacityGb
+ :returns: remainingCapacityGb
"""
totalCapacityGb = -1
remainingCapacityGb = -1
:param conn: the connection to the ecom server
:param storageSystemInstanceName: the storage system instance name
:param poolNameInStr: the pool name
- :returns: foundPoolInstanceName, systemNameStr
+ :returns: foundPoolInstanceName
+ :returns: string -- systemNameStr
"""
foundPoolInstanceName = None
vpoolInstanceNames = conn.AssociatorNames(
:param conn: the connection to the ecom server
:param storageSystemInstanceName: the storage system instance name
:param poolNameInStr: the pool name
- :returns: foundPoolInstanceName, systemNameStr
+ :returns: foundPoolInstanceName
+ :returns: string -- systemNameStr
"""
foundPoolInstanceName = None
srpPoolInstanceNames = conn.AssociatorNames(
def find_storageSystem(self, conn, arrayStr):
"""Find an array instance name given the array name.
+ :param conn: the ecom connection
:param arrayStr: the array Serial number (string)
:returns: foundPoolInstanceName, the CIM Instance Name of the Pool
+ :raises: VolumeBackendAPIException
"""
foundStorageSystemInstanceName = None
storageSystemInstanceNames = conn.EnumerateInstanceNames(
:param volumeSize: volume size
:param maximumVolumeSize: the max volume size
:param minimumVolumeSize: the min volume size
- :returns: true/false
+ :returns: boolean
"""
if (long(volumeSize) < long(maximumVolumeSize)) and (
:param slo: Service Level Object e.g bronze
:param workload: workload e.g DSS
- :returns: true/false
+ :returns: boolean
"""
isValidSLO = False
isValidWorkload = False
def get_volume_meta_head(self, conn, volumeInstanceName):
"""Get the head of a meta volume.
+ :param conn: the ecom connection
:param volumeInstanceName: the composite volume instance name
:returns: the instance name of the meta volume head
"""
self, conn, metaHeadInstanceName):
"""Get the member volumes of a composite volume.
+ :param conn: the ecom connection
:param metaHeadInstanceName: head of the composite volume
:returns: an array containing instance names of member volumes
"""
def get_meta_members_capacity_in_bit(self, conn, volumeInstanceNames):
"""Get the capacity in bits of all meta device member volumes.
+ :param conn: the ecom connection
:param volumeInstanceNames: array contains meta device member volumes
:returns: array contains capacities of each member device in bits
"""