From: Xing Yang Date: Fri, 20 Feb 2015 20:20:31 +0000 (-0500) Subject: Fixed errors in docstrings in the VMAX driver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=48ba31a266236a3718135bdc33d6dcf9b8b6106c;p=openstack-build%2Fcinder-build.git Fixed errors in docstrings in the VMAX driver This patch fixed errors in docstrings in the VMAX driver. Change-Id: I7079ac25bd44e6faecc8a025c0522a7cd5837ef6 --- diff --git a/cinder/volume/drivers/emc/emc_vmax_common.py b/cinder/volume/drivers/emc/emc_vmax_common.py index bbaa0dd04..73d3bcd89 100644 --- a/cinder/volume/drivers/emc/emc_vmax_common.py +++ b/cinder/volume/drivers/emc/emc_vmax_common.py @@ -174,8 +174,7 @@ class EMCVMAXCommon(object): 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'] @@ -222,9 +221,10 @@ class EMCVMAXCommon(object): 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) @@ -252,9 +252,9 @@ class EMCVMAXCommon(object): 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) @@ -279,7 +279,7 @@ class EMCVMAXCommon(object): :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) @@ -305,10 +305,10 @@ class EMCVMAXCommon(object): 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) @@ -372,7 +372,7 @@ class EMCVMAXCommon(object): :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) @@ -411,9 +411,9 @@ class EMCVMAXCommon(object): :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( @@ -453,8 +453,8 @@ class EMCVMAXCommon(object): 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'] @@ -468,7 +468,7 @@ class EMCVMAXCommon(object): """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) @@ -489,6 +489,7 @@ class EMCVMAXCommon(object): :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'] @@ -593,7 +594,9 @@ class EMCVMAXCommon(object): :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 = ( @@ -624,10 +627,10 @@ class EMCVMAXCommon(object): :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'] @@ -660,10 +663,10 @@ class EMCVMAXCommon(object): :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 " @@ -684,8 +687,8 @@ class EMCVMAXCommon(object): :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'] @@ -753,9 +756,7 @@ class EMCVMAXCommon(object): :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."), @@ -790,9 +791,6 @@ class EMCVMAXCommon(object): :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."), @@ -842,7 +840,7 @@ class EMCVMAXCommon(object): :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( @@ -888,8 +886,8 @@ class EMCVMAXCommon(object): :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'] @@ -968,9 +966,7 @@ class EMCVMAXCommon(object): :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( @@ -1011,9 +1007,6 @@ class EMCVMAXCommon(object): :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( @@ -1039,14 +1032,13 @@ class EMCVMAXCommon(object): :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']: @@ -1119,12 +1111,12 @@ class EMCVMAXCommon(object): :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']: @@ -1184,8 +1176,9 @@ class EMCVMAXCommon(object): 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 @@ -1202,7 +1195,8 @@ class EMCVMAXCommon(object): 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: @@ -1254,7 +1248,9 @@ class EMCVMAXCommon(object): :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 @@ -1292,7 +1288,6 @@ class EMCVMAXCommon(object): 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 """ @@ -1330,8 +1325,9 @@ class EMCVMAXCommon(object): :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'] @@ -1392,8 +1388,7 @@ class EMCVMAXCommon(object): for a volume. :param volume: the volume dict - :returns: data, the data dict - + :returns: dict -- the data dict """ foundNumDeviceNumber = None foundMaskingViewName = None @@ -1446,7 +1441,8 @@ class EMCVMAXCommon(object): :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 = [] @@ -1505,8 +1501,8 @@ class EMCVMAXCommon(object): :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) @@ -1539,7 +1535,7 @@ class EMCVMAXCommon(object): """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) @@ -1599,8 +1595,9 @@ class EMCVMAXCommon(object): 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 = ( @@ -1642,7 +1639,8 @@ class EMCVMAXCommon(object): """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: @@ -1668,8 +1666,7 @@ class EMCVMAXCommon(object): :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'] @@ -1735,7 +1732,8 @@ class EMCVMAXCommon(object): :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( @@ -1813,7 +1811,7 @@ class EMCVMAXCommon(object): :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( @@ -1833,7 +1831,7 @@ class EMCVMAXCommon(object): :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 = ( @@ -1853,14 +1851,13 @@ class EMCVMAXCommon(object): :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) @@ -1915,7 +1912,8 @@ class EMCVMAXCommon(object): :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) @@ -1977,6 +1975,7 @@ class EMCVMAXCommon(object): :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( @@ -1984,7 +1983,7 @@ class EMCVMAXCommon(object): 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.", @@ -2016,7 +2015,7 @@ class EMCVMAXCommon(object): """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'] @@ -2155,7 +2154,8 @@ class EMCVMAXCommon(object): :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'] @@ -2201,7 +2201,7 @@ class EMCVMAXCommon(object): """Helper function to delete the specified snapshot. :param snapshot: snapshot object to be deleted - :returns: None + :raises: VolumeBackendAPIException """ LOG.debug("Entering delete_snapshot.") @@ -2251,11 +2251,12 @@ class EMCVMAXCommon(object): 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']}) @@ -2291,9 +2292,12 @@ class EMCVMAXCommon(object): 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']}) @@ -2356,9 +2360,10 @@ class EMCVMAXCommon(object): :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 = ( @@ -2387,10 +2392,12 @@ class EMCVMAXCommon(object): 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']) @@ -2521,10 +2528,12 @@ class EMCVMAXCommon(object): 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']) @@ -2570,7 +2579,7 @@ class EMCVMAXCommon(object): :param replicationService: the replication service :param cgName: the consistency group name - :returns: + :returns: foundCgInstanceName """ foundCgInstanceName = None cgInstanceNames = ( @@ -2589,7 +2598,7 @@ class EMCVMAXCommon(object): """Get the members of consistency group. :param cgInstanceName: the CG instance name - :returns: + :returns: list -- memberInstanceNames """ memberInstanceNames = self.conn.AssociatorNames( cgInstanceName, @@ -2602,10 +2611,12 @@ class EMCVMAXCommon(object): """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], @@ -2697,7 +2708,10 @@ class EMCVMAXCommon(object): :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]) @@ -2767,7 +2781,7 @@ class EMCVMAXCommon(object): :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) @@ -2790,8 +2804,10 @@ class EMCVMAXCommon(object): :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( @@ -2861,8 +2877,8 @@ class EMCVMAXCommon(object): :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 = ( @@ -2905,8 +2921,8 @@ class EMCVMAXCommon(object): :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'] @@ -2980,8 +2996,8 @@ class EMCVMAXCommon(object): :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 = ( @@ -3014,7 +3030,8 @@ class EMCVMAXCommon(object): :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. @@ -3084,7 +3101,8 @@ class EMCVMAXCommon(object): :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] @@ -3144,10 +3162,9 @@ class EMCVMAXCommon(object): 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) @@ -3173,8 +3190,7 @@ class EMCVMAXCommon(object): """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) @@ -3201,7 +3217,8 @@ class EMCVMAXCommon(object): :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 = ( @@ -3282,7 +3299,8 @@ class EMCVMAXCommon(object): :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 = ( @@ -3346,7 +3364,8 @@ class EMCVMAXCommon(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 + :returns: int -- return code + :raises: VolumeBackendAPIException """ # Check if the source volume contains any meta devices. metaHeadInstanceName = self.utils.get_volume_meta_head( @@ -3441,7 +3460,7 @@ class EMCVMAXCommon(object): 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 @@ -3449,7 +3468,8 @@ class EMCVMAXCommon(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'] @@ -3494,7 +3514,7 @@ class EMCVMAXCommon(object): :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) @@ -3508,6 +3528,11 @@ class EMCVMAXCommon(object): 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) @@ -3516,7 +3541,7 @@ class EMCVMAXCommon(object): :param volume: the volume :param connector: the connector object - :returns maskingviewInstanceName + :returns: maskingviewInstanceName """ LOG.debug("Finding Masking View for volume %(volume)s.", {'volume': volume}) @@ -3527,9 +3552,8 @@ class EMCVMAXCommon(object): 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}) @@ -3539,15 +3563,18 @@ class EMCVMAXCommon(object): 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. @@ -3604,11 +3631,15 @@ class EMCVMAXCommon(object): 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) diff --git a/cinder/volume/drivers/emc/emc_vmax_fast.py b/cinder/volume/drivers/emc/emc_vmax_fast.py index e0505337b..155f3bc3d 100644 --- a/cinder/volume/drivers/emc/emc_vmax_fast.py +++ b/cinder/volume/drivers/emc/emc_vmax_fast.py @@ -38,8 +38,9 @@ class EMCVMAXFast(object): 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( @@ -63,8 +64,8 @@ class EMCVMAXFast(object): :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( @@ -155,7 +156,7 @@ class EMCVMAXFast(object): :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 + @@ -194,7 +195,7 @@ class EMCVMAXFast(object): :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( @@ -292,6 +293,8 @@ class EMCVMAXFast(object): :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' @@ -329,7 +332,7 @@ class EMCVMAXFast(object): :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 @@ -349,9 +352,8 @@ class EMCVMAXFast(object): :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') @@ -364,8 +366,7 @@ class EMCVMAXFast(object): :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 @@ -386,8 +387,7 @@ class EMCVMAXFast(object): :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, @@ -409,10 +409,10 @@ class EMCVMAXFast(object): :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( @@ -441,8 +441,7 @@ class EMCVMAXFast(object): :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, @@ -457,8 +456,7 @@ class EMCVMAXFast(object): :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, @@ -538,7 +536,7 @@ class EMCVMAXFast(object): :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 @@ -560,10 +558,10 @@ class EMCVMAXFast(object): :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' @@ -602,7 +600,7 @@ class EMCVMAXFast(object): :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( @@ -645,8 +643,9 @@ class EMCVMAXFast(object): 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( @@ -663,8 +662,10 @@ class EMCVMAXFast(object): 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') @@ -680,12 +681,13 @@ class EMCVMAXFast(object): 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) @@ -761,7 +763,7 @@ class EMCVMAXFast(object): :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 @@ -784,9 +786,10 @@ class EMCVMAXFast(object): 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, diff --git a/cinder/volume/drivers/emc/emc_vmax_fc.py b/cinder/volume/drivers/emc/emc_vmax_fc.py index 83113154e..87db5db1e 100644 --- a/cinder/volume/drivers/emc/emc_vmax_fc.py +++ b/cinder/volume/drivers/emc/emc_vmax_fc.py @@ -142,7 +142,7 @@ class EMCVMAXFCDriver(driver.FibreChannelDriver): or - { + { 'driver_volume_type': 'fibre_channel' 'data': { 'target_discovered': True, @@ -178,8 +178,10 @@ class EMCVMAXFCDriver(driver.FibreChannelDriver): 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'] @@ -257,7 +259,8 @@ class EMCVMAXFCDriver(driver.FibreChannelDriver): 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() @@ -275,27 +278,25 @@ class EMCVMAXFCDriver(driver.FibreChannelDriver): 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) diff --git a/cinder/volume/drivers/emc/emc_vmax_https.py b/cinder/volume/drivers/emc/emc_vmax_https.py index 5cfe8703c..c44f5912b 100644 --- a/cinder/volume/drivers/emc/emc_vmax_https.py +++ b/cinder/volume/drivers/emc/emc_vmax_https.py @@ -53,7 +53,9 @@ def to_bytes(s): 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'): diff --git a/cinder/volume/drivers/emc/emc_vmax_iscsi.py b/cinder/volume/drivers/emc/emc_vmax_iscsi.py index 6decf8ba1..a1fca5745 100644 --- a/cinder/volume/drivers/emc/emc_vmax_iscsi.py +++ b/cinder/volume/drivers/emc/emc_vmax_iscsi.py @@ -274,27 +274,24 @@ class EMCVMAXISCSIDriver(driver.ISCSIDriver): 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) @@ -319,7 +316,7 @@ class EMCVMAXISCSIDriver(driver.ISCSIDriver): 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: diff --git a/cinder/volume/drivers/emc/emc_vmax_masking.py b/cinder/volume/drivers/emc/emc_vmax_masking.py index 7c3fecd84..1bef90084 100644 --- a/cinder/volume/drivers/emc/emc_vmax_masking.py +++ b/cinder/volume/drivers/emc/emc_vmax_masking.py @@ -61,9 +61,10 @@ class EMCVMAXMasking(object): 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 = {} @@ -172,11 +173,12 @@ class EMCVMAXMasking(object): 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'] @@ -199,11 +201,12 @@ class EMCVMAXMasking(object): 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'] @@ -253,10 +256,11 @@ class EMCVMAXMasking(object): 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'] @@ -285,10 +289,11 @@ class EMCVMAXMasking(object): 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 = ( @@ -309,12 +314,12 @@ class EMCVMAXMasking(object): 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 @@ -336,10 +341,11 @@ class EMCVMAXMasking(object): 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( @@ -358,12 +364,13 @@ class EMCVMAXMasking(object): 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 = ( @@ -388,12 +395,13 @@ class EMCVMAXMasking(object): 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( @@ -414,12 +422,14 @@ class EMCVMAXMasking(object): 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 = ( @@ -440,9 +450,10 @@ class EMCVMAXMasking(object): 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'] @@ -485,11 +496,14 @@ class EMCVMAXMasking(object): 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( @@ -523,10 +537,13 @@ class EMCVMAXMasking(object): 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( @@ -572,7 +589,7 @@ class EMCVMAXMasking(object): :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( @@ -603,7 +620,7 @@ class EMCVMAXMasking(object): :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 @@ -636,25 +653,21 @@ class EMCVMAXMasking(object): 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'] @@ -710,7 +723,7 @@ class EMCVMAXMasking(object): :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( @@ -797,7 +810,8 @@ class EMCVMAXMasking(object): :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' @@ -836,7 +850,7 @@ class EMCVMAXMasking(object): :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 @@ -881,9 +895,9 @@ class EMCVMAXMasking(object): """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 = [] @@ -899,7 +913,7 @@ class EMCVMAXMasking(object): 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) @@ -922,7 +936,7 @@ class EMCVMAXMasking(object): :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'], @@ -949,8 +963,9 @@ class EMCVMAXMasking(object): :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, @@ -979,8 +994,8 @@ class EMCVMAXMasking(object): """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'], @@ -1028,7 +1043,7 @@ class EMCVMAXMasking(object): """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 @@ -1045,17 +1060,18 @@ class EMCVMAXMasking(object): 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'], @@ -1111,8 +1127,8 @@ class EMCVMAXMasking(object): :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, @@ -1162,12 +1178,8 @@ class EMCVMAXMasking(object): 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']: @@ -1246,7 +1258,6 @@ class EMCVMAXMasking(object): :param conn: connection the ecom server :param maskingGroupDict: the maskingGroupDict dict - :param storageGroupName: storage group name (String) :returns: instance name foundInitiatorGroupInstanceName """ foundInitiatorGroupInstanceName = None @@ -1303,6 +1314,7 @@ class EMCVMAXMasking(object): :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( @@ -1376,6 +1388,8 @@ class EMCVMAXMasking(object): :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, @@ -1457,6 +1471,7 @@ class EMCVMAXMasking(object): :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, @@ -1502,13 +1517,13 @@ class EMCVMAXMasking(object): :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, @@ -1584,7 +1599,6 @@ class EMCVMAXMasking(object): return defaultStorageGroupInstanceName def _wrap_get_storage_group_from_volume(self, conn, volumeInstanceName): - """Wrapper for get_storage_group_from_volume. Needed for override in tests. @@ -1593,6 +1607,7 @@ class EMCVMAXMasking(object): :param volumeInstanceName: the volume instance name :returns: emptyStorageGroupInstanceName """ + return self.utils.get_storage_group_from_volume( conn, volumeInstanceName) @@ -1605,7 +1620,7 @@ class EMCVMAXMasking(object): :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, @@ -1622,7 +1637,7 @@ class EMCVMAXMasking(object): :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, @@ -1650,9 +1665,10 @@ class EMCVMAXMasking(object): :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) @@ -1771,9 +1787,9 @@ class EMCVMAXMasking(object): :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( @@ -1786,10 +1802,9 @@ class EMCVMAXMasking(object): :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 @@ -1833,6 +1848,7 @@ class EMCVMAXMasking(object): """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 @@ -1863,11 +1879,12 @@ class EMCVMAXMasking(object): :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 = ( @@ -1903,7 +1920,7 @@ class EMCVMAXMasking(object): 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 @@ -1936,6 +1953,7 @@ class EMCVMAXMasking(object): :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( @@ -1954,9 +1972,10 @@ class EMCVMAXMasking(object): 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'] @@ -1973,9 +1992,9 @@ class EMCVMAXMasking(object): 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') @@ -1984,6 +2003,7 @@ class EMCVMAXMasking(object): 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 """ @@ -2002,6 +2022,7 @@ class EMCVMAXMasking(object): 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 """ @@ -2026,10 +2047,10 @@ class EMCVMAXMasking(object): :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 diff --git a/cinder/volume/drivers/emc/emc_vmax_provision.py b/cinder/volume/drivers/emc/emc_vmax_provision.py index ddaf38540..1594942d9 100644 --- a/cinder/volume/drivers/emc/emc_vmax_provision.py +++ b/cinder/volume/drivers/emc/emc_vmax_provision.py @@ -52,7 +52,8 @@ class EMCVMAXProvision(object): :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() @@ -96,10 +97,11 @@ class EMCVMAXProvision(object): :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() @@ -149,7 +151,8 @@ class EMCVMAXProvision(object): :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() @@ -189,8 +192,8 @@ class EMCVMAXProvision(object): :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() @@ -243,7 +246,7 @@ class EMCVMAXProvision(object): :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, @@ -271,7 +274,8 @@ class EMCVMAXProvision(object): :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() @@ -308,6 +312,7 @@ class EMCVMAXProvision(object): :param volumeInstanceName: the instance name of the volume :param volumeName: the volume name (String) :param extraSpecs: additional info + :raises: VolumeBackendAPIException """ startTime = time.time() @@ -339,12 +344,14 @@ class EMCVMAXProvision(object): :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() @@ -382,10 +389,11 @@ class EMCVMAXProvision(object): :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() @@ -424,12 +432,13 @@ class EMCVMAXProvision(object): :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() @@ -496,12 +505,13 @@ class EMCVMAXProvision(object): :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() @@ -539,11 +549,12 @@ class EMCVMAXProvision(object): :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() @@ -579,12 +590,13 @@ class EMCVMAXProvision(object): :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. " @@ -638,7 +650,8 @@ class EMCVMAXProvision(object): :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() @@ -671,16 +684,17 @@ class EMCVMAXProvision(object): 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() @@ -777,18 +791,19 @@ class EMCVMAXProvision(object): """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() @@ -831,8 +846,9 @@ class EMCVMAXProvision(object): :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() @@ -859,9 +875,10 @@ class EMCVMAXProvision(object): :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() @@ -902,9 +919,10 @@ class EMCVMAXProvision(object): :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() @@ -943,13 +961,14 @@ class EMCVMAXProvision(object): :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() @@ -988,13 +1007,14 @@ class EMCVMAXProvision(object): :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() @@ -1033,15 +1053,15 @@ class EMCVMAXProvision(object): 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: " diff --git a/cinder/volume/drivers/emc/emc_vmax_provision_v3.py b/cinder/volume/drivers/emc/emc_vmax_provision_v3.py index c551a98d9..80ca10e6a 100644 --- a/cinder/volume/drivers/emc/emc_vmax_provision_v3.py +++ b/cinder/volume/drivers/emc/emc_vmax_provision_v3.py @@ -50,7 +50,8 @@ class EMCVMAXProvisionV3(object): :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() @@ -97,11 +98,12 @@ class EMCVMAXProvisionV3(object): :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() @@ -159,7 +161,7 @@ class EMCVMAXProvisionV3(object): :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, @@ -182,15 +184,16 @@ class EMCVMAXProvisionV3(object): 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() @@ -249,7 +252,7 @@ class EMCVMAXProvisionV3(object): :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 @@ -276,7 +279,6 @@ class EMCVMAXProvisionV3(object): :param workload: the workload (String) :param extraSpecs: additional info :returns: storageGroupInstanceName - storage group instance name - """ startTime = time.time() @@ -316,8 +318,7 @@ class EMCVMAXProvisionV3(object): :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 @@ -338,7 +339,7 @@ class EMCVMAXProvisionV3(object): :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 @@ -362,10 +363,10 @@ class EMCVMAXProvisionV3(object): :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() @@ -435,10 +436,10 @@ class EMCVMAXProvisionV3(object): :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') @@ -459,7 +460,7 @@ class EMCVMAXProvisionV3(object): :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') @@ -483,12 +484,13 @@ class EMCVMAXProvisionV3(object): :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() @@ -529,14 +531,15 @@ class EMCVMAXProvisionV3(object): 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: " diff --git a/cinder/volume/drivers/emc/emc_vmax_utils.py b/cinder/volume/drivers/emc/emc_vmax_utils.py index d11658ea5..613853cfd 100644 --- a/cinder/volume/drivers/emc/emc_vmax_utils.py +++ b/cinder/volume/drivers/emc/emc_vmax_utils.py @@ -72,7 +72,8 @@ class EMCVMAXUtils(object): :param conn: connection to the ecom server :param storageSystemName: the storage system name - :returns: foundconfigService + :returns: foundConfigService + :raises: VolumeBackendAPIException """ foundConfigService = None configservices = conn.EnumerateInstanceNames( @@ -103,6 +104,7 @@ class EMCVMAXUtils(object): :param conn: connection to the ecom server :param storageSystemName: the storage system name :returns: foundconfigService + :raises: VolumeBackendAPIException """ foundConfigService = None configservices = conn.EnumerateInstanceNames( @@ -130,6 +132,7 @@ class EMCVMAXUtils(object): :param conn: the connection to the ecom server :param storageSystemName: the storage system name :returns: foundElementCompositionService + :raises: VolumeBackendAPIException """ foundElementCompositionService = None elementCompositionServices = conn.EnumerateInstanceNames( @@ -157,6 +160,7 @@ class EMCVMAXUtils(object): :param conn: the connection to the ecom server :param storageSystemName: the storage system name :returns: foundStorageRelocationService + :raises: VolumeBackendAPIException """ foundStorageRelocationService = None storageRelocationServices = conn.EnumerateInstanceNames( @@ -185,6 +189,7 @@ class EMCVMAXUtils(object): :param conn: the connection to the ecom server :param storageSystemName: the storage system name :returns: foundStorageRelocationService + :raises: VolumeBackendAPIException """ foundHardwareService = None storageHardwareservices = conn.EnumerateInstanceNames( @@ -212,6 +217,7 @@ class EMCVMAXUtils(object): :param conn: the connection to the ecom server :param storageSystemName: the storage system name :returns: foundRepService + :raises: VolumeBackendAPIException """ foundRepService = None repservices = conn.EnumerateInstanceNames( @@ -241,7 +247,8 @@ class EMCVMAXUtils(object): :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( @@ -266,7 +273,8 @@ class EMCVMAXUtils(object): :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 """ @@ -291,6 +299,9 @@ class EMCVMAXUtils(object): :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(): @@ -329,8 +340,7 @@ class EMCVMAXUtils(object): 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: @@ -342,8 +352,7 @@ class EMCVMAXUtils(object): 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: @@ -357,8 +366,7 @@ class EMCVMAXUtils(object): :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'] @@ -380,13 +388,18 @@ class EMCVMAXUtils(object): 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): @@ -418,7 +431,6 @@ class EMCVMAXUtils(object): :param conn: connection to the ecom server :param syncName: the sync name - :returns: True if fully synchronized; False if not; """ syncInstance = conn.GetInstance(syncName, @@ -460,9 +472,9 @@ class EMCVMAXUtils(object): 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( @@ -485,8 +497,7 @@ class EMCVMAXUtils(object): :param conn: connection to the ecom server :param volumeInstanceName: the volume instance name - :returns: foundStorageGroupInstanceName - the storage group - instance name + :returns: foundStorageGroupInstanceName """ foundStorageGroupInstanceName = None @@ -510,7 +521,7 @@ class EMCVMAXUtils(object): :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 @@ -539,7 +550,7 @@ class EMCVMAXUtils(object): """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'] @@ -549,7 +560,7 @@ class EMCVMAXUtils(object): :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']) @@ -574,7 +585,7 @@ class EMCVMAXUtils(object): the full hostName is returned. :param hostName: the fully qualified host name () - :param shortHostName: the short hostName + :returns: string -- the short hostName """ shortHostName = None @@ -591,8 +602,7 @@ class EMCVMAXUtils(object): :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: @@ -641,8 +651,9 @@ class EMCVMAXUtils(object): """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') @@ -665,7 +676,8 @@ class EMCVMAXUtils(object): 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') @@ -708,7 +720,8 @@ class EMCVMAXUtils(object): 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') @@ -752,7 +765,7 @@ class EMCVMAXUtils(object): 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: @@ -767,7 +780,7 @@ class EMCVMAXUtils(object): 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: @@ -782,7 +795,7 @@ class EMCVMAXUtils(object): 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: @@ -798,7 +811,7 @@ class EMCVMAXUtils(object): 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: @@ -814,7 +827,7 @@ class EMCVMAXUtils(object): 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: @@ -829,7 +842,7 @@ class EMCVMAXUtils(object): 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: @@ -844,8 +857,8 @@ class EMCVMAXUtils(object): 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 @@ -885,10 +898,10 @@ class EMCVMAXUtils(object): 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) @@ -902,7 +915,7 @@ class EMCVMAXUtils(object): :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: @@ -946,7 +959,7 @@ class EMCVMAXUtils(object): :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 @@ -983,7 +996,7 @@ class EMCVMAXUtils(object): 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' @@ -1000,8 +1013,8 @@ class EMCVMAXUtils(object): """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: @@ -1041,11 +1054,11 @@ class EMCVMAXUtils(object): 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 @@ -1076,8 +1089,8 @@ class EMCVMAXUtils(object): :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: @@ -1119,10 +1132,9 @@ class EMCVMAXUtils(object): 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.", @@ -1152,7 +1164,7 @@ class EMCVMAXUtils(object): :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( @@ -1176,10 +1188,10 @@ class EMCVMAXUtils(object): 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 @@ -1189,7 +1201,7 @@ class EMCVMAXUtils(object): :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) @@ -1200,7 +1212,8 @@ class EMCVMAXUtils(object): """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 = {} @@ -1221,7 +1234,7 @@ class EMCVMAXUtils(object): """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 @@ -1251,8 +1264,8 @@ class EMCVMAXUtils(object): """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', @@ -1263,7 +1276,7 @@ class EMCVMAXUtils(object): :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( @@ -1290,7 +1303,7 @@ class EMCVMAXUtils(object): """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' @@ -1306,7 +1319,7 @@ class EMCVMAXUtils(object): :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, @@ -1319,7 +1332,7 @@ class EMCVMAXUtils(object): :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 @@ -1350,7 +1363,7 @@ class EMCVMAXUtils(object): :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))) @@ -1363,7 +1376,7 @@ class EMCVMAXUtils(object): :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( @@ -1440,11 +1453,11 @@ class EMCVMAXUtils(object): 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( @@ -1463,7 +1476,7 @@ class EMCVMAXUtils(object): :param conn: the connection to the ecom server :param arrayName: the array name - :returns: firmwareVersion (String) + :returns: string -- firmwareVersion """ firmwareVersion = None softwareIdentities = conn.EnumerateInstanceNames( @@ -1487,7 +1500,8 @@ class EMCVMAXUtils(object): :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 @@ -1547,7 +1561,8 @@ class EMCVMAXUtils(object): :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( @@ -1578,7 +1593,8 @@ class EMCVMAXUtils(object): :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( @@ -1604,8 +1620,10 @@ class EMCVMAXUtils(object): 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( @@ -1633,7 +1651,7 @@ class EMCVMAXUtils(object): :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 ( @@ -1647,7 +1665,7 @@ class EMCVMAXUtils(object): :param slo: Service Level Object e.g bronze :param workload: workload e.g DSS - :returns: true/false + :returns: boolean """ isValidSLO = False isValidWorkload = False @@ -1718,6 +1736,7 @@ class EMCVMAXUtils(object): 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 """ @@ -1739,6 +1758,7 @@ class EMCVMAXUtils(object): 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 """ @@ -1752,6 +1772,7 @@ class EMCVMAXUtils(object): 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 """