The cinder.volume.drivers.emc.emc_vmax_common Module

class EMCVMAXCommon(prtcl, version, configuration=None)

Bases: object

Common class for SMI-S based EMC volume drivers.

This common class is for EMC volume drivers based on SMI-S. It supports VNX and VMAX arrays.

VERSION = '2.0.0'
add_to_default_SG(conn, volumeInstance, storageSystemName, targetFastPolicyName, volumeName, extraSpecs)

For FAST, add volume to default storage group.

Parameters:
  • conn – connection info to ECOM
  • volumeInstance – the volume instance
  • storageSystemName – the storage system name
  • targetFastPolicyName – the target FAST policy name
  • volumeName – the volume Name
  • extraSpecs – extra specifications
check_ig_instance_name(initiatorGroupInstanceName)

Check if an initiator group instance is on the array.

Parameters:initiatorGroupInstanceName – initiator group instance name
Returns:initiator group name, or None if deleted
create_cgsnapshot(context, cgsnapshot, snapshots)

Creates a cgsnapshot.

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

dict – modelUpdate

Returns:

list – list of snapshots

Raises:

VolumeBackendAPIException

create_cloned_volume(cloneVolume, sourceVolume)

Creates a clone of the specified volume.

Parameters:
  • cloneVolume – clone volume Object
  • sourceVolume – volume object
Returns:

cloneVolumeDict – the cloned volume dictionary

create_consistencygroup(context, group)

Creates a consistency group.

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

dict – modelUpdate = {‘status’: ‘available’}

Raises:

VolumeBackendAPIException

create_consistencygroup_from_src(context, group, volumes, cgsnapshot, snapshots, source_cg, source_vols)

Creates the consistency group from source.

Currently the source can only be a cgsnapshot.

Parameters:
  • context – the context
  • group – the consistency group object to be created
  • volumes – volumes in the consistency group
  • cgsnapshot – the source consistency group snapshot
  • snapshots – snapshots of the source volumes
  • source_cg – the source consistency 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

create_snapshot(snapshot, volume)

Creates a snapshot.

For VMAX, replace snapshot with clone.

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 pre-existing storage pool.

For a concatenated compositeType: If the volume size is over 240GB then a composite is created EMCNumberOfMembers > 1, otherwise it defaults to a non composite

For a striped compositeType: The user must supply an extra spec to determine how many metas will make up the striped volume. If the meta size is greater than 240GB an error is returned to the user. Otherwise the EMCNumberOfMembers is what the user specifies.

Parameters:volume – volume Object
Returns:dict – volumeDict - the volume dictionary
create_volume_from_snapshot(volume, snapshot)

Creates a volume from a snapshot.

For VMAX, replace snapshot with clone.

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

dict – the cloned volume dictionary

Raises:

VolumeBackendAPIException

delete_cgsnapshot(context, cgsnapshot, snapshots)

Delete a cgsnapshot.

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

dict – modelUpdate

Returns:

list – list of snapshots

Raises:

VolumeBackendAPIException

delete_consistencygroup(context, group, volumes)

Deletes a consistency group.

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

dict – modelUpdate

Returns:

list – list of volume objects

Raises:

VolumeBackendAPIException

delete_snapshot(snapshot, volume)

Deletes a snapshot.

Parameters:
  • snapshot – snapshot object
  • volume – volume Object to create snapshot from
delete_volume(volume)

Deletes a EMC(VMAX) volume.

Parameters:volume – volume Object
extend_volume(volume, newSize)

Extends an existing volume.

Prequisites: 1. The volume must be composite e.g StorageVolume.EMCIsComposite=True 2. The volume can only be concatenated e.g StorageExtent.IsConcatenated=True

Params volume:the volume Object
Params newSize:the new size to increase the volume to
Returns:dict – modifiedVolumeDict - the extended volume Object
Raises:VolumeBackendAPIException
find_device_number(volume, host)

Given the volume dict find a device number.

Find a device number that a host can see for a volume.

Parameters:
  • volume – the volume dict
  • host – host from connector
Returns:

dict – the data dict

get_initiator_group_from_masking_view(maskingViewInstanceName)

Get the initiator group in a masking view.

Parameters:maskingViewInstanceName – masking view instance name
Returns:initiatorGroupInstanceName
get_ip_and_iqn(conn, endpoint, ipendpointinstancename)

Get ip and iqn from the endpoint.

Parameters:
  • conn – ecom connection
  • endpoint – end point
  • ipendpointinstancename – ip endpoint
Returns:

endpoint

get_masking_view_by_volume(volume, connector)

Given volume, retrieve the masking view instance name.

Parameters:
  • volume – the volume
  • connector – the connector object
Returns:

maskingviewInstanceName

get_masking_views_by_initiator_group(initiatorGroupInstanceName)

Given initiator group, retrieve the masking view instance name.

Parameters:initiatorGroupInstanceName – initiator group instance name
Returns:list – maskingViewInstanceNames
get_masking_views_by_port_group(portGroupInstanceName)

Given port group, retrieve the masking view instance name.

Parameters:portGroupInstanceName – port group instance name
Returns:list – maskingViewInstanceNames
get_num_volumes_mapped(volume, connector)

Returns how many volumes are in the same zone as the connector.

Find out how many volumes are mapped to a host associated to the LunMaskingSCSIProtocolController.

Parameters:
  • volume – volume object to be deleted
  • connector – volume object to be deleted
Returns:

int – numVolumesMapped

Raises:

VolumeBackendAPIException

get_port_group_from_masking_view(maskingViewInstanceName)

Get the port groups in a masking view.

Parameters:maskingViewInstanceName – masking view instance name
Returns:portGroupInstanceName
get_target_wwns(storageSystem, connector)

Find target WWNs.

Parameters:
  • storageSystem – the storage system name
  • connector – the connector dict
Returns:

list – targetWwns, the target WWN list

Raises:

VolumeBackendAPIException

get_target_wwns_from_masking_view(storageSystem, volume, connector)

Find target WWNs via the masking view.

Parameters:
  • storageSystem – the storage system name
  • 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:

initiatorGroupName = OS-<shortHostName>-<shortProtocol>-IG
                     e.g OS-myShortHost-I-IG
storageGroupName = OS-<shortHostName>-<poolName>-<shortProtocol>-SG
                   e.g OS-myShortHost-SATA_BRONZ1-I-SG
portGroupName = OS-<target>-PG  The portGroupName 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  = OS-<shortHostName>-<poolName>-<shortProtocol>-MV
               e.g OS-myShortHost-SATA_BRONZ1-I-MV
Parameters:
  • volume – volume Object
  • connector – the connector Object
Returns:

dict – deviceInfoDict - 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.

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

dict – model_update

Raises:

VolumeBackendAPIException

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

migrate_volume(ctxt, volume, host, new_type=None)

Migrate volume to another host.

Parameters:
  • ctxt – context
  • volume – the volume object including the volume_type_id
  • host – the host dict holding the relevant target(destination) information
  • new_type – None
Returns:

boolean – Always returns True

Returns:

dict – Empty dict {}

pool_info = {'reserved_percentage': None, 'arrays_info': {}, 'config_file': None, 'max_over_subscription_ratio': None, 'backend_name': None}
remove_from_default_SG(conn, volumeInstance, storageSystemName, sourceFastPolicyName, volumeName, extraSpecs)

For FAST, remove volume from default storage group.

Parameters:
  • conn – connection info to ECOM
  • volumeInstance – the volume instance
  • storageSystemName – the storage system name
  • sourceFastPolicyName – the source FAST policy name
  • volumeName – the volume Name
  • extraSpecs – extra specifications
Raises:

VolumeBackendAPIException

retype(ctxt, volume, new_type, diff, host)

Migrate volume to another host using retype.

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

boolean – True if retype succeeded, False if error

stats = {'volume_backend_name': None, 'free_capacity_gb': 0, 'driver_version': '1.0', 'total_capacity_gb': 0, 'reserved_percentage': 0, 'vendor_name': 'EMC', 'storage_protocol': None}
terminate_connection(volume, connector)

Disallow connection from connector.

Params volume:the volume Object
Params connector:
 the connector Object
unmanage(volume)

Export VMAX volume from Cinder.

Leave the volume intact on the backend array.

Parameters:volume – the volume object
Raises:VolumeBackendAPIException
update_consistencygroup(group, add_volumes, remove_volumes)

Updates LUNs in consistency group.

Parameters:
  • group – storage configuration service instance
  • add_volumes – the volumes uuids you want to add to the CG
  • remove_volumes – the volumes uuids you want to remove from the CG
update_volume_stats()

Retrieve stats info.

Previous topic

The cinder.volume.drivers.drbdmanagedrv Module

Next topic

The cinder.volume.drivers.emc.emc_vmax_fast Module

This Page