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

class VMAXCommon(prtcl, version, configuration=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.

VERSION = ‘3.0.0’
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_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_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
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

find_host_lun_id(volume, host, extra_specs)

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

Parameters:
  • volume – the volume dict
  • host – host from connector
  • extra_specs – the extra specs
Returns:

dict – the data dict

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, device_id, host)

Retrieve masking view list for a volume.

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

masking view list

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

Raises:

VolumeBackendAPIException

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

pool_info = {‘reserved_percentage’: 0, ‘arrays_info’: {}, ‘config_file’: None, ‘max_over_subscription_ratio’: None, ‘backend_name’: None}
stats = {‘volume_backend_name’: None, ‘free_capacity_gb’: 0, ‘driver_version’: ‘3.0’, ‘total_capacity_gb’: 0, ‘reserved_percentage’: 0, ‘vendor_name’: ‘Dell EMC’, ‘storage_protocol’: None}
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. :param volume: the volume object :raises VolumeBackendAPIException:

update_volume_stats()

Retrieve stats info.