The cinder.volume.drivers.dell_emc.vmax.rest Module

The cinder.volume.drivers.dell_emc.vmax.rest Module

class VMAXRest

Bases: object

Rest class based on Unisphere for VMAX Rest API.

add_child_sg_to_parent_sg(array, child_sg, parent_sg, extra_specs)

Add a storage group to a parent storage group.

This method adds an existing storage group to another storage group, i.e. cascaded storage groups. :param array: the array serial number :param child_sg: the name of the child sg :param parent_sg: the name of the parent sg :param extra_specs: the extra specifications

add_empty_child_sg_to_parent_sg(array, child_sg, parent_sg, extra_specs)

Add an empty storage group to a parent storage group.

This method adds an existing storage group to another storage group, i.e. cascaded storage groups. :param array: the array serial number :param child_sg: the name of the child sg :param parent_sg: the name of the parent sg :param extra_specs: the extra specifications

add_vol_to_sg(array, storagegroup_name, device_id, extra_specs)

Add a volume to a storage group.

Parameters:
  • array – the array serial number
  • storagegroup_name – storage group name
  • device_id – the device id
  • extra_specs – extra specifications
are_vols_rdf_paired(array, remote_array, device_id, target_device)

Check if a pair of volumes are RDF paired.

Parameters:
  • array – the array serial number
  • remote_array – the remote array serial number
  • device_id – the device id
  • target_device – the target device id
Returns:

paired – bool, local_vol_state, rdf_pair_state

static check_status_code_success(operation, status_code, message)

Check if a status code indicates success.

Parameters:
  • operation – the operation
  • status_code – the status code
  • message – the server response
Raises:

VolumeBackendAPIException

check_volume_device_id(array, device_id, volume_id, name_id=None)

Check if the identifiers match for a given volume.

Parameters:
  • array – the array serial number
  • device_id – the device id
  • volume_id – cinder volume id
  • name_id – name id - used in host_assisted migration, optional
Returns:

found_device_id

create_initiator_group(array, init_group_name, init_list, extra_specs)

Create a new initiator group containing the given initiators.

Parameters:
  • array – the array serial number
  • init_group_name – the initiator group name
  • init_list – the list of initiators
  • extra_specs – extra specifications
create_masking_view(array, maskingview_name, storagegroup_name, port_group_name, init_group_name, extra_specs)

Create a new masking view.

Parameters:
  • array – the array serial number
  • maskingview_name – the masking view name
  • storagegroup_name – the storage group name
  • port_group_name – the port group
  • init_group_name – the initiator group
  • extra_specs – extra specifications
create_rdf_device_pair(array, device_id, rdf_group_no, target_device, remote_array, extra_specs)

Create an RDF pairing.

Create a remote replication relationship between source and target devices. :param array: the array serial number :param device_id: the device id :param rdf_group_no: the rdf group number :param target_device: the target device id :param remote_array: the remote array serial :param extra_specs: the extra specs :returns: rdf_dict

create_resource(array, category, resource_type, payload, private='')

Create a provisioning resource.

Parameters:
  • array – the array serial number
  • category – the category
  • resource_type – the resource type
  • payload – the payload
  • private – empty string or ‘/private’ if private url
Returns:

status_code – int, message – string, server response

create_storage_group(array, storagegroup_name, srp, slo, workload, extra_specs, do_disable_compression=False)

Create the volume in the specified storage group.

Parameters:
  • array – the array serial number
  • storagegroup_name – the group name (String)
  • srp – the SRP (String)
  • slo – the SLO (String)
  • workload – the workload (String)
  • do_disable_compression – flag for disabling compression
  • extra_specs – additional info
Returns:

storagegroup_name - string

create_storagegroup_snap(array, source_group, snap_name, extra_specs)

Create a snapVx snapshot of a storage group.

Parameters:
  • array – the array serial number
  • source_group – the source group name
  • snap_name – the name of the snapshot
  • extra_specs – the extra specifications
create_volume_from_sg(array, volume_name, storagegroup_name, volume_size, extra_specs)

Create a new volume in the given storage group.

Parameters:
  • array – the array serial number
  • volume_name – the volume name (String)
  • storagegroup_name – the storage group name
  • volume_size – volume size (String)
  • extra_specs – the extra specifications
Returns:

dict – volume_dict - the volume dict

Raises:

VolumeBackendAPIException

create_volume_snap(array, snap_name, device_id, extra_specs)

Create a snapVx snapshot of a volume.

Parameters:
  • array – the array serial number
  • snap_name – the name of the snapshot
  • device_id – the source device id
  • extra_specs – the extra specifications
delete_initiator_group(array, initiatorgroup_name)

Delete an initiator group.

Parameters:
  • array – the array serial number
  • initiatorgroup_name – initiator group name
delete_masking_view(array, maskingview_name)

Delete a masking view.

Parameters:
  • array – the array serial number
  • maskingview_name – the masking view name
delete_rdf_pair(array, device_id, rdf_group)

Delete an rdf pair.

Parameters:
  • array – the array serial number
  • device_id – the device id
  • rdf_group – the rdf group
delete_resource(array, category, resource_type, resource_name, payload=None, private='', params=None)

Delete a provisioning resource.

Parameters:
  • array – the array serial number
  • category – the resource category e.g. sloprovisioning
  • resource_type – the type of resource to be deleted
  • resource_name – the name of the resource to be deleted
  • payload – the payload, optional
  • private – empty string or ‘/private’ if private url
  • params – dict of optional query params
delete_storage_group(array, storagegroup_name)

Delete a storage group.

Parameters:
  • array – the array serial number
  • storagegroup_name – storage group name
delete_storagegroup_rdf(array, storagegroup_name, rdf_group_num)

Delete the rdf pairs for a storage group.

Parameters:
  • array – the array serial number
  • storagegroup_name – the name of the storage group
  • rdf_group_num – the number of the rdf group
delete_volume(array, device_id)

Deallocate or delete a volume.

Parameters:
  • array – the array serial number
  • device_id – volume device id
delete_volume_snap(array, snap_name, source_device_ids, restored=False)

Delete the snapshot of a volume or volumes.

Parameters:
  • array – the array serial number
  • snap_name – the name of the snapshot
  • source_device_ids – the source device ids
  • restored – Flag to indicate terminate restore session
extend_volume(array, device_id, new_size, extra_specs)

Extend a VMAX volume.

Parameters:
  • array – the array serial number
  • device_id – volume device id
  • new_size – the new required size for the device
  • extra_specs – the extra specifications
find_mv_connections_for_vol(array, maskingview, device_id)

Find the host_lun_id for a volume in a masking view.

Parameters:
  • array – the array serial number
  • maskingview – the masking view name
  • device_id – the device ID
Returns:

host_lun_id – int

find_snap_vx_sessions(array, device_id, tgt_only=False)

Find all snapVX sessions for a device (source and target).

Parameters:
  • array – the array serial number
  • device_id – the device id
  • tgt_only – Flag - return only sessions where device is target
Returns:

list of snapshot dicts

find_volume_device_id(array, volume_name)

Given a volume identifier, find the corresponding device_id.

Parameters:
  • array – the array serial number
  • volume_name – the volume name (OS-<UUID>)
Returns:

device_id

find_volume_identifier(array, device_id)

Get the volume identifier of a VMAX volume.

Parameters:
  • array – array serial number
  • device_id – the device id
Returns:

the volume identifier – string

get_array_serial(array)

Get an array from its serial number.

Parameters:array – the array serial number
Returns:array_details – dict or None
get_common_masking_views(array, portgroup_name, ig_name)

Get common masking views for a given portgroup and initiator group.

Parameters:
  • array – the array serial number
  • portgroup_name – the port group name
  • ig_name – the initiator group name
Returns:

masking view list

get_element_from_masking_view(array, maskingview_name, portgroup=False, host=False, storagegroup=False)

Return the name of the specified element from a masking view.

Parameters:
  • array – the array serial number
  • maskingview_name – the masking view name
  • portgroup – the port group name - optional
  • host – the host name - optional
  • storagegroup – the storage group name - optional
Returns:

name of the specified element – string

Raises:

VolumeBackendAPIException

get_in_use_initiator_list_from_array(array)

Get the list of initiators which are in-use from the array.

Gets the list of initiators from the array which are in hosts/ initiator groups. :param array: the array serial number :returns: init_list

get_initiator(array, initiator_id)

Retrieve initiator details from the array.

Parameters:
  • array – the array serial number
  • initiator_id – the initiator id
Returns:

initiator dict, or None

get_initiator_group(array, initiator_group=None, params=None)

Retrieve initiator group details from the array.

Parameters:
  • array – the array serial number
  • initiator_group – the initaitor group name
  • params – optional filter parameters
Returns:

initiator group dict, or None

get_initiator_group_from_initiator(array, initiator)

Given an initiator, get its corresponding initiator group, if any.

Parameters:
  • array – the array serial number
  • initiator – the initiator id
Returns:

found_init_group_name – string

get_initiator_list(array, params=None)

Retrieve initiator list from the array.

Parameters:
  • array – the array serial number
  • params – dict of optional params
Returns:

list of initiators

get_iscsi_ip_address_and_iqn(array, port_id)

Get the IPv4Address from the director port.

Parameters:
  • array – the array serial number
  • port_id – the director port identifier
Returns:

(list of ip_addresses, iqn)

get_masking_view(array, masking_view_name)

Get details of a masking view.

Parameters:
  • array – array serial number
  • masking_view_name – the masking view name
Returns:

masking view dict

get_masking_view_list(array, params)

Get a list of masking views from the array.

Parameters:
  • array – array serial number
  • params – optional GET parameters
Returns:

masking view list

get_masking_views_by_initiator_group(array, initiatorgroup_name)

Given initiator group, retrieve the masking view instance name.

Retrieve the list of masking view instances associated with the given initiator group. :param array: the array serial number :param initiatorgroup_name: the name of the initiator group :returns: list of masking view names

get_masking_views_from_storage_group(array, storagegroup)

Return any masking views associated with a storage group.

Parameters:
  • array – the array serial number
  • storagegroup – the storage group name
Returns:

masking view list

get_metro_payload_info(array, payload, rdf_group_no, extra_specs)

Get the payload details for a metro active create pair.

Parameters:
  • array – the array serial number
  • payload – the payload
  • rdf_group_no – the rdf group number
  • extra_specs – the replication configuration
Returns:

updated payload

get_num_vols_in_sg(array, storage_group_name)

Get the number of volumes in a storage group.

Parameters:
  • array – the array serial number
  • storage_group_name – the storage group name
Returns:

num_vols – int

get_port(array, port_id)

Get director port details.

Parameters:
  • array – the array serial number
  • port_id – the port id
Returns:

port dict, or None

get_port_ids(array, portgroup)

Get a list of port identifiers from a port group.

Parameters:
  • array – the array serial number
  • portgroup – the name of the portgroup
Returns:

list of port ids, e.g. [‘FA-3D:35’, ‘FA-4D:32’]

get_portgroup(array, portgroup)

Get a portgroup from the array.

Parameters:
  • array – array serial number
  • portgroup – the portgroup name
Returns:

portgroup dict or None

get_rdf_group(array, rdf_number)

Get specific rdf group details.

Parameters:
  • array – the array serial number
  • rdf_number – the rdf number
get_rdf_group_list(array)

Get rdf group list from array.

Parameters:array – the array serial number
get_rdf_group_number(array, rdf_group_label)

Given an rdf_group_label, return the associated group number.

Parameters:
  • array – the array serial number
  • rdf_group_label – the group label
Returns:

rdf_group_number

get_rdf_group_volume(array, src_device_id)

Get the RDF details for a volume.

Parameters:
  • array – the array serial number
  • src_device_id – the source device id
Returns:

rdf_session

get_replication_capabilities(array)

Check what replication features are licensed and enabled.

Example return value for this method:

{"symmetrixId": "000197800128",
 "snapVxCapable": true,
 "rdfCapable": true}
Param:array
Returns:capabilities dict for the given array
get_resource(array, category, resource_type, resource_name=None, params=None, private='', version='84')

Get resource details from array.

Parameters:
  • array – the array serial number
  • category – the resource category e.g. sloprovisioning
  • resource_type – the resource type e.g. maskingview
  • resource_name – the name of a specific resource
  • params – query parameters
  • private – empty string or ‘/private’ if private url
  • version – None or specific version number if required
Returns:

resource object – dict or None

get_size_of_device_on_array(array, device_id)

Get the size of the volume from the array.

Parameters:
  • array – the array serial number
  • device_id – the volume device id
Returns:

size – or None

get_slo_list(array)

Retrieve the list of slo’s from the array

Parameters:array – the array serial number
Returns:slo_list – list of service level names
get_snap_linked_device_list(array, source_device_id, snap_name)

Get the list of linked devices for a particular snapVx snapshot.

Parameters:
  • array – the array serial number
  • source_device_id – source device id
  • snap_name – the snapshot name
Returns:

linked_device_list

get_srp_by_name(array, srp=None)

Returns the details of a storage pool.

Parameters:
  • array – the array serial number
  • srp – the storage resource pool name
Returns:

SRP_details – dict or None

get_storage_group(array, storage_group_name)

Given a name, return storage group details.

Parameters:
  • array – the array serial number
  • storage_group_name – the name of the storage group
Returns:

storage group dict or None

get_storage_group_rep(array, storage_group_name)

Given a name, return storage group details wrt replication.

Parameters:
  • array – the array serial number
  • storage_group_name – the name of the storage group
Returns:

storage group dict or None

get_storage_groups_from_volume(array, device_id)

Returns all the storage groups for a particular volume.

Parameters:
  • array – the array serial number
  • device_id – the volume device id
Returns:

storagegroup_list

get_storagegroup_rdf_details(array, storagegroup_name, rdf_group_num)

Get the remote replication details of a storage group.

Parameters:
  • array – the array serial number
  • storagegroup_name – the storage group name
  • rdf_group_num – the rdf group number
get_sync_session(array, source_device_id, snap_name, target_device_id)

Get a particular sync session.

Parameters:
  • array – the array serial number
  • source_device_id – source device id
  • snap_name – the snapshot name
  • target_device_id – the target device id
Returns:

sync session – dict, or None

get_target_wwns(array, portgroup)

Get the director ports’ wwns.

Parameters:
  • array – the array serial number
  • portgroup – portgroup
Returns:

target_wwns – the list of target wwns for the masking view

get_uni_version()

Get the unisphere version from the server.

Returns:version and major_version(e.g. (“V8.4.0.16”, “84”))
get_vmax_default_storage_group(array, srp, slo, workload, do_disable_compression=False, is_re=False, rep_mode=None)

Get the default storage group.

Parameters:
  • array – the array serial number
  • srp – the pool name
  • slo – the SLO
  • workload – the workload
  • do_disable_compression – flag for disabling compression
  • is_re – flag for replication
  • rep_mode – flag to indicate replication mode
Returns:

the storage group dict (or None), the storage group name

get_volume(array, device_id)

Get a VMAX volume from array.

Parameters:
  • array – the array serial number
  • device_id – the volume device id
Returns:

volume dict

Raises:

VolumeBackendAPIException

get_volume_list(array, params)

Get a filtered list of VMAX volumes from array.

Filter parameters are required as the unfiltered volume list could be very large and could affect performance if called often. :param array: the array serial number :param params: filter parameters :returns: device_ids – list

get_volume_snap(array, device_id, snap_name)

Given a volume snap info, retrieve the snapVx object.

Parameters:
  • array – the array serial number
  • device_id – the source volume device id
  • snap_name – the name of the snapshot
Returns:

snapshot dict, or None

get_volume_snap_info(array, source_device_id)

Get snapVx information associated with a volume.

Parameters:
  • array – the array serial number
  • source_device_id – the source volume device ID
Returns:

message – dict, or None

get_volume_snapshot_list(array, source_device_id)

Get a list of snapshot details for a particular volume.

Parameters:
  • array – the array serial number
  • source_device_id – the osurce device id
Returns:

snapshot list or None

get_volumes_in_storage_group(array, storagegroup_name)

Given a volume identifier, find the corresponding device_id.

Parameters:
  • array – the array serial number
  • storagegroup_name – the storage group name
Returns:

volume_list

get_workload_settings(array)

Get valid workload options from array.

Workloads are no longer supported from HyperMaxOS 5978 onwards. :param array: the array serial number :returns: workload_setting – list of workload names

is_child_sg_in_parent_sg(array, child_name, parent_name)

Check if a child storage group is a member of a parent group.

Parameters:
  • array – the array serial number
  • child_name – the child sg name
  • parent_name – the parent sg name
Returns:

bool

is_compression_capable(array)

Check if array is compression capable.

Parameters:array – array serial number
Returns:bool
is_next_gen_array(array)

Check to see if array is a next gen array(ucode 5978 or greater).

Parameters:array – the array serial number
Returns:bool
is_snapvx_licensed(array)

Check if the snapVx feature is licensed and enabled.

Parameters:array – the array serial number
Returns:True if licensed and enabled; False otherwise.
is_sync_complete(array, source_device_id, target_device_id, snap_name, extra_specs)

Check if a sync session is complete.

Parameters:
  • array – the array serial number
  • source_device_id – source device id
  • target_device_id – target device id
  • snap_name – snapshot name
  • extra_specs – extra specifications
Returns:

bool

is_vol_in_rep_session(array, device_id)

Check if a volume is in a replication session.

Parameters:
  • array – the array serial number
  • device_id – the device id
Returns:

snapvx_tgt – bool, snapvx_src – bool, rdf_grp – list or None

is_volume_in_storagegroup(array, device_id, storagegroup)

See if a volume is a member of the given storage group.

Parameters:
  • array – the array serial number
  • device_id – the device id
  • storagegroup – the storage group name
Returns:

bool

modify_rdf_device_pair(array, device_id, rdf_group, extra_specs, suspend=False)

Modify an rdf device pair.

Parameters:
  • array – the array serial number
  • device_id – the device id
  • rdf_group – the rdf group
  • extra_specs – the extra specs
  • suspend – flag to indicate “suspend” action
modify_resource(array, category, resource_type, payload, version='84', resource_name=None, private='')

Modify a resource.

Parameters:
  • version – the uv4 version
  • array – the array serial number
  • category – the category
  • resource_type – the resource type
  • payload – the payload
  • resource_name – the resource name
  • private – empty string or ‘/private’ if private url
Returns:

status_code – int, message – string (server response)

modify_storage_group(array, storagegroup, payload, version='84')

Modify a storage group (PUT operation).

Parameters:
  • version – the uv4 version
  • array – the array serial number
  • storagegroup – storage group name
  • payload – the request payload
Returns:

status_code – int, message – string, server response

modify_storagegroup_rdf(array, storagegroup_name, rdf_group_num, action, extra_specs)

Modify the rdf state of a storage group.

Parameters:
  • array – the array serial number
  • storagegroup_name – the name of the storage group
  • rdf_group_num – the number of the rdf group
  • action – the required action
  • extra_specs – the extra specifications
modify_volume_snap(array, source_id, target_id, snap_name, extra_specs, link=False, unlink=False, rename=False, new_snap_name=None, restore=False, list_volume_pairs=None)

Modify a snapvx snapshot

Parameters:
  • array – the array serial number
  • source_id – the source device id
  • target_id – the target device id
  • snap_name – the snapshot name
  • extra_specs – extra specifications
  • link – Flag to indicate action = Link
  • unlink – Flag to indicate action = Unlink
  • rename – Flag to indicate action = Rename
  • new_snap_name – Optional new snapshot name
  • restore – Flag to indicate action = Restore
  • list_volume_pairs – list of volume pairs to link, optional
move_volume_between_storage_groups(array, device_id, source_storagegroup_name, target_storagegroup_name, extra_specs, force=False)

Move a volume to a different storage group.

Parameters:
  • array – the array serial number
  • source_storagegroup_name – the originating storage group name
  • target_storagegroup_name – the destination storage group name
  • device_id – the device id
  • extra_specs – extra specifications
  • force – force flag (necessary on a detach)
remove_child_sg_from_parent_sg(array, child_sg, parent_sg, extra_specs)

Remove a storage group from its parent storage group.

This method removes a child storage group from its parent group. :param array: the array serial number :param child_sg: the name of the child sg :param parent_sg: the name of the parent sg :param extra_specs: the extra specifications

remove_vol_from_sg(*args, **kwargs)

Remove a volume from a storage group.

Parameters:
  • array – the array serial number
  • storagegroup_name – storage group name
  • device_id – the device id
  • extra_specs – the extra specifications
rename_volume(array, device_id, new_name)

Rename a volume.

Parameters:
  • array – the array serial number
  • device_id – the volume device id
  • new_name – the new name for the volume, can be None
replicate_group(array, storagegroup_name, rdf_group_num, remote_array, extra_specs)

Create a target group on the remote array and enable replication.

Parameters:
  • array – the array serial number
  • storagegroup_name – the name of the group
  • rdf_group_num – the rdf group number
  • remote_array – the remote array serial number
  • extra_specs – the extra specifications
request(target_uri, method, params=None, request_object=None)

Sends a request (GET, POST, PUT, DELETE) to the target api.

Parameters:
  • target_uri – target uri (string)
  • method – The method (GET, POST, PUT, or DELETE)
  • params – Additional URL parameters
  • request_object – request payload (dict)
Returns:

server response object (dict)

Raises:

VolumeBackendAPIException

set_rest_credentials(array_info)

Given the array record set the rest server credentials.

Parameters:array_info – record
set_storagegroup_srp(array, storagegroup_name, srp_name, extra_specs)

Modify a storage group’s srp value.

Parameters:
  • array – the array serial number
  • storagegroup_name – the storage group name
  • srp_name – the srp pool name
  • extra_specs – the extra specifications
update_storagegroup_qos(array, storage_group_name, extra_specs)

Update the storagegroupinstance with qos details.

If maxIOPS or maxMBPS is in extra_specs, then DistributionType can be modified in addition to maxIOPS or/and maxMBPS If maxIOPS or maxMBPS is NOT in extra_specs, we check to see if either is set in StorageGroup. If so, then DistributionType can be modified :param array: the array serial number :param storage_group_name: the storagegroup instance name :param extra_specs: extra specifications :returns: bool, True if updated, else False

static validate_qos_distribution_type(sg_value, qos_extra_spec, property_dict)
static validate_qos_input(input_key, sg_value, qos_extra_spec, property_dict)
wait_for_job(operation, status_code, job, extra_specs)

Check if call is async, wait for it to complete.

Parameters:
  • operation – the operation being performed
  • status_code – the status code
  • job – the job
  • extra_specs – the extra specifications
Returns:

task – list of dicts detailing tasks in the job

Raises:

VolumeBackendAPIException

wait_for_job_complete(job, extra_specs)

Given the job wait for it to complete.

Parameters:
  • job – the job dict
  • extra_specs – the extra_specs dict.
Returns:

rc – int, result – string, status – string, task – list of dicts detailing tasks in the job

Raises:

VolumeBackendAPIException

wait_for_rdf_consistent_state(array, remote_array, device_id, target_device, extra_specs)

Wait for async pair to be in a consistent state before suspending.

Parameters:
  • array – the array serial number
  • remote_array – the remote array serial number
  • device_id – the device id
  • target_device – the target device id
  • extra_specs – the extra specifications
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.