cinder.volume.drivers.dell_emc.vmax.utils
Module¶VMAXUtils
¶Bases: object
Utility class for Rest based VMAX volume drivers.
This Utility class is for VMAX volume drivers based on Unisphere Rest API.
add_legacy_pools
(pools)¶Add legacy pools to allow extending a volume after upgrade.
Parameters: | pools – the pool list |
---|---|
Returns: | pools - the updated pool list |
change_compression_type
(is_source_compr_disabled, new_type)¶Check if volume type have different compression types
Parameters: |
|
---|---|
Returns: | boolean |
generate_unique_trunc_host
(host_name)¶Create a unique short host name under 16 characters.
Parameters: | host_name – long host name |
---|---|
Returns: | truncated host name |
get_array_and_device_id
(volume, external_ref)¶Helper function for manage volume to get array name and device ID.
Parameters: |
|
---|---|
Returns: | string value of the array name and device ID |
get_default_oversubscription_ratio
(max_over_sub_ratio)¶Override ratio if necessary.
The over subscription ratio will be overridden if the user supplied max oversubscription ratio is less than 1. :param max_over_sub_ratio: user supplied over subscription ratio :returns: max_over_sub_ratio
get_default_storage_group_name
(srp_name, slo, workload, is_compression_disabled=False, is_re=False)¶Determine default storage group from extra_specs.
Parameters: |
|
---|---|
Returns: | storage_group_name |
get_host_short_name
(host_name)¶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 host name the full host name is returned. :param host_name: the fully qualified host name :returns: string – the short host_name
get_intervals_retries_dict
(interval, retries)¶Get the default intervals and retries.
Parameters: |
|
---|---|
Returns: | default_dict |
get_pg_short_name
(portgroup_name)¶Create a unique port group name under 12 characters.
Parameters: | portgroup_name – long portgroup_name |
---|---|
Returns: | truncated portgroup_name |
get_replication_config
(rep_device_list)¶Gather necessary replication configuration info.
Parameters: | rep_device_list – the replication device list from cinder.conf |
---|---|
Returns: | rep_config, replication configuration dict |
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_temp_snap_name
(clone_name, source_device_id)¶Construct a temporary snapshot name for clone operation.
Parameters: |
|
---|---|
Returns: | snap_name |
get_time_delta
(start_time, end_time)¶Get the delta between start and end time.
Parameters: |
|
---|---|
Returns: | string – delta in string H:MM:SS |
get_volume_element_name
(volume_id)¶Get volume element name follows naming convention, i.e. ‘OS-UUID’.
Parameters: | volume_id – Openstack volume ID containing uuid |
---|---|
Returns: | volume element name in format of OS-UUID |
get_volume_group_utils
(group, interval, retries)¶Standard utility for generic volume groups.
Parameters: |
|
---|---|
Returns: | array, extra specs dict list |
Raises: | VolumeBackendAPIException |
get_volumetype_extra_specs
(volume, volume_type_id=None)¶Gets the extra specs associated with a volume type.
Parameters: |
|
---|---|
Returns: | dict – extra_specs - the extra specs |
Raises: | VolumeBackendAPIException |
is_compression_disabled
(extra_specs)¶Check is compression is to be disabled.
Parameters: | extra_specs – extra specifications |
---|---|
Returns: | boolean |
is_replication_enabled
(extra_specs)¶Check if replication is to be enabled.
Parameters: | extra_specs – extra specifications |
---|---|
Returns: | bool - true if enabled, else false |
is_volume_failed_over
(volume)¶Check if a volume has been failed over.
Parameters: | volume – the volume object |
---|---|
Returns: | bool |
parse_file_to_get_array_map
(file_name)¶Parses a file and gets array map.
Given a file, parse it to get array and pool(srp).
<EMC>
<RestServerIp>10.108.246.202</RestServerIp>
<RestServerPort>8443</RestServerPort>
<RestUserName>smc</RestUserName>
<RestPassword>smc</RestPassword>
<SSLCert>/path/client.cert</SSLCert>
<SSLVerify>/path/to/certfile.pem</SSLVerify>
<PortGroups>
<PortGroup>OS-PORTGROUP1-PG</PortGroup>
</PortGroups>
<Array>000198700439</Array>
<SRP>SRP_1</SRP>
</EMC>
Parameters: | file_name – the configuration file |
---|---|
Returns: | list |
truncate_string
(str_to_truncate, max_num)¶Truncate a string by taking first and last characters.
Parameters: |
|
---|---|
Returns: | string – truncated string or original string |
update_admin_metadata
(volumes_model_update, key, values)¶Update the volume_model_updates with admin metadata.
Parameters: |
|
---|
update_extra_specs
(extraspecs)¶Update extra specs.
Parameters: | extraspecs – the additional info |
---|---|
Returns: | extraspecs |
update_volume_group_name
(group)¶Format id and name consistency group.
Parameters: | group – the generic volume group object |
---|---|
Returns: | group_name – formatted name + id |
update_volume_model_updates
(volume_model_updates, volumes, group_id, status='available')¶Update the volume model’s status and return it.
Parameters: |
|
---|---|
Returns: | volume_model_updates - updated volumes |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.