Volume driver common utilities for HP 3PAR Storage array
The 3PAR drivers requires 3.1.3 firmware on the 3PAR array.
You will need to install the python hp3parclient. sudo pip install hp3parclient
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 hp3par_api_url, hp3par_username, hp3par_password for credentials to talk to the REST service on the 3PAR array.
Bases: object
Class that contains common code for the 3PAR drivers.
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 2.0.54 - Use same LUN ID for each VLUN path #1551994
Bases: object
TaskWaiter waits for task to be not active and returns status.
Save the instance UUID in the volume.
TODO: add support for multi-attach
Clears key,value pairs metadata from virtual volume.
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.
Remove the instance uuid from the volume.
TODO: add support for multi-attach.
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: | hp3par_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>}
Migrate directly if source and dest are managed by same storage.
Parameters: |
|
---|
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.
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.
Updates key,value pair as metadata onto virtual volume.
If key already exists, the value will be replaced.
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.