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

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

class VMAXCommon(prtcl, version, configuration=None, active_backend_id=None)

Bases: object

Common class for Rest based VMAX volume drivers.

This common class is for Dell EMC VMAX volume drivers based on UniSphere Rest API. It supports VMAX 3 and VMAX All Flash arrays.

add_volume_to_replication_group(array, device_id, volume_name, extra_specs)

Add a volume to the default replication group.

Replication groups are VMAX storage groups that contain only RDF-paired volumes. We can use our normal storage group operations. :param array: array serial number :param device_id: the device id :param volume_name: the volume name :param extra_specs: the extra specifications :returns: storagegroup_name

cleanup_lun_replication(volume, volume_name, device_id, extra_specs)

Cleanup target volume on delete.

Extra logic if target is last in group, or is a metro volume. :param volume: the volume object :param volume_name: the volume name :param device_id: the device id :param extra_specs: extra specifications :raises: VolumeBackendAPIException

create_cloned_volume(clone_volume, source_volume)

Creates a clone of the specified volume.

Parameters:
  • clone_volume – clone volume Object
  • source_volume – volume object
Returns:

model_update, dict

create_group(context, group)

Creates a generic volume group.

Parameters:
  • context – the context
  • group – the group object to be created
Returns:

dict – modelUpdate

Raises:

VolumeBackendAPIException, NotImplementedError, InvalidInput

create_group_from_src(context, group, volumes, group_snapshot, snapshots, source_group, source_vols)

Creates the volume group from source.

Parameters:
  • context – the context
  • group – the volume group object to be created
  • volumes – volumes in the consistency group
  • group_snapshot – the source volume group snapshot
  • snapshots – snapshots of the source volumes
  • source_group – the source volume group
  • source_vols – the source vols
Returns:

model_update, volumes_model_update model_update is a dictionary of cg status volumes_model_update is a list of dictionaries of volume update

Raises:

VolumeBackendAPIException, NotImplementedError

create_group_snapshot(context, group_snapshot, snapshots)

Creates a generic volume group snapshot.

Parameters:
  • context – the context
  • group_snapshot – the group snapshot to be created
  • snapshots – snapshots
Returns:

dict – modelUpdate

Returns:

list – list of snapshots

Raises:

VolumeBackendAPIException, NotImplementedError

create_snapshot(snapshot, volume)

Creates a snapshot.

Parameters:
  • snapshot – snapshot object
  • volume – volume Object to create snapshot from
Returns:

dict – the cloned volume dictionary

create_volume(volume)

Creates a EMC(VMAX) volume from a storage group.

Parameters:volume – volume object
Returns:model_update - dict
create_volume_from_snapshot(volume, snapshot)

Creates a volume from a snapshot.

Parameters:
  • volume – volume object
  • snapshot – snapshot object
Returns:

model_update

Raises:

VolumeBackendAPIException:

delete_group(context, group, volumes)

Deletes a generic volume group.

Parameters:
  • context – the context
  • group – the group object to be deleted
  • volumes – the list of volumes in the generic group to be deleted
Returns:

dict – modelUpdate

Returns:

list – list of volume model updates

Raises:

NotImplementedError

delete_group_snapshot(context, group_snapshot, snapshots)

Delete a volume group snapshot.

Parameters:
  • context – the context
  • group_snapshot – the volume group snapshot to be deleted
  • snapshots – the snapshot objects
Returns:

model_update, snapshots_model_update

delete_snapshot(snapshot, volume)

Deletes a snapshot.

Parameters:
  • snapshot – snapshot object
  • volume – source volume
delete_volume(volume)

Deletes a EMC(VMAX) volume.

Parameters:volume – volume object
disable_replication(context, group, volumes)

Disable replication for a group.

Parameters:
  • context – the context
  • group – the group object
  • volumes – the list of volumes
Returns:

model_update, None

enable_rdf(array, volume, device_id, rdf_group_no, rep_config, target_name, remote_array, target_device, extra_specs)

Create a replication relationship with a target volume.

Parameters:
  • array – the array serial number
  • volume – the volume object
  • device_id – the device id
  • rdf_group_no – the rdf group number
  • rep_config – the replication config
  • target_name – the target volume name
  • remote_array – the remote array serial number
  • target_device – the target device id
  • extra_specs – the extra specifications
Returns:

rdf_dict

enable_replication(context, group, volumes)

Enable replication for a group.

Replication is enabled on replication-enabled groups by default. :param context: the context :param group: the group object :param volumes: the list of volumes :returns: model_update, None

extend_volume(volume, new_size)

Extends an existing volume.

Parameters:
  • volume – the volume Object
  • new_size – the new size to increase the volume to
Returns:

dict – modifiedVolumeDict - the extended volume Object

Raises:

VolumeBackendAPIException:

extend_volume_is_replicated(array, volume, device_id, volume_name, new_size, extra_specs)

Extend a replication-enabled volume.

Cannot extend volumes in a synchronization pair where the source and/or target arrays are running HyperMax versions < 5978. Must first break the relationship, extend them separately, then recreate the pair. Extending Metro protected volumes is not supported. :param array: the array serial number :param volume: the volume objcet :param device_id: the volume device id :param volume_name: the volume name :param new_size: the new size the volume should be :param extra_specs: extra specifications

failover_host(volumes, secondary_id=None, groups=None)

Fails over the volumes on a host back and forth.

Driver needs to update following info for failed-over volume: 1. provider_location: update array details 2. replication_status: new status for replication-enabled volume :param volumes: the list of volumes to be failed over :param secondary_id: the target backend :param groups: replication groups :returns: secondary_id, volume_update_list, group_update_list :raises: VolumeBackendAPIException

failover_replication(context, group, volumes, secondary_backend_id=None, host=False)

Failover replication for a group.

Parameters:
  • context – the context
  • group – the group object
  • volumes – the list of volumes
  • secondary_backend_id – the secondary backend id - default None
  • host – flag to indicate if whole host is being failed over
Returns:

model_update, vol_model_updates

find_host_lun_id(volume, host, extra_specs, rep_extra_specs=None)

Given the volume dict find the host lun id for a volume.

Parameters:
  • volume – the volume dict
  • host – host from connector (can be None on a force-detach)
  • extra_specs – the extra specs
  • rep_extra_specs – rep extra specs, passed in if metro device
Returns:

dict – the data dict

get_attributes_from_cinder_config()
get_common_masking_views(array, portgroup_name, initiator_group_name)

Get common masking views, if any.

Parameters:
  • array – the array serial number
  • portgroup_name – port group name
  • initiator_group_name – ig name
Returns:

list of masking views

get_initiator_group_from_masking_view(array, maskingview_name)

Get the initiator group in a masking view.

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

initiator group name

get_masking_views_from_volume(array, volume, device_id, host)

Get all masking views from a volume.

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

masking view list, is metro

get_port_group_from_masking_view(array, maskingview_name)

Get the port groups in a masking view.

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

port group name

get_rdf_details(array)

Retrieves an SRDF group instance.

Parameters:array – the array serial number
Returns:rdf_group_no, remote_array
get_remote_target_device(array, volume, device_id)

Get the remote target for a given volume.

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

target_device, target_array, rdf_group, state

static get_secondary_stats_info(rep_config, array_info)

On failover, report on secondary array statistics.

Parameters:
  • rep_config – the replication configuration
  • array_info – the array info
Returns:

secondary_info - dict

get_target_wwns_from_masking_view(volume, connector)

Find target WWNs via the masking view.

Parameters:
  • volume – volume to be attached
  • connector – the connector dict
Returns:

list – the target WWN list

initialize_connection(volume, connector)

Initializes the connection and returns device and connection info.

The volume may be already mapped, if this is so the deviceInfo tuple is returned. If the volume is not already mapped then we need to gather information to either 1. Create an new masking view or 2. Add the volume to an existing storage group within an already existing maskingview.

The naming convention is the following:

initiator_group_name = OS-<shortHostName>-<shortProtocol>-IG
                     e.g OS-myShortHost-I-IG
storage_group_name = OS-<shortHostName>-<srpName>-<shortProtocol>-SG
                   e.g OS-myShortHost-SRP_1-I-SG
port_group_name = OS-<target>-PG  The port_group_name will come from
                the EMC configuration xml file.
                These are precreated. If the portGroup does not
                exist then an error will be returned to the user
maskingview_name  = OS-<shortHostName>-<srpName>-<shortProtocol>-MV
               e.g OS-myShortHost-SRP_1-I-MV
Parameters:
  • volume – volume Object
  • connector – the connector Object
Returns:

dict – device_info_dict - device information dict

manage_existing(volume, external_ref)

Manages an existing VMAX Volume (import to Cinder).

Renames the existing volume to match the expected name for the volume. Also need to consider things like QoS, Emulation, account/tenant. :param volume: the volume object including the volume_type_id :param external_ref: reference to the existing volume :returns: dict – model_update

manage_existing_get_size(volume, external_ref)

Return size of an existing VMAX volume to manage_existing.

Parameters:
  • self – reference to class
  • volume – the volume object including the volume_type_id
  • external_ref – reference to the existing volume
Returns:

size of the volume in GB

manage_existing_snapshot(snapshot, existing_ref)

Manage an existing VMAX Snapshot (import to Cinder).

Renames the Snapshot to prefix it with OS- to indicate it is managed by Cinder

Parameters:
  • snapshot – the snapshot object
  • existing_ref – the snapshot name on the backend VMAX
Raises:

VolumeBackendAPIException

Returns:

model update

manage_existing_snapshot_get_size(snapshot)

Return the size of the source volume for manage-existing-snapshot.

Parameters:snapshot – the snapshot object
Returns:size of the source volume in GB
pool_info = {'arrays_info': {}, 'config_file': None, 'backend_name': None, 'reserved_percentage': 0, 'max_over_subscription_ratio': None, 'replication_enabled': False}
recover_volumes_on_failback(volume, extra_specs)

Recover volumes on failback.

On failback, attempt to recover non RE(replication enabled) volumes from primary array. :param volume: the volume object :param extra_specs: the extra specifications :returns: volume_update

retype(volume, new_type, host)

Migrate volume to another host using retype.

Parameters:
  • volume – the volume object including the volume_type_id
  • new_type – the new volume type.
  • host – The host dict holding the relevant target(destination) information
Returns:

boolean – True if retype succeeded, False if error

revert_to_snapshot(volume, snapshot)

Revert volume to snapshot.

Parameters:
  • volume – the volume object
  • snapshot – the snapshot object
setup_volume_replication(array, volume, device_id, extra_specs, target_device_id=None)

Setup replication for volume, if enabled.

Called on create volume, create cloned volume, create volume from snapshot, manage_existing, and re-establishing a replication relationship after extending. :param array: the array serial number :param volume: the volume object :param device_id: the device id :param extra_specs: the extra specifications :param target_device_id: the target device id :returns: replication_status – str, replication_driver_data – dict

terminate_connection(volume, connector)

Disallow connection from connector.

Parameters:
  • volume – the volume Object
  • connector – the connector Object
unmanage(volume)

Export VMAX volume from Cinder.

Leave the volume intact on the backend array.

Parameters:volume – the volume object
unmanage_snapshot(snapshot)

Export VMAX Snapshot from Cinder.

Leaves the snapshot intact on the backend VMAX

Parameters:snapshot – the snapshot object
Raises:VolumeBackendAPIException
update_group(group, add_volumes, remove_volumes)

Updates LUNs in generic volume group.

Parameters:
  • group – storage configuration service instance
  • add_volumes – the volumes uuids you want to add to the vol grp
  • remove_volumes – the volumes uuids you want to remove from the CG
Returns:

model_update

Raises:

VolumeBackendAPIException, NotImplementedError

update_volume_stats()

Retrieve stats info.

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.