Volume driver common utilities for HPE 3PAR Storage array
The 3PAR drivers requires 3.1.3 firmware on the 3PAR array.
You will need to install the python hpe3parclient module. sudo pip install python-3parclient
The drivers uses both the REST service and the SSH command line to correctly operate. Since the ssh credentials and the REST credentials can be different we need to have settings for both.
The drivers requires the use of the san_ip, san_login, san_password settings for ssh connections into the 3PAR array. It also requires the setting of hpe3par_api_url, hpe3par_username, hpe3par_password for credentials to talk to the REST service on the 3PAR array.
Bases: object
Class that contains common code for the 3PAR drivers.
Version history:
1.2.0 - Updated hp3parclient API use to 2.0.x
1.2.1 - Check that the VVS exists
1.2.2 - log prior to raising exceptions
1.2.3 - Methods to update key/value pair bug #1258033
1.2.4 - Remove deprecated config option hp3par_domain
1.2.5 - Raise Ex when deleting snapshot with dependencies bug #1250249
1.2.6 - Allow optional specifying n:s:p for vlun creation bug #1269515
This update now requires 3.1.2 MU3 firmware
1.3.0 - Removed all SSH code. We rely on the hp3parclient now.
2.0.0 - Update hp3parclient API uses 3.0.x
2.0.1 - Updated to use qos_specs, added new qos settings and personas
2.0.2 - Add back-end assisted volume migrate
2.0.3 - Allow deleting missing snapshots bug #1283233
2.0.4 - Allow volumes created from snapshots to be larger bug #1279478
2.0.5 - Fix extend volume units bug #1284368
2.0.6 - use loopingcall.wait instead of time.sleep
2.0.7 - Allow extend volume based on snapshot bug #1285906
2.0.8 - Fix detach issue for multiple hosts bug #1288927
2.0.9 - Remove unused 3PAR driver method bug #1310807
2.0.10 - Fixed an issue with 3PAR vlun location bug #1315542
2.0.11 - Remove hp3parclient requirement from unit tests #1315195
2.0.12 - Volume detach hangs when host is in a host set bug #1317134
2.0.13 - Added support for managing/unmanaging of volumes
2.0.14 - Modified manage volume to use standard 'source-name' element.
2.0.15 - Added support for volume retype
2.0.16 - Add a better log during delete_volume time. Bug #1349636
2.0.17 - Added iSCSI CHAP support
This update now requires 3.1.3 MU1 firmware
and hp3parclient 3.1.0
2.0.18 - HP 3PAR manage_existing with volume-type support
2.0.19 - Update default persona from Generic to Generic-ALUA
2.0.20 - Configurable SSH missing key policy and known hosts file
2.0.21 - Remove bogus invalid snapCPG=None exception
2.0.22 - HP 3PAR drivers should not claim to have 'infinite' space
2.0.23 - Increase the hostname size from 23 to 31 Bug #1371242
2.0.24 - Add pools (hp3par_cpg now accepts a list of CPGs)
2.0.25 - Migrate without losing type settings bug #1356608
2.0.26 - Don't ignore extra-specs snap_cpg when missing cpg #1368972
2.0.27 - Fixing manage source-id error bug #1357075
2.0.28 - Removing locks bug #1381190
2.0.29 - Report a limitless cpg's stats better bug #1398651
2.0.30 - Update the minimum hp3parclient version bug #1402115
2.0.31 - Removed usage of host name cache #1398914
2.0.32 - Update LOG usage to fix translations. bug #1384312
2.0.33 - Fix host persona to match WSAPI mapping bug #1403997
2.0.34 - Fix log messages to match guidelines. bug #1411370
2.0.35 - Fix default snapCPG for manage_existing bug #1393609
2.0.36 - Added support for dedup provisioning
2.0.37 - Added support for enabling Flash Cache
2.0.38 - Add stats for hp3par goodness_function and filter_function
2.0.39 - Added support for updated detach_volume attachment.
2.0.40 - Make the 3PAR drivers honor the pool in create bug #1432876
2.0.41 - Only log versions at startup. bug #1447697
2.0.42 - Fix type for snapshot config settings. bug #1461640
2.0.43 - Report the capability of supporting multiattach
2.0.44 - Update help strings to reduce the 3PAR user role requirements
2.0.45 - Python 3 fixes
2.0.46 - Improved VLUN creation and deletion logic. #1469816
2.0.47 - Changed initialize_connection to use getHostVLUNs. #1475064
2.0.48 - Adding changes to support 3PAR iSCSI multipath.
2.0.49 - Added client CPG stats to driver volume stats. bug #1482741
2.0.50 - Add over subscription support
2.0.51 - Adds consistency group support
2.0.52 - Added update_migrated_volume. bug #1492023
2.0.53 - Fix volume size conversion. bug #1513158
3.0.0 - Rebranded HP to HPE.
3.0.1 - Fixed find_existing_vluns bug #1515033
3.0.2 - Python 3 support
3.0.3 - Remove db access for consistency groups
3.0.4 - Adds v2 managed replication support
3.0.5 - Adds v2 unmanaged replication support
3.0.6 - Adding manage/unmanage snapshot support
3.0.7 - Enable standard capabilities based on 3PAR licenses
3.0.8 - Optimize array ID retrieval
3.0.9 - Bump minimum API version for volume replication
3.0.10 - Added additional volumes checks to the manage snapshot API
3.0.11 - Fix the image cache capability bug #1491088
3.0.12 - Remove client version checks for replication
3.0.13 - Support creating a cg from a source cg
3.0.14 - Comparison of WWNs now handles case difference. bug #1546453
3.0.15 - Update replication to version 2.1
3.0.16 - Use same LUN ID for each VLUN path #1551994
3.0.17 - Don't fail on clearing 3PAR object volume key. bug #1546392
3.0.18 - create_cloned_volume account for larger size. bug #1554740
3.0.19 - Remove metadata that tracks the instance ID. bug #1572665
3.0.20 - Fix lun_id of 0 issue. bug #1573298
3.0.21 - Driver no longer fails to initialize if
System Reporter license is missing. bug #1568078
3.0.22 - Rework delete_vlun. Bug #1582922
3.0.23 - Fix CG create failures with long display name or special
characters. bug #1573647
3.0.24 - Fix terminate connection on failover
3.0.25 - Fix delete volume when online clone is active. bug #1349639
3.0.26 - Fix concurrent snapshot delete conflict. bug #1600104
Bases: object
TaskWaiter waits for task to be not active and returns status.
Creates a cgsnapshot.
Creates a consistencygroup.
Create a VLUN.
In order to export a volume on a 3PAR box, we have to create a VLUN.
Creates a volume from a snapshot.
Deletes a cgsnapshot.
Deletes a consistency group.
Force failover to a secondary replication target.
Finds an existing VLUN for a volume on a host.
Returns an existing VLUN’s information. If no existing VLUN is found, None is returned.
Parameters: |
|
---|
Return the next word.
Search ‘s’ for ‘search_string’, if found return the word preceding ‘search_string’ from ‘s’.
Get 3PAR type info for the given type_id.
Reconciles VV Set, old-style extra-specs, and QOS specs and returns commonly used info about the type.
Returns: | hpe3par_keys, qos, volume_type, vvs_name |
---|
Get 3PAR volume settings given a volume.
Combines type info and config settings to return a dictionary describing the 3PAR volume settings. Does some validation (CPG and persona).
Parameters: |
|
---|---|
Returns: | dict |
Get 3PAR volume settings given a type_id.
Combines type info and config settings to return a dictionary describing the 3PAR volume settings. Does some validation (CPG). Uses pool as the default cpg (when not specified in volume type specs).
Parameters: |
|
---|---|
Returns: | dict |
Manage an existing 3PAR volume.
existing_ref is a dictionary of the form: {‘source-name’: <name of the virtual volume>}
Return size of volume to be managed by manage_existing.
existing_ref is a dictionary of the form: {‘source-name’: <name of the virtual volume>}
Manage an existing 3PAR snapshot.
existing_ref is a dictionary of the form: {‘source-name’: <name of the snapshot>}
Return size of snapshot to be managed by manage_existing_snapshot.
existing_ref is a dictionary of the form: {‘source-name’: <name of the snapshot>}
Migrate directly if source and dest are managed by same storage.
Parameters: |
|
---|---|
Returns: | (False, None) if the driver does not support migration, (True, model_update) if successful |
Convert the volume to be of the new type.
Returns True if the retype was successful. Uses taskflow to revert changes if errors occur.
Parameters: |
|
---|
Driver entry point to unattach a volume from an instance.
Tune the volume to change the userCPG and/or provisioningType.
The volume will be modified/tuned/converted to the new userCPG and provisioningType, as needed.
TaskWaiter is used to make this function wait until the 3PAR task is no longer active. When the task is no longer active, then it must either be done or it is in a state that we need to treat as an error.
Removes the specified volume from Cinder management.
Removes the specified snapshot from Cinder management.
Rename the new (temp) volume to it’s original name.
This method tries to rename the new volume to it’s original name after the migration has completed.
Validate persona value.
If the passed in persona_value is not valid, raise InvalidInput, otherwise return the persona ID.
Parameters: | persona_value – |
---|---|
Raises: | exception.InvalidInput |
Returns: | persona ID |
Bases: cinder.flow_utils.CinderTask
Set/unset the QOS settings and/or VV set for the volume’s new type.
This is a task for changing the QOS settings and/or VV set. It is intended for use during retype(). If changes are made during execute(), then they need to be undone if revert() is called (i.e., if a later task fails).
For 3PAR, we ignore QOS settings if a VVS is explicitly set, otherwise we create a VV set and use that for QOS settings. That is why they are lumped together here. Most of the decision-making about VVS vs. QOS settings vs. old-style scoped extra-specs is handled in existing reusable code. Here we mainly need to know what old stuff to remove before calling the function that knows how to set the new stuff.
Basic task flow is as follows: Remove the volume from the old externally created VVS (when appropriate), delete the old cinder-created VVS, call the function that knows how to set a new VVS or QOS settings.
If any changes are made during execute, then revert needs to reverse them.
Bases: cinder.flow_utils.CinderTask
Task to change a volume’s snapCPG and comment.
This is a task for changing the snapCPG and comment. It is intended for use during retype(). These changes are done together with a single modify request which should be fast and easy to revert.
Because we do not support retype with existing snapshots, we can change the snapCPG without using a keepVV. If snapshots exist, then this will fail, as desired.
This task does not change the userCPG or provisioningType. Those changes may require tunevv, so they are done by the TuneVolumeTask.
The new comment will contain the new type, VVS and QOS information along with whatever else was in the old comment dict.
The old comment and snapCPG are restored if revert is called.
Bases: cinder.flow_utils.CinderTask
Task to change a volume’s CPG and/or provisioning type.
This is a task for changing the CPG and/or provisioning type. It is intended for use during retype(). This task has no revert. The current design is to do this task last and do revert-able tasks first. Un-doing a tunevv can be expensive and should be avoided.