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 |
check_rep_status_enabled
(group)¶Check replication status for group.
Group status must be enabled before proceeding with certain operations.
Parameters: | group – the group object |
---|---|
Raises: | InvalidInput |
check_replication_matched
(volume, extra_specs)¶Check volume type and group type.
This will make sure they do not conflict with each other.
Parameters: |
|
---|---|
Raises: | InvalidInput |
does_vol_need_rdf_management_group
(extra_specs)¶Determine if a volume is a Metro or Async.
Parameters: | extra_specs – the extra specifications |
---|---|
Returns: | bool |
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_async_rdf_managed_grp_name
(rep_config)¶Get the name of the group used for async replication management.
Parameters: | rep_config – the replication configuration |
---|---|
Returns: | group name |
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, rep_mode=None)¶Determine default storage group from extra_specs.
Parameters: |
|
---|---|
Returns: | storage_group_name |
get_grp_volume_model_update
(volume, volume_dict, group_id)¶Create and return the volume model update on creation.
Parameters: |
|
---|---|
Returns: | model_update |
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_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_replication_prefix
(rep_mode)¶Get the replication prefix.
Replication prefix for storage group naming is based on whether it is synchronous, asynchronous, or metro replication mode.
Parameters: | rep_mode – flag to indicate if replication is async |
---|---|
Returns: | prefix |
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, intervals_retries_dict |
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_metro_device
(rep_config, extra_specs)¶Determine if a volume is a Metro enabled device.
Parameters: |
|
---|---|
Returns: | bool |
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 |
modify_snapshot_prefix
(snapshot_name, manage=False, unmanage=False)¶Modify a Snapshot prefix on VMAX backend.
Prepare a snapshot name for manage/unmanage snapshot process either by adding or removing ‘OS-‘ prefix.
Parameters: |
|
---|---|
Returns: | snapshot name ready for backend VMAX assignment |
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_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.