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:

‘True’, ‘False’ or ‘Undetermined’

check_if_volume_is_concatenated(conn, volumeInstance)

Checks if a volume is concatenated or not.

Check underlying CIM_StorageExtent to see if the volume is concatenated or not. If isConcatenated is true then it is a composite If isConcatenated is False and isVolumeComposite is True then

it is a striped
If isConcatenated is False and isVolumeComposite is False then
it has no composite type and we can proceed.
Parameters:
  • conn – the connection information to the ecom server
  • volumeInstance – the volume instance
Returns:

‘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:

spaceConsumed

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:

size1GBs - size2GBs (int)

convert_bits_to_gbs(strBitSize)

Convert Bits(string) to GB(string).

Parameters:strBitSize – string – The size in bits
Returns:gbSize string – The size in GB
convert_gb_to_bits(strGbSize)

Convert GB(string) to bits(string).

Parameters:strGB – string – The size in GB
Returns:strBitsSize string – The size in bits
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:

memberCount - string

Returns:

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

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

find_ip_protocol_endpoint(conn, storageSystemName)

Find the IP protocol endpoint for ISCSI.

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

foundIpAddress

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

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

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

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
  • foundStorageGroup – storage group instance name
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

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
  • storageConfigService – the storage configuration service
Returns:

rc - the return code of the job

Returns:

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:configService[‘SystemName’] - storage system name (String)
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 volume instance

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:compositeType = 2 or 3
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_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_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_hardware_id_instance_names_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:hardwareIdInstanceNames - the list of hardware id instance names
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 ()
  • shortHostName – the short hostName
get_instance_name(classname, bindings)

Get the instance from the classname and bindings.

NOTE: This exists in common too...will be moving it to other file where both common and masking can access it

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

foundVolumeInstance - the volume instance

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_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:

poolInstanceName - 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
  • 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

get_short_protocol_type(protocol)

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

Parameters:protocol – iscsi or fc
Returns:‘I’ or ‘F’
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_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 - the storage group instance name

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

get_volume_size(conn, volumeInstance)

Get the volume size.

ConsumableBlocks * BlockSize

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

volumeSizeOut

get_volume_type_name(volume)

Get the volume type name.

Parameters:volume – the volume dictionary
Returns: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
  • volumeInstance – the volume Instance
Returns:

spaceConsumed

get_volumetype_extraspecs(volume)

Compare the bit sizes to an approximate.

Parameters:volume – the volume dictionary
Returns:extraSpecs - the extra specs
is_volume_bound_to_pool(conn, volumeInstance)

Check if volume is bound to a pool.

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

foundIsSupportsTieringPolicies - true/false

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: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 portGroups and choose one randomly.

Parameters:fileName – the path and name of the file
Returns:portGroupName - the name of the port group chosen
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: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:poolName - the pool 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
wait_for_job_complete(conn, job)

Given the job wait for it to complete.

Parameters:
  • conn – connection to the ecom server
  • job – the job dict
Returns:

rc - 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

Previous topic

The cinder.volume.drivers.emc.emc_vmax_provision Module

Next topic

The cinder.volume.drivers.emc.emc_vnx_cli Module

This Page