The cinder.volume.drivers.emc.emc_vmax_utils Module

class EMCVMAXUtils(prtcl)

Bases: object

Utility class for SMI-S based EMC volume drivers.

This Utility class is for EMC volume drivers based on SMI-S. It supports VMAX arrays.

check_if_volume_is_composite(conn, volumeInstance)

Check if the volume is composite.

Parameters:
  • conn – the connection information to the ecom server
  • volumeInstance – the volume Instance
Returns:

string – ‘True’, ‘False’ or ‘Undetermined’

check_if_volume_is_extendable(conn, volumeInstance)

Checks if a volume is extendable or not.

Check underlying CIM_StorageExtent to see if the volume is concatenated or not. If isConcatenated is true then it is a concatenated and extendable. If isConcatenated is False and isVolumeComposite is True then it is striped and not extendable. If isConcatenated is False and isVolumeComposite is False then it has one member only but is still extendable.

Parameters:
  • conn – the connection information to the ecom server
  • volumeInstance – the volume instance
Returns:

string – ‘True’, ‘False’ or ‘Undetermined’

check_is_volume_bound_to_pool(conn, volumeInstance)

Check the space consumed of a volume.

Parameters:
  • conn – the connection information to the ecom server
  • volumeInstance – the volume Instance
Returns:

string – ‘True’, ‘False’ or ‘Undetermined’

compare_size(size1Str, size2Str)

Compare the bit sizes to an approximate.

Parameters:
  • size1Str – the first bit size (String)
  • size2Str – the second bit size (String)
Returns:

int – size1GBs - size2GBs

convert_bits_to_gbs(strBitSize)

Convert bytes(string) to GB(string).

Parameters:strBitSize – string – The size in bytes
Returns:int – The size in GB
convert_gb_to_bits(strGbSize)

Convert GB(string) to bytes(string).

Parameters:strGB – string – The size in GB
Returns:string – The size in bytes
create_storage_hardwareId_instance_name(conn, hardwareIdManagementService, initiator)

Create storage hardware ID instance name based on the WWPN/IQN.

Parameters:
  • conn – connection to the ecom server
  • hardwareIdManagementService – the hardware ID management service
  • initiator – initiator(IQN or WWPN) to create the hardware ID instance
Returns:

hardwareIdList

determine_member_count(sizeStr, memberCount, compositeType)

Determines how many members a volume should contain.

Based on the size of the proposed volume, the compositeType and the memberCount, determine (or validate) how many meta members there should be in a volume.

Parameters:
  • sizeStr – the size in GBs of the proposed volume
  • memberCount – the initial member count
  • compositeType – the composite type
Returns:

string – memberCount

Returns:

string – errorDesc - the error description

find_controller_configuration_service(conn, storageSystemName)

Get the controller config by using the storage service name.

Given the storage system name, get the controller configuration service.

Parameters:
  • conn – connection to the ecom server
  • storageSystemName – the storage system name
Returns:

foundconfigService

Raises:

VolumeBackendAPIException

find_element_composition_service(conn, storageSystemName)

Given the storage system name, get the element composition service.

Parameters:
  • conn – the connection to the ecom server
  • storageSystemName – the storage system name
Returns:

foundElementCompositionService

Raises:

VolumeBackendAPIException

find_group_sync_rg_by_target(conn, storageSystem, targetRgInstanceName, waitforsync=True)

Find the SE_GroupSynchronized_RG_RG instance name by target group.

Parameters:
  • conn – connection to the ecom server
  • storageSystem – the storage system name
  • targetRgInstanceName – target group instance name
  • waitforsync – wait for synchronization to complete
Returns:

foundSyncInstanceName

find_replication_service(conn, storageSystemName)

Given the storage system name, get the replication service.

Parameters:
  • conn – the connection to the ecom server
  • storageSystemName – the storage system name
Returns:

foundRepService

Raises:

VolumeBackendAPIException

find_replication_service_capabilities(conn, storageSystemName)

Find the replication service capabilities instance name.

Parameters:
  • conn – the connection to the ecom server
  • storageSystemName – the storage system name
Returns:

foundRepServCapability

find_storageSystem(conn, arrayStr)

Find an array instance name given the array name.

Parameters:
  • conn – the ecom connection
  • arrayStr – the array Serial number (string)
Returns:

foundPoolInstanceName, the CIM Instance Name of the Pool

Raises:

VolumeBackendAPIException

find_storage_configuration_service(conn, storageSystemName)

Given the storage system name, get the storage configuration service.

Parameters:
  • conn – connection to the ecom server
  • storageSystemName – the storage system name
Returns:

foundConfigService

Raises:

VolumeBackendAPIException

find_storage_hardwareid_service(conn, storageSystemName)

Given the storage system name, get the storage hardware service.

Parameters:
  • conn – the connection to the ecom server
  • storageSystemName – the storage system name
Returns:

foundStorageRelocationService

Raises:

VolumeBackendAPIException

find_storage_masking_group(conn, controllerConfigService, storageGroupName)

Given the storage group name get the storage group.

Parameters:
  • conn – connection to the ecom server
  • controllerConfigService – the controllerConfigService
  • storageGroupName – the name of the storage group you are getting
Returns:

foundStorageMaskingGroupInstanceName

find_storage_relocation_service(conn, storageSystemName)

Given the storage system name, get the storage relocation service.

Parameters:
  • conn – the connection to the ecom server
  • storageSystemName – the storage system name
Returns:

foundStorageRelocationService

Raises:

VolumeBackendAPIException

find_storage_system(conn, configService)

Finds the storage system for a particular config service.

Given the storage configuration service get the CIM_StorageSystem from it.

Parameters:
  • conn – the connection to the ecom server
  • configService – the storage configuration service
Returns:

int – rc - the return code of the job

Returns:

dict – jobDict - the job dict

find_storage_system_name_from_service(configService)

Given any service get the storage system name from it.

Parameters:configService – the configuration service
Returns:string – configService[‘SystemName’] - storage system name
find_sync_sv_by_target(conn, storageSystem, target, waitforsync=True)

Find the storage synchronized name by target device ID.

Parameters:
  • conn – connection to the ecom server
  • storageSystem – the storage system name
  • target – target volume object
  • waitforsync – wait for the synchronization to complete if True
Returns:

foundSyncInstanceName

find_volume_instance(conn, volumeDict, volumeName)

Given the volumeDict get the instance from it.

Parameters:
  • conn – connection to the ecom server
  • volumeDict – the volume Dict
  • volumeName – the user friendly name of the volume
Returns:

foundVolumeInstance - the found volume instance

get_array(host)

Extract the array from the host capabilites.

Parameters:host – the host object
Returns:storageSystem - storage system represents the array
get_assoc_pool_from_volume(conn, volumeInstanceName)

Give the volume instance get the associated pool instance

Parameters:
  • conn – connection to the ecom server
  • volumeInstanceName – the volume instance name
Returns:

foundPoolInstanceName

get_composite_type(compositeTypeStr)

Get the int value of composite type.

The default is ‘2’ concatenated.

Parameters:compositeTypeStr – ‘concatenated’ or ‘striped’. Cannot be None
Returns:int – compositeType = 2 for concatenated, or 3 for striped
get_ecom_cred(filename)

Given the filename get the ecomUser and ecomPasswd.

Parameters:filename – the path and filename of the emc configuration file
Returns:ecomUser - the ecom user
Returns:ecomPasswd - the ecom password
get_ecom_cred_SSL(filename)

Given the filename get the ecomUser and ecomPasswd.

Parameters:filename – the path and filename of the emc configuration file
Returns:string – ecomUseSSL
Returns:string – ecomCACert
Returns:string – ecomNoVerification
get_ecom_server(filename)

Given the file name get the ecomPort and ecomIP from it.

Parameters:filename – the path and file name of the emc configuration file
Returns:ecomIp - the ecom IP address
Returns:ecomPort - the ecom port
get_existing_instance(conn, instanceName)

Check that the instance name still exists and return the instance.

Parameters:
  • conn – the connection to the ecom server
  • instanceName – the instanceName to be checked
Returns:

instance or None

get_extra_specs_by_volume_type_name(volumeTypeName)

Gets the extra specs associated with a volume type.

Given the string value of the volume type name, get the extra specs object associated with the volume type.

Parameters:volumeTypeName – string value of the volume type name
Returns:extra_specs - extra specs object
get_firmware_version(conn, arrayName)

Get the firmware version of array.

Parameters:
  • conn – the connection to the ecom server
  • arrayName – the array name
Returns:

string – firmwareVersion

get_hardware_id_instances_from_array(conn, hardwareIdManagementService)

Get all the hardware ids from an array.

Parameters:conn – connection to the ecom server
Param:hardwareIdManagementService - hardware id management service
Returns:hardwareIdInstances - the list of hardware id instances
get_host_short_name(hostName)

Returns the short name for a given qualified host name.

Checks the host name to see if it is the fully qualified host name and returns part before the dot. If there is no dot in the hostName the full hostName is returned.

Parameters:hostName – the fully qualified host name ()
Returns:string – the short hostName
get_instance_name(classname, bindings)

Get the instance from the classname and bindings.

Parameters:
  • classname – class name for the volume instance
  • bindings – volume created from job
Returns:

pywbem.CIMInstanceName – instanceName

get_meta_members_capacity_in_bit(conn, volumeInstanceNames)

Get the capacity in bits of all meta device member volumes.

Parameters:
  • conn – the ecom connection
  • volumeInstanceNames – array contains meta device member volumes
Returns:

array contains capacities of each member device in bits

get_meta_members_of_composite_volume(conn, metaHeadInstanceName)

Get the member volumes of a composite volume.

Parameters:
  • conn – the ecom connection
  • metaHeadInstanceName – head of the composite volume
Returns:

an array containing instance names of member volumes

get_num(numStr, datatype)

Get the ecom int from the number.

Parameters:
  • numStr – the number in string format
  • datatype – the type to convert it to
Returns:

result

get_pool_and_system_name_v2(conn, storageSystemInstanceName, poolNameInStr)

Get pool instance and system name string for V2.

Parameters:
  • conn – the connection to the ecom server
  • storageSystemInstanceName – the storage system instance name
  • poolNameInStr – the pool name
Returns:

foundPoolInstanceName

Returns:

string – systemNameStr

get_pool_and_system_name_v3(conn, storageSystemInstanceName, poolNameInStr)

Get pool instance and system name string for V2.

Parameters:
  • conn – the connection to the ecom server
  • storageSystemInstanceName – the storage system instance name
  • poolNameInStr – the pool name
Returns:

foundPoolInstanceName

Returns:

string – systemNameStr

get_pool_by_name(conn, storagePoolName, storageSystemName)

Returns the instance name associated with a storage pool name.

Parameters:
  • conn – connection to the ecom server
  • storagePoolName – string value of the storage pool name
  • storageSystemName – string value of array
Returns:

foundPoolInstanceName - instance name of storage pool

get_pool_capacities(conn, poolName, storageSystemName)

Get the total and remaining capacity in GB for a storage pool.

Given the storage pool name, get the total capacity and remaining capacity in GB.

Parameters:
  • conn – connection to the ecom server
  • poolName – string value of the storage pool name
  • storageSystemName – the storage system name
Returns:

tuple – (total_capacity_gb, free_capacity_gb)

get_short_protocol_type(protocol)

Given the protocol type, return I for iscsi and F for fc.

Parameters:protocol – iscsi or fc
Returns:string – ‘I’ for iscsi or ‘F’ for fc
get_space_consumed(conn, volumeInstance)

Check the space consumed of a volume.

Parameters:
  • conn – the connection information to the ecom server
  • volumeInstance – the volume Instance
Returns:

spaceConsumed

get_srp_pool_stats(conn, arrayName, poolName)

Get the totalManagedSpace, remainingManagedSpace.

Parameters:
  • conn – the connection to the ecom server
  • arrayName – the array name
  • poolName – the pool name
Returns:

totalCapacityGb

Returns:

remainingCapacityGb

get_storage_group_from_volume(conn, volumeInstanceName)

Returns the storage group for a particular volume.

Given the volume instance name get the associated storage group if it is belong to one.

Parameters:
  • conn – connection to the ecom server
  • volumeInstanceName – the volume instance name
Returns:

foundStorageGroupInstanceName

get_tier_policy_service(conn, storageSystemInstanceName)

Gets the tier policy service for a given storage system instance.

Given the storage system instance name, get the existing tier policy service.

Parameters:
  • conn – the connection information to the ecom server
  • storageSystemInstanceName – the storageSystem instance Name
Returns:

foundTierPolicyService - the tier policy service instance name

Raises:

VolumeBackendAPIException

get_time_delta(startTime, endTime)

Get the delta between start and end time.

Parameters:
  • startTime – the start time
  • endTime – the end time
Returns:

string – delta in string H:MM:SS

get_v3_storage_group_name(poolName, slo, workload)

Determine default v3 storage group from extraSpecs.

Parameters:
  • poolName – the poolName
  • slo – the SLO string e.g Bronze
  • workload – the workload string e.g DSS
Returns:

storageGroupName

get_volume_meta_head(conn, volumeInstanceName)

Get the head of a meta volume.

Parameters:
  • conn – the ecom connection
  • volumeInstanceName – the composite volume instance name
Returns:

the instance name of the meta volume head

get_volume_size(conn, volumeInstance)

Get the volume size which is ConsumableBlocks * BlockSize.

Parameters:
  • conn – the connection information to the ecom server
  • volumeInstance – the volume Instance
Returns:

string – volumeSizeOut

get_volume_type_name(volume)

Get the volume type name.

Parameters:volume – the volume dictionary
Returns:string – volumeTypeName - the volume type name
get_volumes_from_pool(conn, poolInstanceName)

Check the space consumed of a volume.

Parameters:
  • conn – the connection information to the ecom server
  • poolInstanceName – the pool instance name
Returns:

the volumes in the pool

get_volumetype_extraspecs(volume, volumeTypeId=None)

Compare the bit sizes to an approximate.

Parameters:
  • volume – the volume dictionary
  • volumeTypeId – Optional override for volume[‘volume_type_id’]
Returns:

dict – extraSpecs - the extra specs

isArrayV3(conn, arrayName)

Check if the array is V2 or V3.

Parameters:
  • conn – the connection to the ecom server
  • arrayName – the array name
Returns:

boolean

is_clone_licensed(conn, capabilityInstanceName)

Check if the clone feature is licensed and enabled.

Parameters:
  • conn – the connection to the ecom server
  • capabilityInstanceName – the replication service capabilities

instance name :returns: True if licensed and enabled; False otherwise.

is_in_range(volumeSize, maximumVolumeSize, minimumVolumeSize)

Check that volumeSize is in range.

Parameters:
  • volumeSize – volume size
  • maximumVolumeSize – the max volume size
  • minimumVolumeSize – the min volume size
Returns:

boolean

is_volume_bound_to_pool(conn, volumeInstance)

Check if volume is bound to a pool.

Parameters:
  • conn – the connection information to the ecom server
  • volumeInstance – the volume instance
Returns:

string – ‘True’ ‘False’ or ‘Undetermined’

parse_array_name_from_file(fileName)

Parse the array name from config file.

If it is not there then there should only be one array configured to the ecom. If there is more than one then erroneous results can occur.

Parameters:fileName – the path and name of the file
Returns:string – arrayName - the array name
parse_fast_policy_name_from_file(fileName)

Parse the fast policy name from config file.

If it is not there, then NON FAST is assumed.

Parameters:fileName – the path and name of the file
Returns:fastPolicyName - the fast policy name
parse_file_to_get_port_group_name(fileName)

Parses a file and chooses a port group randomly.

Given a file, parse it to get all the possible portGroupElements and choose one randomly.

Parameters:fileName – the path and name of the file
Returns:string – portGroupName - the name of the port group chosen
Raises:VolumeBackendAPIException
parse_interval_from_file(fileName)

Parse the interval from config file.

If it is not there then the default will be used.

Parameters:fileName – the path and name of the file
Returns:interval - the interval in seconds
parse_pool_instance_id(poolInstanceId)

Given the instance Id parse the pool name and system name from it.

Example of pool InstanceId: Symmetrix+0001233455555+U+Pool 0

Parameters:poolInstanceId – the path and name of the file
Returns:string – poolName - the pool name
Returns:string – systemName - the system name
parse_pool_instance_id_v3(poolInstanceId)

Given the instance Id parse the pool name and system name from it.

Example of pool InstanceId: Symmetrix+0001233455555+U+Pool 0

Parameters:poolInstanceId – the path and name of the file
Returns:poolName - the pool name
Returns:systemName - the system name
parse_pool_name_from_file(fileName)

Parse the pool name from config file.

If it is not there then we will attempt to get it from extra specs.

Parameters:fileName – the path and name of the file
Returns:string – poolName - the pool name
parse_retries_from_file(fileName)

Parse the retries from config file.

If it is not there then the default will be used.

Parameters:fileName – the path and name of the file
Returns:retries - the max number of retries
parse_slo_from_file(fileName)

Parse the slo from config file.

Please note that the string ‘NONE’ is returned if it is not found.

Parameters:fileName – the path and name of the file
Returns:string – the slo or ‘NONE’
parse_volume_type_from_filename(emcConfigFile)

Parse the volume type from the file (if it exists).

Parameters:emcConfigFile – the EMC configuration file
Returns:volumeTypeName - the volume type name
parse_workload_from_file(fileName)

Parse the workload from config file.

Please note that the string ‘NONE’ is returned if it is not found.

Parameters:fileName – the path and name of the file
Returns:string – the workload or ‘NONE’
populate_cgsnapshot_status(context, db, cgsnapshot_id, status='available')

Update cgsnapshot status in the cinder database.

Parameters:
  • context – the context
  • db – cinder database
  • cgsnapshot_id – cgsnapshot id
  • status – string value reflects the status of the member snapshot
Returns:

snapshots - updated snapshots

process_exception_args(arg, instanceName)

Process exception arguments.

Parameters:
  • arg – the arg list
  • instanceName – the instance name
Returns:

None

Raises:

VolumeBackendAPIException

strip_short_host_name(storageGroupName)
truncate_string(strToTruncate, maxNum)

Truncate a string by taking first and last characters.

Parameters:
  • strToTruncate – the string to be truncated
  • maxNum – the maximum number of characters
Returns:

string – truncated string or original string

verify_slo_workload(slo, workload)

Check if SLO and workload values are valid.

Parameters:
  • slo – Service Level Object e.g bronze
  • workload – workload e.g DSS
Returns:

boolean

wait_for_job_complete(conn, job, extraSpecs=None)

Given the job wait for it to complete.

Parameters:
  • conn – connection to the ecom server
  • job – the job dict
  • extraSpecs – the extraSpecs dict. Defaults to None
Returns:

int – the return code

Returns:

errorDesc - the error description string

wait_for_sync(conn, syncName)

Given the sync name wait for it to fully synchronize.

Parameters:
  • conn – connection to the ecom server
  • syncName – the syncName
Raises:

loopingcall.LoopingCallDone

Raises:

VolumeBackendAPIException

wrap_get_storage_group_from_volume(conn, volumeInstanceName)

Unit test aid

Previous topic

The cinder.volume.drivers.emc.emc_vmax_provision_v3 Module

Next topic

The cinder.volume.drivers.emc.emc_vnx_cli Module

This Page