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.

POOL = 'storagetype:pool'
SLO = 'storagetype:slo'
WORKLOAD = 'storagetype:workload'
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_ig_instance_name(conn, initiatorGroupInstanceName)

Check if a given Initiator Group Instance Name has been deleted.

Parameters:
  • conn – the ecom connection
  • initiatorGroupInstanceName – the given IG instance name
Returns:

foundinitiatorGroupInstanceName or None if deleted

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

extract_record(arrayInfo, pool)

Given pool string determine the correct record.

The poolName and the serialNumber will determine the correct record to return in VMAX2. The poolName, SLO and the serialNumber will determine the correct record to return in VMAX3.

Parameters:
  • arrayInfo – list of records
  • pool – e.g ‘SATA_BRONZE1+000198700439’ ‘SRP_1+Bronze+000198700555’
Returns:

single record

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, extraSpecs, 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
  • extraSpecs – the extraSpecs dict
  • 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 by 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)

Get storage configuration service with given storage system name.

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, extraSpecs, 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
  • extraSpecs – the extraSpecs dict
  • waitforsync – wait for the synchronization to complete if True
Returns:

foundSyncInstanceName

find_volume_by_device_id_on_array(conn, storageSystem, deviceID)

Find the volume by device ID on a specific array.

Parameters:
  • conn – connection to the ecom server
  • storageSystem – the storage system name
  • deviceID – string value of the volume device ID
Returns:

foundVolumeInstanceName

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

generate_unique_trunc_fastpolicy(fastPolicyName)

Create a unique fast policy name under 14 chars

Parameters:fastPolicyName – long fast policy name
Returns:truncated fast policy name
generate_unique_trunc_host(hostName)

Create a unique short host name under 40 chars

Parameters:sgName – long storage group name
Returns:truncated storage group name
generate_unique_trunc_pool(poolName)

Create a unique pool name under 16 chars

Parameters:poolName – long pool name
Returns:truncated pool name
get_array(host)

Extract the array from the host capabilites.

Parameters:host – the host object
Returns:storageSystem - storage system represents the array
get_array_and_device_id(volume, external_ref)

Helper function for manage volume to get array name and device ID.

Parameters:
  • volume – volume object from API
  • external_ref – the existing volume object to be manged
Returns:

string value of the array name and device ID

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_associated_replication_from_source_volume(conn, storageSystem, sourceDeviceId)

Get associated replication from source volume.

Given the source volume device ID, find associated replication storage synchronized instance names.

Parameters:
  • conn – connection to the ecom server
  • storageSystem – the storage system name
  • source – target volume object
Returns:

foundSyncName (String)

get_composite_elements(conn, volumeInstance)

Get the meta members of a composite volume.

Parameters:
  • conn – ECOM connection
  • volumeInstance – the volume instance
Returns memberVolumes:
 

a list of meta members

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_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_ip_protocol_endpoints(conn, tcpendpointinstancename)

Get the ip protocol endpoints associated with an tcp endpoint

Parameters:
  • conn – the ecom connection
  • tcpendpointinstancename – the tcp endpoint instance name
Returns:

ipendpoints

get_iscsi_ip_address(conn, ipendpointinstancename)

Get the IPv4Address from the ip endpoint instance name

Parameters:
  • conn – the ecom connection
  • ipendpointinstancename – the ip endpoint instance name
Returns:

foundIpAddress

get_iscsi_protocol_endpoints(conn, portgroupinstancename)

Get the iscsi protocol endpoints of a port group.

Parameters:
  • conn – the ecom connection
  • portgroupinstancename – the portgroup instance name
Returns:

iscsiendpoints

get_meta_members_capacity_in_byte(conn, volumeInstanceNames)

Get the capacity in byte 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_pool_name(conn, poolInstanceName)

Get the pool name from the instance

Parameters:
  • conn – the ecom connection
  • poolInstanceName – the pool instance
Returns:

poolnameStr

get_protocol_controller(conn, hardwareinstancename)

Get the front end protocol endpoints of a hardware instance

Parameters:
  • conn – the ecom connection
  • hardwareinstancename – the hardware instance name
Returns:

protocolControllerInstanceName

Raises:

VolumeBackendAPIException

get_replication_setting_data(conn, repServiceInstanceName, replication_type, extraSpecs)

Get the replication setting data

Parameters:
  • conn – connection the ecom server
  • repServiceInstanceName – the storage group instance name
  • replication_type – the replication type
  • copy_methodology – the copy methodology
Returns:

instance rsdInstance

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

Get the SMI_S version.

Parameters:conn – the connection to the ecom server
Returns:string – version
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, sgName)

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
  • sgName – the storage group name
Returns:

foundStorageGroupInstanceName

get_storage_groups_from_volume(conn, volumeInstanceName)

Returns all the storage group for a particular volume.

Given the volume instance name get all the associated storage groups.

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

foundStorageGroupInstanceName

get_target_endpoints(conn, hardwareId)

Given the hardwareId get the target endpoints.

Parameters:
  • conn – the connection to the ecom server
  • hardwareId – the hardware Id
Returns:

targetEndpoints

Raises:

VolumeBackendAPIException

get_tcp_protocol_endpoints(conn, iscsiendpointinstancename)

Get the tcp protocol endpoints associated with an iscsi endpoint

Parameters:
  • conn – the ecom connection
  • iscsiendpointinstancename – the iscsi endpoint instance name
Returns:

tcpendpoints

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_default_sg_instance_name(conn, poolName, slo, workload, storageSystemName)

Get the V3 default instance name

Parameters:
  • conn – the connection to the ecom server
  • poolName – the pool name
  • slo – the SLO
  • workload – the workload
  • storageSystemName – the storage system name
Returns:

the storage group instance name

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

Get volume element name follows naming convention, i.e. ‘OS-UUID’.

Parameters:volumeId – volume id containing uuid
Returns:volume element name in format of OS-UUID
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_model_updates(context, volumes, cgId, status='available')

Update the volume model’s status and return it.

Parameters:
  • context – the context
  • volumes – volumes object api
  • cgId – cg id
  • status – string value reflects the status of the member volume
Returns:

volume_model_updates - updated volumes

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

Parses a file and gets array map.

Given a file, parse it to get array and any pool(s) or fast policy(s), SLOs, Workloads that might exist.

Parameters:fileName – the path and name of the file
Returns:list
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_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
process_exception_args(arg, instanceName)

Process exception arguments.

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

None

Raises:

VolumeBackendAPIException

rename_volume(conn, volume, newName)

Change the volume ElementName to specified new name.

Parameters:
  • conn – connection to the ecom server
  • volume – the volume instance name or volume instance
  • newName – new ElementName of the volume
Returns:

volumeInstance after rename

set_copy_methodology_in_rsd(conn, repServiceInstanceName, replication_type, copy_methodology, extraSpecs)

Get the replication setting data

Parameters:
  • conn – connection the ecom server
  • repServiceInstanceName – the storage group instance name
  • replication_type – the replication type
  • copy_methodology – the copy methodology
Returns:

instance rsdInstance

set_target_element_supplier_in_rsd(conn, repServiceInstanceName, replication_type, target_type, extraSpecs)

Get the replication setting data

Parameters:
  • conn – connection the ecom server
  • repServiceInstanceName – the storage group instance name
  • replication_type – the replication type
  • target_type – Use existing, Create new, Use and create
Returns:

instance rsdInstance

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, extraSpecs=None)

Given the sync name wait for it to fully synchronize.

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

loopingcall.LoopingCallDone

Raises:

VolumeBackendAPIException

wrap_get_storage_group_from_volume(conn, volumeInstanceName, sgName)

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

Project Source

This Page