client – HP3ParClient

HP3PAR REST Client.

Author:Walter A. Boring IV
Description:This is the 3PAR Client that talks to 3PAR’s REST WSAPI Service.

It provides the ability to provision 3PAR volumes, VLUNs, CPGs. This version also supports running actions on the 3PAR that use SSH.

This client requires and works with 3PAR InForm 3.1.3 MU1 firmware

class hp3parclient.client.HP3ParClient(api_url, secure=False)[source]

The 3PAR REST API Client.

Parameters:api_url (str) – The url to the WSAPI service on 3PAR ie. http://<3par server>:8080/api/v1
getWsApiVersion()[source]

Get the 3PAR WS API version.

Returns:Version dict
getStorageSystemInfo()[source]

Get the Storage System Information

Returns:Dictionary of Storage System Info
getWSAPIConfigurationInfo()[source]

Get the WSAPI Configuration Information.

Returns:Dictionary of WSAPI configurations
getOverallSystemCapacity()[source]

Get the overall system capacity for the 3PAR server.

Returns:Dictionary of system capacity information
capacity = {
  "allCapacity": {                        # Overall system capacity
                                          # includes FC, NL, SSD
                                          # device types
    "totalMiB": 20054016,                 # Total system capacity
                                          # in MiB
    "allocated": {                        # Allocated space info
      "totalAllocatedMiB": 12535808,      # Total allocated
                                          # capacity
      "volumes": {                        # Volume capacity info
        "totalVolumesMiB": 10919936,      # Total capacity
                                          # allocated to volumes
        "nonCPGsMiB": 0,                  # Total non-CPG capacity
        "nonCPGUserMiB": 0,               # The capacity allocated
                                          # to non-CPG user space
        "nonCPGSnapshotMiB": 0,           # The capacity allocated
                                          # to non-CPG snapshot
                                          # volumes
        "nonCPGAdminMiB": 0,              # The capacity allocated
                                          # to non-CPG
                                          # administrative volumes
        "CPGsMiB": 10919936,              # Total capacity
                                          # allocated to CPGs
        "CPGUserMiB": 7205538,            # User CPG space
        "CPGUserUsedMiB": 7092550,        # The CPG allocated to
                                          # user space that is
                                          # in use
        "CPGUserUnusedMiB": 112988,       # The CPG allocated to
                                          # user space that is not
                                          # in use
        "CPGSnapshotMiB": 2411870,        # Snapshot CPG space
        "CPGSnapshotUsedMiB": 210256,     # CPG allocated to
                                          # snapshot that is in use
        "CPGSnapshotUnusedMiB": 2201614,  # CPG allocated to
                                          # snapshot space that is
                                          # not in use
        "CPGAdminMiB": 1302528,           # Administrative volume
                                          # CPG space
        "CPGAdminUsedMiB": 115200,        # The CPG allocated to
                                          # administrative space
                                          # that is in use
        "CPGAdminUnusedMiB": 1187328,     # The CPG allocated to
                                          # administrative space
                                          # that is not in use
        "unmappedMiB": 0                  # Allocated volume space
                                          # that is unmapped
      },
      "system": {                    # System capacity info
         "totalSystemMiB": 1615872,  # System space capacity
         "internalMiB": 780288,      # The system capacity
                                     # allocated to internal
                                     # resources
         "spareMiB": 835584,         # Total spare capacity
         "spareUsedMiB": 0,          # The system capacity
                                     # allocated to spare resources
                                     # in use
         "spareUnusedMiB": 835584    # The system capacity
                                     # allocated to spare resources
                                     # that are unused
        }
    },
      "freeMiB": 7518208,             # Free capacity
      "freeInitializedMiB": 7518208,  # Free initialized capacity
      "freeUninitializedMiB": 0,      # Free uninitialized capacity
      "unavailableCapacityMiB": 0,    # Unavailable capacity in MiB
      "failedCapacityMiB": 0          # Failed capacity in MiB
  },
  "FCCapacity": {   # System capacity from FC devices only
      ...           # Same structure as above
  },
  "NLCapacity": {   # System capacity from NL devices only
      ...           # Same structure as above
  },
  "SSDCapacity": {  # System capacity from SSD devices only
      ...           # Same structure as above
  }
}
debug_rest(flag)[source]

This is useful for debugging requests to 3PAR.

Parameters:flag (bool) – set to True to enable debugging
login(username, password, optional=None)[source]
This authenticates against the 3PAR wsapi server and creates a
session.
Parameters:
  • username (str) – The username
  • password (str) – The Password
Returns:

None

logout()[source]
This destroys the session and logs out from the 3PAR server.
The SSH connection to the 3PAR server is also closed.
Returns:None
setSSHOptions(ip, login, password, port=22, conn_timeout=None, privatekey=None, **kwargs)[source]

Set SSH Options for ssh calls.

This is used to set the SSH credentials for calls that use SSH instead of REST HTTP.

getVolumes()[source]

Get the list of Volumes

Returns:list of Volumes
getVolume(name)[source]

Get information about a volume.

Parameters:name (str) – The name of the volume to find
Returns:volume
Raises:HTTPNotFound - NON_EXISTENT_VOL - volume doesn’t exist
createVolume(name, cpgName, sizeMiB, optional=None)[source]

Create a new volume.

Parameters:
  • name (str) – the name of the volume
  • cpgName (str) – the name of the destination CPG
  • sizeMiB (int) – size in MiB for the volume
  • optional (dict) – dict of other optional items
optional = {
 'id': 12,                    # Volume ID. If not specified, next
                              # available is chosen
 'comment': 'some comment',   # Additional information up to 511
                              # characters
 'policies: {                 # Specifies VV policies
    'staleSS': False,         # True allows stale snapshots.
    'oneHost': True,          # True constrains volume export to
                              # single host or host cluster
    'zeroDetect': True,       # True requests Storage System to
                              # scan for zeros in incoming write
                              # data
    'system': False,          # True special volume used by system
                              # False is normal user volume
    'caching': True},         # Read-only. True indicates write &
                              # read caching & read ahead enabled
 'snapCPG': 'CPG name',       # CPG Used for snapshots
 'ssSpcAllocWarningPct': 12,  # Snapshot space allocation warning
 'ssSpcAllocLimitPct': 22,    # Snapshot space allocation limit
 'tpvv': True,                # True: Create TPVV
                              # False (default) Create FPVV
 'usrSpcAllocWarningPct': 22, # Enable user space allocation
                              # warning
 'usrSpcAllocLimitPct': 22,   # User space allocation limit
 'expirationHours': 256,      # Relative time from now to expire
                              # volume (max 43,800 hours)
 'retentionHours': 256        # Relative time from now to retain
                              # volume (max 43,800 hours)
}
Returns:List of Volumes
Raises:HTTPBadRequest - INV_INPUT - Invalid Parameter
Raises:HTTPBadRequest - TOO_LARGE - Volume size above limit
Raises:HTTPBadRequest - NO_SPACE - Not Enough space is available
Raises:HTTPForbidden - PERM_DENIED - Permission denied
Raises:HTTPConflict - EXISTENT_SV - Volume Exists already
deleteVolume(name)[source]

Delete a volume.

Parameters:name (str) – the name of the volume
Raises:HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist
Raises:HTTPForbidden - PERM_DENIED - Permission denied
Raises:HTTPForbidden - RETAINED - Volume retention time has not expired
Raises:HTTPForbidden - HAS_RO_CHILD - Volume has read-only child
Raises:HTTPConflict - HAS_CHILD - The volume has a child volume
Raises:HTTPConflict - IN_USE - The volume is in use by VV set, VLUN, etc
modifyVolume(name, volumeMods)[source]

Modify a volume.

Parameters:
  • name (str) – the name of the volume
  • volumeMods (dict) – dictionary of volume attributes to change
volumeMods = {
 'newName': 'newName',         # New volume name
 'comment': 'some comment',    # New volume comment
 'snapCPG': 'CPG name',        # Snapshot CPG name
 'policies: {                  # Specifies VV policies
    'staleSS': False,          # True allows stale snapshots.
    'oneHost': True,           # True constrains volume export to
                               # single host or host cluster
    'zeroDetect': True,        # True requests Storage System to
                               # scan for zeros in incoming write
                               # data
    'system': False,           # True special volume used by system
                               # False is normal user volume
    'caching': True},          # Read-only. True indicates write &
                               # read caching & read ahead enabled
 'ssSpcAllocWarningPct': 12,   # Snapshot space allocation warning
 'ssSpcAllocLimitPct': 22,     # Snapshot space allocation limit
 'tpvv': True,                 # True: Create TPVV
                               # False: (default) Create FPVV
 'usrSpcAllocWarningPct': 22,  # Enable user space allocation
                               # warning
 'usrSpcAllocLimitPct': 22,    # User space allocation limit
 'userCPG': 'User CPG name',   # User CPG name
 'expirationHours': 256,       # Relative time from now to expire
                               # volume (max 43,800 hours)
 'retentionHours': 256,        # Relative time from now to retain
                               # volume (max 43,800 hours)
 'rmSsSpcAllocWarning': False, # True removes snapshot space
                               # allocation warning.
                               # False sets it when value > 0
 'rmUsrSpcAllocWarwaning': False, # True removes user space
                               #  allocation warning.
                               # False sets it when value > 0
 'rmExpTime': False,           # True resets expiration time to 0.
                               # False sets it when value > 0
 'rmSsSpcAllocLimit': False,   # True removes snapshot space
                               # allocation limit.
                               # False sets it when value > 0
 'rmUsrSpcAllocLimit': False   # True removes user space
                               # allocation limit.
                               # False sets it when value > 0
}
Raises:HTTPBadRequest - INV_INPUT_WARN_GT_LIMIT - Allocation warning level is higher than the limit.
Raises:HTTPBadRequest - INV_INPUT_USR_ALRT_NON_TPVV - User space allocation alerts are valid only with a TPVV.
Raises:HTTPBadRequest - INV_INPUT_RETAIN_GT_EXPIRE - Retention time is greater than expiration time.
Raises:HTTPBadRequest - INV_INPUT_VV_POLICY - Invalid policy specification (for example, caching or system is set to true).
Raises:HTTPBadRequest - INV_INPUT_EXCEEDS_LENGTH - Invalid input: string length exceeds limit.
Raises:HTTPBadRequest - INV_INPUT_TIME - Invalid time specified.
Raises:HTTPForbidden - INV_OPERATION_VV_MODIFY_USR_CPG_TPVV - usr_cpg cannot be modified on a TPVV.
Raises:HTTPBadRequest - UNLICENSED_FEATURE - Retention time cannot be modified on a system without the Virtual Lock license.
Raises:HTTPForbidden - CPG_NOT_IN_SAME_DOMAIN - Snap CPG is not in the same domain as the user CPG.
Raises:HTTPForbidden - INV_OPERATION_VV_PEER_VOLUME - Cannot modify a peer volume.
Raises:HTTPInternalServerError - INT_SERV_ERR - Metadata of the VV is corrupted.
Raises:HTTPForbidden - INV_OPERATION_VV_SYS_VOLUME - Cannot modify retention time on a system volume.
Raises:HTTPForbidden - INV_OPERATION_VV_INTERNAL_VOLUME - Cannot modify an internal volume
Raises:HTTPConflict - INV_OPERATION_VV_VOLUME_NOT_DEFINED_ALL_NODES - Cannot modify a volume until the volume is defined on all volumes.
Raises:HTTPConflict - INVALID_OPERATION_VV_ONLINE_COPY_IN_PROGRESS - Cannot modify a volume when an online copy for that volume is in progress.
Raises:HTTPConflict - INVALID_OPERATION_VV_VOLUME_CONV_IN_PROGRESS - Cannot modify a volume in the middle of a conversion operation.
Raises:HTTPConflict - INVALID_OPERATION_VV_SNAPSPACE_NOT_MOVED_TO_CPG - Snapshot space of a volume needs to be moved to a CPG before the user space.
Raises:HTTPConflict - INV_OPERATION_VV_VOLUME_ACCOUNTING_IN_PROGRESS - The volume cannot be renamed until snapshot accounting has finished.
Raises:HTTPForbidden - INV_OPERATION_VV_ZERO_DETECT_TPVV - The zero_detect policy can be used only on TPVVs.
Raises:HTTPConflict - INV_OPERATION_VV_CPG_ON_SNAPSHOT - CPG cannot be assigned to a snapshot.
growVolume(name, amount)[source]

Grow an existing volume by ‘amount’ Mebibytes.

Parameters:
  • name (str) – the name of the volume
  • amount (int) – the additional size in MiB to add, rounded up to the next chunklet size (e.g. 256 or 1000 MiB)
Raises:

HTTPForbidden - VV_NOT_IN_SAME_DOMAIN - The volume is not in the same domain.

Raises:

HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist.

Raises:

HTTPForbidden - INV_OPERATION_UNSUPPORTED_VV_TYPE - Invalid operation: Cannot grow this type of volume.

Raises:

HTTPConflict - INV_OPERATION_VV_TUNE_IN_PROGRESS - Invalid operation: Volume tuning is in progress.

Raises:

HTTPBadRequest - INV_INPUT_EXCEEDS_LENGTH - Invalid input: String length exceeds limit.

Raises:

HTTPBadRequest - INV_INPUT_VV_GROW_SIZE - Invalid grow size.

Raises:

HTTPForbidden - VV_NEW_SIZE_EXCEEDS_CPG_LIMIT - New volume size exceeds CPG limit

Raises:

HTTPForbidden - INV_OPERATION_VV_INTERNAL_VOLUME - This operation is not allowed on an internal volume.

Raises:

HTTPConflict - INV_OPERATION_VV_VOLUME_CONV_IN_PROGRESS - Invalid operation: VV conversion is in progress.

Raises:

HTTPConflict - INV_OPERATION_VV_VOLUME_COPY_IN_PROGRESS - Invalid operation: online copy is in progress.

Raises:

HTTPForbidden - INV_OPERATION_VV_CLEANUP_IN_PROGRESS - Internal volume cleanup is in progress.

Raises:

HTTPForbidden - VV_IS_BEING_REMOVED - The volume is being removed.

Raises:

HTTPForbidden - VV_IN_INCONSISTENT_STATE - The volume has an internal consistency error.

Raises:

HTTPForbidden - VV_SIZE_CANNOT_REDUCE - New volume size is smaller than the current size.

Raises:

HTTPForbidden - VV_NEW_SIZE_EXCEEDS_LIMITS - New volume size exceeds the limit.

Raises:

HTTPConflict - INV_OPERATION_VV_SA_SD_SPACE_REMOVED - Invalid operation: Volume SA/SD space is being removed.

Raises:

HTTPConflict - INV_OPERATION_VV_IS_BUSY - Invalid operation: Volume is currently busy.

Raises:

HTTPForbidden - VV_NOT_STARTED - Volume is not started.

Raises:

HTTPConflict - INV_OPERATION_VV_IS_PCOPY - Invalid operation: Volume is a physical copy.

Raises:

HTTPForbidden - INV_OPERATION_VV_NOT_IN_NORMAL_STATE - Volume state is not normal

Raises:

HTTPConflict - INV_OPERATION_VV_PROMOTE_IN_PROGRESS - Invalid operation: Volume promotion is in progress.

Raises:

HTTPConflict - INV_OPERATION_VV_PARENT_OF_PCOPY - Invalid operation: Volume is the parent of physical copy.

Raises:

HTTPBadRequest - NO_SPACE - Insufficent space for requested operation.

copyVolume(src_name, dest_name, dest_cpg, optional=None)[source]

Copy/Clone a volume.

Parameters:
  • src_name (str) – the source volume name
  • dest_name (str) – the destination volume name
  • dest_cpg (str) – the destination CPG
  • optional (dict) – Dictionary of optional params
optional = {
    'online': False,                # should physical copy be
                                    # performed online?
    'tpvv': False,                  # use thin provisioned space
                                    # for destination
                                    # (online copy only)
    'snapCPG': 'OpenStack_SnapCPG', # snapshot CPG for the
                                    # destination
                                    # (online copy only)
    'saveSnapshot': False,          # save the snapshot of the
                                    # source volume
    'priority': 1                   # taskPriorityEnum (does not
                                    # apply to online copy)
}
Raises:HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Invalid VV name or CPG name.
Raises:HTTPNotFound - NON_EXISTENT_CPG - The CPG does not exists.
Raises:HTTPForbidden - CPG_NOT_IN SAME_DOMAIN - The CPG is not in the current domain.
Raises:HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist
Raises:HTTPForbidden - VV_NOT_IN_SAME_DOMAIN - The volume is not in the same domain.
Raises:HTTPBadRequest - INV_INPUT_BAD_ENUM_VALUE - The priority value in not in the valid range(1-3).
Raises:HTTPConflict - EXISTENT_VOLUME - The volume already exists.
Raises:HTTPForbidden - INV_OPERATION_VV_SYS_VOLUME - The operation is not allowed on a system volume.
Raises:HTTPForbidden - INV_OPERATION_NON_BASE_VOLUME - The destination volume is not a base volume.
Raises:HTTPForbidden - INV_OPERATION_IN_REMOTE_COPY - The destination volume is involved in a remote copy.
Raises:HTTPForbidden - INV_OPERATION_VV_EXPORTED - The volume is exported.
Raises:HTTPForbidden - INV_OPERATION_VV_COPY_TO_SELF - The destination volume is the same as the parent.
Raises:HTTPForbidden - INV_OPERATION_VV_READONLY_SNAPSHOT - The parent volume is a read-only snapshot.
Raises:HTTPForbidden - INV_OPERATION_VV_COPY_TO_BASE - The destination volume is the base volume of a parent volume.
Raises:HTTPConflict - INV_OPERATION_VV_VOLUME_CONV_IN_PROGRESS - The volume is in a conversion operation.
Raises:HTTPForbidden - INV_OPERATION_VV_NO_SNAPSHOT_ALLOWED - The parent volume must allow snapshots.
Raises:HTTPConflict - INV_OPERATION_VV_ONLINE_COPY_IN_PROGRESS - The volume is the target of an online copy.
Raises:HTTPForbidden - INV_OPERATION_VV_CLEANUP_IN_PROGRESS - Cleanup of internal volume for the volume is in progress.
Raises:HTTPForbidden - INV_OPERATION_VV_CIRCULAR_COPY - The parent volume is a copy of the destination volume.
Raises:HTTPForbidden - INV_OPERATION_VV_PEER_VOLUME - The operation is not allowed on a peer volume.
Raises:HTTPForbidden - INV_OPERATION_VV_INTERNAL_VOLUME - The operation is not allowed on an internal volume.
Raises:HTTPForbidden - VV_IS_BEING_REMOVED - The volume is being removed.
Raises:HTTPForbidden - INV_OPERATION_VV_NOT_IN_NORMAL_STATE - The volume is not in the normal state.
Raises:HTTPForbidden - VV_IN_INCONSISTENT_STATE - The volume has an internal consistency error.
Raises:HTTPConflict - INV_OPERATION_VV_PCOPY_IN_PROGRESS - The destination volume has a physical copy in progress.
Raises:HTTPConflict - INV_OPERATION_VV_FAILED_ONLINE_COPY - Online copying of the destination volume has failed.
Raises:HTTPConflict - INV_OPERATION_VV_COPY_PARENT_TOO_BIG - The size of the parent volume is larger than the size of the destination volume.
Raises:HTTPForbidden - INV_OPERATION_VV_NO_PARENT - The volume has no physical parent.
Raises:HTTPConflict - IN_USE - The resynchronization snapshot is in a stale state.
Raises:HTTPForbidden - VV_IN_STALE_STATE - The volume is in a stale state.
Raises:HTTPNotFound - NON_EXISTENT_VVCOPY - Physical copy not found.
createSnapshot(name, copyOfName, optional=None)[source]

Create a snapshot of an existing Volume.

Parameters:
  • name (str) – Name of the Snapshot
  • copyOfName (str) – The volume you want to snapshot
  • optional (dict) – Dictionary of optional params
optional = {
    'id': 12,                   # Specifies the ID of the volume,
                                # next by default
    'comment': "some comment",
    'readOnly': True,           # Read Only
    'expirationHours': 36,      # time from now to expire
    'retentionHours': 12        # time from now to expire
}
Raises:HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist
Raises:HTTPForbidden - PERM_DENIED - Permission denied
getCPGs()[source]

Get entire list of CPGs.

Returns:list of cpgs
getCPG(name)[source]

Get information about a CPG.

Parameters:name (str) – The name of the CPG to find
Returns:cpg dict
Raises:HTTPNotFound - NON_EXISTENT_CPG - CPG doesn’t exist
getCPGAvailableSpace(name)[source]

Get available space information about a CPG.

Parameters:name (str) – The name of the CPG to find
Returns:Available space dict
info = {
    "rawFreeMiB": 1000000,    # Raw free capacity in MiB
    "usableFreeMiB": 5000     # LD free capacity in MiB
}
Raises:HTTPNotFound - NON_EXISTENT_CPG - CPG Not Found
createCPG(name, optional=None)[source]

Create a CPG.

Parameters:
  • name (str) – CPG Name
  • optional (dict) – Optional parameters
optional = {
    'growthIncrementMiB': 100,    # Growth increment in MiB for
                                  # each auto-grown operation
    'growthLimitMiB': 1024,       # Auto-grow operation is limited
                                  # to specified storage amount
    'usedLDWarningAlertMiB': 200, # Threshold to trigger warning
                                  # of used logical disk space
    'domain': 'MyDomain',         # Name of the domain object
    'LDLayout': {
        'RAIDType': 1,            # Disk Raid Type
        'setSize': 100,           # Size in number of chunklets
        'HA': 0,                  # Layout supports failure of
                                  # one port pair (1),
                                  # one cage (2),
                                  # or one magazine (3)
        'chunkletPosPref': 2,     # Chunklet location perference
                                  # characteristics.
                                  # Lowest Number/Fastest transfer
                                  # = 1
                                  # Higher Number/Slower transfer
                                  # = 2
        'diskPatterns': []}       # Patterns for candidate disks
}
Raises:HTTPBadRequest - INV_INPUT Invalid URI Syntax.
Raises:HTTPBadRequest - NON_EXISTENT_DOMAIN - Domain doesn’t exist.
Raises:HTTPBadRequest - NO_SPACE - Not Enough space is available.
Raises:HTTPBadRequest - BAD_CPG_PATTERN A Pattern in a CPG specifies illegal values.
Raises:HTTPForbidden - PERM_DENIED - Permission denied
Raises:HTTPConflict - EXISTENT_CPG - CPG Exists already
deleteCPG(name)[source]

Delete a CPG.

Parameters:name (str) – CPG Name
Raises:HTTPNotFound - NON_EXISTENT_CPG - CPG Not Found
Raises:HTTPForbidden - IN_USE - The CPG Cannot be removed because it’s in use.
Raises:HTTPForbidden - PERM_DENIED - Permission denied
getVLUNs()[source]

Get VLUNs.

Returns:Array of VLUNs
getVLUN(volumeName)[source]

Get information about a VLUN.

Parameters:volumeName – The volume name of the VLUN to find
Returns:VLUN
Raises:HTTPNotFound - NON_EXISTENT_VLUN - VLUN doesn’t exist
createVLUN(volumeName, lun=None, hostname=None, portPos=None, noVcn=None, overrideLowerPriority=None, auto=False)[source]

Create a new VLUN.

When creating a VLUN, the volumeName is required. The lun member is not required if auto is set to True. Either hostname or portPos (or both in the case of matched sets) is also required. The noVcn and overrideLowerPriority members are optional.

Parameters:
  • volumeName (str) – Name of the volume to be exported
  • lun (int) – The new LUN id
  • hostname (str) – Name of the host which the volume is to be exported.
  • portPos (dict) – ‘portPos’ (dict) - System port of VLUN exported to. It includes node number, slot number, and card port number
portPos = {'node': 1,   # System node (0-7)
           'slot': 2,   # PCI bus slot in the node (0-5)
           'port': 1}   # Port number on the FC card (0-4)
Parameters:
  • noVcn (bool) – A VLUN change notification (VCN) not be issued after export (-novcn). Default: False.
  • overrideLowerPriority (bool) – Existing lower priority VLUNs will be overridden (-ovrd). Use only if hostname member exists. Default: False.
Returns:

the location of the VLUN

deleteVLUN(volumeName, lunID, hostname=None, port=None)[source]

Delete a VLUN.

Parameters:
  • volumeName – the volume name of the VLUN
  • lunID (int) – The LUN ID
  • hostname (str) – Name of the host which the volume is exported. For VLUN of port type,the value is empty
  • port (dict) – Specifies the system port of the VLUN export. It includes the system node number, PCI bus slot number, and card port number on the FC card in the format <node>:<slot>:<cardPort>
port = {'node': 1,   # System node (0-7)
        'slot': 2,   # PCI bus slot in the node (0-5)
        'port': 1}   # Port number on the FC card (0-4)
Raises:HTTPBadRequest - INV_INPUT_MISSING_REQUIRED - Incomplete VLUN info. Missing volumeName or lun, or both hostname and port.
Raises:HTTPBadRequest - INV_INPUT_PORT_SELECTION - Specified port is invalid.
Raises:HTTPBadRequest - INV_INPUT_EXCEEDS_RANGE - The LUN specified exceeds expected range.
Raises:HTTPNotFound - NON_EXISTENT_HOST - The host does not exist
Raises:HTTPNotFound - NON_EXISTENT_VLUN - The VLUN does not exist
Raises:HTTPNotFound - NON_EXISTENT_PORT - The port does not exist
Raises:HTTPForbidden - PERM_DENIED - Permission denied
findHostSet(name)[source]

Find the Host Set name for a host.

Parameters:name (str) – the host name
getHostSets()[source]

Get information about every Host Set on the 3Par array

Returns:list of Host Sets
getHostSet(name)[source]

Get information about a Host Set

Parameters:name (str) – The name of the Host Set to find
Returns:host set dict
Raises:HTTPNotFound - NON_EXISTENT_SET - The set does not exist
createHostSet(name, domain=None, comment=None, setmembers=None)[source]

This creates a new host set

Parameters:
  • name – the host set to create
  • domain (str) – the domain where the set lives
  • comment (str) – a comment for the host set
  • setmembers – the hosts to add to the host set, the existence

of the host will not be checked :type setmembers: list of str :returns: id of host set created :rtype: str

Raises:HTTPBadRequest - EXISTENT_SET - The set already exits.
Raises:HTTPConflict - MEMBER_IN_DOMAINSET - The host is in a domain set.
Raises:HTTPConflict - MEMBER_IN_SET - The object is already part of the set.
Raises:HTTPConflict - MEMBER_NOT_IN_SAME_DOMAIN - Objects must be in the same domain to perform this operation.
Raises:HTTPNotFound - NON_EXISTENT_HOST - The host does not exists.
Raises:HTTPBadRequest - INV_INPUT_DUP_NAME - Invalid input (duplicate name).
deleteHostSet(name)[source]

This removes a host set.

Parameters:name (str) – the host set to remove
Raises:HTTPNotFound - NON_EXISTENT_SET - The set does not exists.
Raises:HTTPConflict - EXPORTED_VLUN - The host set has exported VLUNs.
modifyHostSet(name, action=None, newName=None, comment=None, setmembers=None)[source]

This modifies a host set by adding or removing a hosts from the set. It’s action is based on the enums SET_MEM_ADD or SET_MEM_REMOVE.

Parameters:
  • name (str) – the host set name
  • action (enum) – add or remove host(s) from the set
  • newName (str) – new name of set
  • comment (str) – new comment for the set
  • setmembers (list str) – the host(s) to add to the set, the existence of the host(s) will not be checked
Returns:

headers - dict of HTTP Response headers. Upon successful modification of a host set HTTP code 200 OK is returned and the URI of the updated host set will be returned in the location portion of the headers.

Returns:

body - the body of the response. None if successful.

Raises:

HTTPBadRequest - EXISTENT_SET - The set already exits.

Raises:

HTTPNotFound - NON_EXISTENT_SET - The set does not exists.

Raises:

HTTPConflict - MEMBER_IN_DOMAINSET - The host is in a domain set.

Raises:

HTTPConflict - MEMBER_IN_SET - The object is already part of the set.

Raises:

HTTPNotFound - MEMBER_NOT_IN_SET - The object is not part of the set.

Raises:

HTTPConflict - MEMBER_NOT_IN_SAME_DOMAIN - Objects must be in the same domain to perform this operation.

Raises:

HTTPBadRequest - INV_INPUT_DUP_NAME - Invalid input (duplicate name).

Raises:

HTTPBadRequest - INV_INPUT_PARAM_CONFLICT - Invalid input (parameters cannot be present at the same time).

Raises:

HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Invalid contains one or more illegal characters.

addHostToHostSet(set_name, name)[source]

This adds a host to a host set.

Parameters:
  • set_name (str) – the host set name
  • name (str) – the host name to add
Returns:

headers - dict of HTTP Response headers. Upon successful modification of a host set HTTP code 200 OK is returned and the URI of the updated host set will be returned in the location portion of the headers.

Returns:

body - the body of the response. None if successful.

removeHostFromHostSet(set_name, name)[source]

Remove a host from a host set.

Parameters:
  • set_name (str) – the host set name
  • name (str) – the host name to remove
Returns:

headers - dict of HTTP Response headers. Upon successful modification of a host set HTTP code 200 OK is returned and the URI of the updated host set will be returned in the location portion of the headers.

Returns:

body - the body of the response. None if successful.

removeHostFromItsHostSet(name)[source]

Remove a host from its host set if it is a member of one.

Parameters:name (str) – the host name to remove
Returns:None if host has no host set, else (headers, body)
Returns:headers - dict of HTTP Response headers. Upon successful modification of a host set HTTP code 200 OK is returned and the URI of the updated host set will be returned in the location portion of the headers.
Returns:body - the body of the response. None if successful.
createHost(name, iscsiNames=None, FCWwns=None, optional=None)[source]

Create a new Host entry.

Parameters:
  • name (array) – The name of the host
  • iscsiNames – Array if iscsi iqns
  • FCWwns – Array if Fibre Channel World Wide Names
  • optional (dict) – The optional stuff
optional = {
    'persona': 1,                   # ID of the persona to assign
                                    # to the host.
                                    # 3.1.3 default: Generic-ALUA
                                    # 3.1.2 default: General
    'domain': 'myDomain',           # Create the host in the
                                    # specified domain, or default
                                    # domain if unspecified.
    'forceTearDown': False,         # If True, force to tear down
                                    # low-priority VLUN exports.
    'descriptors':
        {'location': 'earth',       # The host's location
         'IPAddr': '10.10.10.10',   # The host's IP address
         'os': 'linux',             # The operating system running
                                    # on the host.
         'model': 'ex',             # The host's model
         'contact': 'Smith',        # The host's owner and contact
         'comment': "Joe's box"}    # Additional host information
}
Raises:HTTPForbidden - PERM_DENIED - Permission denied
Raises:HTTPBadRequest - INV_INPUT_MISSING_REQUIRED - Name not specified.
Raises:HTTPBadRequest - INV_INPUT_PARAM_CONFLICT - FCWWNs and iSCSINames are both specified.
Raises:HTTPBadRequest - INV_INPUT_EXCEEDS_LENGTH - Host name, domain name, or iSCSI name is too long.
Raises:HTTPBadRequest - INV_INPUT_EMPTY_STR - Input string (for domain name, iSCSI name, etc.) is empty.
Raises:HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Any error from host-name or domain-name parsing.
Raises:HTTPBadRequest - INV_INPUT_TOO_MANY_WWN_OR_iSCSI - More than 1024 WWNs or iSCSI names are specified.
Raises:HTTPBadRequest - INV_INPUT_WRONG_TYPE - The length of WWN is not 16. WWN specification contains non-hexadecimal digit.
Raises:HTTPConflict - EXISTENT_PATH - host WWN/iSCSI name already used by another host
Raises:HTTPConflict - EXISTENT_HOST - host name is already used.
Raises:HTTPBadRequest - NO_SPACE - No space to create host.
modifyHost(name, mod_request)[source]

Modify an existing Host entry.

Parameters:
  • name (str) – The name of the host
  • mod_request (dict) – Objects for Host Modification Request
mod_request = {
    'newName': 'myNewName',         # New name of the host
    'pathOperation': 1,             # If adding, adds the WWN or
                                    # iSCSI name to the existing
                                    # host.
    'FCWWNs': [],                   # One or more WWN to set for
                                    # the host.
    'iSCSINames': [],               # One or more iSCSI names to
                                    # set for the host.
    'forcePathRemoval': False,      # If True, remove SSN(s) or
                                    # iSCSI(s) even if there are
                                    # VLUNs exported to host
    'persona': 1,                   # ID of the persona to modify
                                    # the host's persona to.
    'descriptors':
        {'location': 'earth',       # The host's location
         'IPAddr': '10.10.10.10',   # The host's IP address
         'os': 'linux',             # The operating system running
                                    # on the host.
         'model': 'ex',             # The host's model
         'contact': 'Smith',        # The host's owner and contact
         'comment': 'Joes box'}     # Additional host information
    'chapOperation': HOST_EDIT_ADD, # Add or remove
    'chapOperationMode': CHAP_INITIATOR, # Initator or target
    'chapName': 'MyChapName',       # The chap name
    'chapSecret': 'xyz',            # The chap secret for the host
                                    # or the target
    'chapSecretHex': False,         # If True, the chapSecret is
                                    # treated as Hex.
    'chapRemoveTargetOnly': True    # If True, then remove target
                                    # chap only
}
Raises:HTTPBadRequest - INV_INPUT - Missing host name.
Raises:HTTPBadRequest - INV_INPUT_PARAM_CONFLICT - Both iSCSINames & FCWWNs are specified. (lot of other possibilities)
Raises:HTTPBadRequest - INV_INPUT_ONE_REQUIRED - iSCSINames or FCWwns missing.
Raises:HTTPBadRequest - INV_INPUT_ONE_REQUIRED - No path operation specified.
Raises:HTTPBadRequest - INV_INPUT_BAD_ENUM_VALUE - Invalid enum value.
Raises:HTTPBadRequest - INV_INPUT_MISSING_REQUIRED - Required fields missing.
Raises:HTTPBadRequest - INV_INPUT_EXCEEDS_LENGTH - Host descriptor argument length, new host name, or iSCSI name is too long.
Raises:HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Error parsing host or iSCSI name.
Raises:HTTPConflict - EXISTENT_HOST - New host name is already used.
Raises:HTTPNotFound - NON_EXISTENT_HOST - Host to be modified does not exist.
Raises:HTTPBadRequest - INV_INPUT_TOO_MANY_WWN_OR_iSCSI - More than 1024 WWNs or iSCSI names are specified.
Raises:HTTPBadRequest - INV_INPUT_WRONG_TYPE - Input value is of the wrong type.
Raises:HTTPConflict - EXISTENT_PATH - WWN or iSCSI name is already claimed by other host.
Raises:HTTPBadRequest - INV_INPUT_BAD_LENGTH - CHAP hex secret length is not 16 bytes, or chap ASCII secret length is not 12 to 16 characters.
Raises:HTTPNotFound - NO_INITIATOR_CHAP - Setting target CHAP without initiator CHAP.
Raises:HTTPNotFound - NON_EXISTENT_CHAP - Remove non-existing CHAP.
Raises:HTTPConflict - NON_UNIQUE_CHAP_SECRET - CHAP secret is not unique.
Raises:HTTPConflict - EXPORTED_VLUN - Setting persona with active export; remove a host path on an active export.
Raises:HTTPBadRequest - NON_EXISTENT_PATH - Remove a non-existing path.
Raises:HTTPConflict - LUN_HOSTPERSONA_CONFLICT - LUN number and persona capability conflict.
Raises:HTTPBadRequest - INV_INPUT_DUP_PATH - Duplicate path specified.
getHosts()[source]

Get information about every Host on the 3Par array.

Returns:list of Hosts
getHost(name)[source]

Get information about a Host.

Parameters:name (str) – The name of the Host to find
Returns:host dict
Raises:HTTPNotFound - NON_EXISTENT_HOST - HOST doesn’t exist
findHost(iqn=None, wwn=None)[source]

Find a host from an iSCSI initiator or FC WWN.

Parameters:
  • iqn (str) – lookup based on iSCSI initiator
  • wwn (str) – lookup based on WWN
queryHost(iqns=None, wwns=None)[source]

Find a host from an iSCSI initiator or FC WWN.

Parameters:
  • iqns (list) – lookup based on iSCSI initiator list
  • wwns (list) – lookup based on WWN list
Raises:

HTTPBadRequest - INV_INPUT - Invalid URI syntax.

Raises:

HTTPNotFound - NON_EXISTENT_HOST - HOST Not Found

Raises:

HTTPInternalServerError - INTERNAL_SERVER_ERR - Internal server error.

Raises:

HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Host name contains invalid character.

deleteHost(name)[source]

Delete a Host.

Parameters:name (str) – Host Name
Raises:HTTPNotFound - NON_EXISTENT_HOST - HOST Not Found
Raises:HTTPForbidden - IN_USE - The HOST Cannot be removed because it’s in use.
Raises:HTTPForbidden - PERM_DENIED - Permission denied
getHostVLUNs(hostName)[source]

Get all of the VLUNs on a specific Host.

Parameters:hostName – Host name
Raises:HTTPNotFound - NON_EXISTENT_HOST - HOST Not Found
getPorts()[source]

Get the list of ports on the 3PAR.

Returns:list of Ports
getFCPorts(state=None)[source]

Get a list of Fibre Channel Ports.

Returns:list of Fibre Channel Ports
getiSCSIPorts(state=None)[source]

Get a list of iSCSI Ports.

Returns:list of iSCSI Ports
getIPPorts(state=None)[source]

Get a list of IP Ports.

Returns:list of IP Ports
findVolumeSet(name)[source]

Find the first Volume Set that contains a target volume. If a volume set other than the first one found is desired use findAllVolumeSets and search the results.

Parameters:name (str) – the volume name
Returns:The name of the first volume set that contains the target

volume, otherwise None.

findAllVolumeSets(name)[source]

Return a list of every Volume Set the given volume is a part of. The list can contain zero, one, or multiple items.

Parameters:name (str) – the volume name
Returns:a list of Volume Set dicts
vvset_names = [{
    'name': "volume_set_1",       # The name of the volume set
    'comment': 'Samplet VVSet',   # The volume set's comment
    'domain': 'my_domain',        # The volume set's domain
    'setmembers': ['V1', 'V2']    # List of strings containing
                                  # the volumes that are members
                                  # of this volume set
},
...
]
Raises:HTTPForbidden - VV_IN_INCONSISTENT_STATE - Internal inconsistency error in vol
Raises:HTTPForbidden - VV_IS_BEING_REMOVED - The volume is being removed
Raises:HTTPNotFound - NON_EXISTENT_VOLUME - The volume does not exists
Raises:HTTPForbidden - INV_OPERATION_VV_SYS_VOLUME - Illegal op on system vol
Raises:HTTPForbidden - INV_OPERATION_VV_INTERNAL_VOLUME - Illegal op on internal vol
getVolumeSet(name)[source]

Get information about a Volume Set

Parameters:name (str) – The name of the Volume Set to find
Returns:Volume Set
Raises:HTTPNotFound - NON_EXISTENT_SET - The set doesn’t exist
getVolumeSets()[source]

Get Volume Sets

Returns:Array of Volume Sets
createVolumeSet(name, domain=None, comment=None, setmembers=None)[source]

This creates a new volume set

Parameters:
  • name – the volume set to create
  • domain (str) – the domain where the set lives
  • comment (str) – the comment for on the vv set
  • setmembers – the vv to add to the set, the existence of the vv

will not be checked :type setmembers: array

Raises:HTTPBadRequest - EXISTENT_SET - The set already exits.
Raises:HTTPConflict - MEMBER_IN_DOMAINSET - The host is in a domain set.
Raises:HTTPConflict - MEMBER_IN_SET - The object is already part of the set.
Raises:HTTPConflict - MEMBER_NOT_IN_SAME_DOMAIN - Objects must be in the same domain to perform this operation.
Raises:HTTPForbidden - VV_IN_INCONSISTENT_STATE - The volume has an internal inconsistency error.
Raises:HTTPForbidden - VV_IS_BEING_REMOVED - The volume is being removed.
Raises:HTTPNotFound - NON_EXISTENT_VOLUME - The volume does not exists.
Raises:HTTPNotFound - NON_EXISTENT_HOST - The host does not exists.
Raises:HTTPForbidden - INV_OPERATION_VV_SYS_VOLUME - The operation is not allowed on a system volume.
Raises:HTTPForbidden - INV_OPERATION_VV_INTERNAL_VOLUME - The operation is not allowed on an internal volume.
Raises:HTTPBadRequest - INV_INPUT_DUP_NAME - Invalid input (duplicate name).
deleteVolumeSet(name)[source]

This removes a volume set. You must clear all QOS rules before a volume set can be deleted.

Parameters:name (str) – the volume set to remove
Raises:HTTPNotFound - NON_EXISTENT_SET - The set does not exists.
Raises:HTTPConflict - EXPORTED_VLUN - The host set has exported VLUNs. The VV set was exported.
Raises:HTTPConflict - VVSET_QOS_TARGET - The object is already part of the set.
modifyVolumeSet(name, action=None, newName=None, comment=None, flashCachePolicy=None, setmembers=None)[source]

This modifies a volume set by adding or remove a volume from the volume set. It’s actions is based on the enums SET_MEM_ADD or SET_MEM_REMOVE.

Parameters:
  • action (enum) – add or remove volume from the set
  • name (str) – the volume set name
  • newName (str) – new name of set
  • comment (FLASH_CACHED_ENABLED or FLASH_CACHE_DISABLED) – the comment for on the vv set
  • flashCachePolicy – the flash-cache policy for the vv set
  • setmembers (array) – the vv to add to the set, the existence of the vv will not be checked
Raises:

HTTPBadRequest - EXISTENT_SET - The set already exits.

Raises:

HTTPNotFound - NON_EXISTENT_SET - The set does not exists.

Raises:

HTTPConflict - MEMBER_IN_DOMAINSET - The host is in a domain set.

Raises:

HTTPConflict - MEMBER_IN_SET - The object is already part of the set.

Raises:

HTTPNotFound - MEMBER_NOT_IN_SET - The object is not part of the set.

Raises:

HTTPConflict - MEMBER_NOT_IN_SAME_DOMAIN - Objects must be in the same domain to perform this operation.

Raises:

HTTPForbidden - VV_IN_INCONSISTENT_STATE - The volume has an internal inconsistency error.

Raises:

HTTPForbidden - VV_IS_BEING_REMOVED - The volume is being removed.

Raises:

HTTPNotFound - NON_EXISTENT_VOLUME - The volume does not exists.

Raises:

HTTPForbidden - INV_OPERATION_VV_SYS_VOLUME - The operation is not allowed on a system volume.

Raises:

HTTPForbidden - INV_OPERATION_VV_INTERNAL_VOLUME - The operation is not allowed on an internal volume.

Raises:

HTTPBadRequest - INV_INPUT_DUP_NAME - Invalid input (duplicate name).

Raises:

HTTPBadRequest - INV_INPUT_PARAM_CONFLICT - Invalid input (parameters cannot be present at the same time).

Raises:

HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Invalid contains one or more illegal characters.

addVolumeToVolumeSet(set_name, name)[source]

This adds a volume to a volume set

Parameters:
  • set_name (str) – the volume set name
  • name (str) – the volume name to add
removeVolumeFromVolumeSet(set_name, name)[source]

Remove a volume from a volume set

Parameters:
  • set_name (str) – the volume set name
  • name (str) – the volume name to add
createSnapshotOfVolumeSet(name, copyOfName, optional=None)[source]

Create a snapshot of an existing Volume Set.

Parameters:
  • name (str) – Name of the Snapshot. The vvname pattern is described in “VV Name Patterns” in the HP 3PAR Command Line Interface Reference, which is available at the following website: http://www.hp.com/go/storage/docs
  • copyOfName (str) – The volume set you want to snapshot
  • optional (dict) – Dictionary of optional params
optional = {
    'id': 12,                   # Specifies ID of the volume set
                                # set, next by default
    'comment': "some comment",
    'readOnly': True,           # Read Only
    'expirationHours': 36,      # time from now to expire
    'retentionHours': 12        # time from now to expire
}
Raises:HTTPBadRequest - INVALID_INPUT_VV_PATTERN - Invalid volume pattern specified
Raises:HTTPNotFound - NON_EXISTENT_SET - The set does not exist
Raises:HTTPNotFound - EMPTY_SET - The set is empty
Raises:HTTPServiceUnavailable - VV_LIMIT_REACHED - Maximum number of volumes reached
Raises:HTTPNotFound - NON_EXISTENT_VOL - The storage volume does not exist
Raises:HTTPForbidden - VV_IS_BEING_REMOVED - The volume is being removed
Raises:HTTPForbidden - INV_OPERATION_VV_READONLY_TO_READONLY_SNAP - Creating a read-only copy from a read-only volume is not permitted
Raises:HTTPConflict - NO_SNAP_CPG - No snapshot CPG has been configured for the volume
Raises:HTTPBadRequest - INV_INPUT_DUP_NAME - Invalid input (duplicate name).
Raises:HTTPForbidden - INV_OPERATION_VV_SNAP_PARENT_SAME_BASE - Two parent snapshots share thesame base volume
Raises:HTTPConflict - INV_OPERATION_VV_ONLINE_COPY_IN_PROGRESS - Invalid operation. Online copyis in progress
Raises:HTTPServiceUnavailable - VV_ID_LIMIT_REACHED - Max number of volumeIDs has been reached
Raises:HTTPNotFound - NON_EXISTENT_VOLUME - The volume does not exists
Raises:HTTPForbidden - VV_IN_STALE_STATE - The volume is in a stale state.
Raises:HTTPForbidden - VV_NOT_STARTED - Volume is not started
Raises:HTTPForbidden - VV_UNAVAILABLE - The volume is not accessible
Raises:HTTPServiceUnavailable - SNAPSHOT_LIMIT_REACHED - Max number of snapshots has been reached
Raises:HTTPServiceUnavailable - CPG_ALLOCATION_WARNING_REACHED - The CPG has reached the allocation warning
Raises:HTTPConflict - INV_OPERATION_VV_VOLUME_CONV_IN_PROGRESS - Invalid operation: VV conversion is in progress.
Raises:HTTPForbidden - INV_OPERATION_VV_CLEANUP_IN_PROGRESS - Internal volume cleanup is in progress.
Raises:HTTPForbidden - INV_OPERATION_VV_PEER_VOLUME - Cannot modify a peer volume.
Raises:HTTPConflict - INV_OPERATION_VV_ONLINE_COPY_IN_PROGRESS - The volume is the target of an online copy.
Raises:HTTPForbidden - INV_OPERATION_VV_INTERNAL_VOLUME - Illegal op on internal vol
Raises:HTTPConflict - EXISTENT_ID - An ID exists
Raises:HTTPForbidden - INV_OPERATION_VV_NOT_IN_NORMAL_STATE - Volume state is not normal
Raises:HTTPForbidden - VV_IN_INCONSISTENT_STATE - Internal inconsistency error in vol
Raises:HTTPBadRequest - INV_INPUT_RETAIN_GT_EXPIRE - Retention time is greater than expiration time.
Raises:HTTPBadRequest - INV_INPUT_TIME - Invalid time specified.
Raises:HTTPForbidden - INV_OPERATION_SNAPSHOT_NOT_SAME_TYPE - Some snapshots in the volume set are read-only, some are read-write
setQOSRule(set_name, max_io=None, max_bw=None)[source]

Set a QOS Rule on a volume set

Parameters:
  • set_name (str) – the volume set name for the rule.
  • max_io (int) – the maximum IOPS value
  • max_bw – The maximum Bandwidth
queryQoSRule(targetName, targetType='vvset')[source]

Query a QoS rule

Parameters:
  • targetType (str) – target type is vvset or sys
  • targetName (str) – the name of the target. When targetType is sys, target name must be sys:all_others.
Raises:

HTTPNotFound - NON_EXISTENT_QOS_RULE - QoS rule does not exist.

Raises:

HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Illegal character in the input.

queryQoSRules()[source]

Get QoS Rules

Returns:Array of QoS Rules
createQoSRules(targetName, qosRules, target_type=1)[source]

Create QOS rules

The QoS rule can be applied to VV sets. By using sys:all_others, you can apply the rule to all volumes in the system for which no QoS rule has been defined.

ioMinGoal and ioMaxLimit must be used together to set I/O limits. Similarly, bwMinGoalKB and bwMaxLimitKB must be used together.

If ioMaxLimitOP is set to 2 (no limit), ioMinGoalOP must also be to set to 2 (zero), and vice versa. They cannot be set to ‘none’ individually. Similarly, if bwMaxLimitOP is set to 2 (no limit), then bwMinGoalOP must also be set to 2.

If ioMaxLimitOP is set to 1 (no limit), ioMinGoalOP must also be to set to 1 (zero) and vice versa. Similarly, if bwMaxLimitOP is set to 1 (zero), then bwMinGoalOP must also be set to 1.

The ioMinGoalOP and ioMaxLimitOP fields take precedence over the ioMinGoal and ioMaxLimit fields.

The bwMinGoalOP and bwMaxLimitOP fields take precedence over the bwMinGoalKB and bwMaxLimitKB fields

Parameters:
  • target_type (enum) – Type of QoS target, either enum TARGET_TYPE_VVS or TARGET_TYPE_SYS.
  • targetName (str) – the name of the target object on which the QoS rule will be created.
  • qosRules (dict) – QoS options
qosRules = {
    'priority': 2,         # priority enum
    'bwMinGoalKB': 1024,   # bandwidth rate minimum goal in
                           #   kilobytes per second
    'bwMaxLimitKB': 1024,  # bandwidth rate maximum limit in
                           #   kilobytes per second
    'ioMinGoal': 10000,    # I/O-per-second minimum goal
    'ioMaxLimit': 2000000, # I/0-per-second maximum limit
    'enable': True,        # QoS rule for target enabled?
    'bwMinGoalOP': 1,      # zero none operation enum, when set to
                           #   1, bandwidth minimum goal is 0
                           # when set to 2, the bandwidth mimumum
                           #   goal is none (NoLimit)
    'bwMaxLimitOP': 1,     # zero none operation enum, when set to
                           #   1, bandwidth maximum limit is 0
                           # when set to 2, the bandwidth maximum
                           #   limit is none (NoLimit)
    'ioMinGoalOP': 1,      # zero none operation enum, when set to
                           #   1, I/O minimum goal is 0
                           # when set to 2, the I/O minimum goal is
                           #   none (NoLimit)
    'ioMaxLimitOP': 1,     # zero none operation enum, when set to
                           #   1, I/O maximum limit is 0
                           # when set to 2, the I/O maximum limit
                           #   is none (NoLimit)
    'latencyGoal': 5000,   # Latency goal in milliseconds
    'defaultLatency': False # Use latencyGoal or defaultLatency?
}
Raises:HTTPBadRequest - INV_INPUT_EXCEEDS_RANGE - Invalid input: number exceeds expected range.
Raises:HTTPNotFound - NON_EXISTENT_QOS_RULE - QoS rule does not exists.
Raises:HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Illegal character in the input.
Raises:HTTPBadRequest - EXISTENT_QOS_RULE - QoS rule already exists.
Raises:HTTPBadRequest - INV_INPUT_MIN_GOAL_GRT_MAX_LIMIT - I/O-per-second maximum limit should be greater than the minimum goal.
Raises:HTTPBadRequest - INV_INPUT_BW_MIN_GOAL_GRT_MAX_LIMIT - Bandwidth maximum limit should be greater than the mimimum goal.
Raises:HTTPBadRequest - INV_INPUT_BELOW_RANGE - I/O-per-second limit is below range. Bandwidth limit is below range.
Raises:HTTPBadRequest - UNLICENSED_FEATURE - The system is not licensed for QoS.
modifyQoSRules(targetName, qosRules, targetType='vvset')[source]

Modify an existing QOS rules

The QoS rule can be applied to VV sets. By using sys:all_others, you can apply the rule to all volumes in the system for which no QoS rule has been defined.

ioMinGoal and ioMaxLimit must be used together to set I/O limits. Similarly, bwMinGoalKB and bwMaxLimitKB must be used together.

If ioMaxLimitOP is set to 2 (no limit), ioMinGoalOP must also be to set to 2 (zero), and vice versa. They cannot be set to ‘none’ individually. Similarly, if bwMaxLimitOP is set to 2 (no limit), then bwMinGoalOP must also be set to 2.

If ioMaxLimitOP is set to 1 (no limit), ioMinGoalOP must also be to set to 1 (zero) and vice versa. Similarly, if bwMaxLimitOP is set to 1 (zero), then bwMinGoalOP must also be set to 1.

The ioMinGoalOP and ioMaxLimitOP fields take precedence over the ioMinGoal and ioMaxLimit fields.

The bwMinGoalOP and bwMaxLimitOP fields take precedence over the bwMinGoalKB and bwMaxLimitKB fields

Parameters:
  • targetName (str) – the name of the target object on which the QoS rule will be created.
  • targetType (str) – Type of QoS target, either vvset or sys
  • qosRules (dict) – QoS options
qosRules = {
    'priority': 2,         # priority enum
    'bwMinGoalKB': 1024,   # bandwidth rate minimum goal in
                           # kilobytes per second
    'bwMaxLimitKB': 1024,  # bandwidth rate maximum limit in
                           # kilobytes per second
    'ioMinGoal': 10000,    # I/O-per-second minimum goal.
    'ioMaxLimit': 2000000, # I/0-per-second maximum limit
    'enable': True,        # QoS rule for target enabled?
    'bwMinGoalOP': 1,      # zero none operation enum, when set to
                           # 1, bandwidth minimum goal is 0
                           # when set to 2, the bandwidth minimum
                           # goal is none (NoLimit)
    'bwMaxLimitOP': 1,     # zero none operation enum, when set to
                           # 1, bandwidth maximum limit is 0
                           # when set to 2, the bandwidth maximum
                           # limit is none (NoLimit)
    'ioMinGoalOP': 1,      # zero none operation enum, when set to
                           # 1, I/O minimum goal minimum goal is 0
                           # when set to 2, the I/O minimum goal is
                           # none (NoLimit)
    'ioMaxLimitOP': 1,     # zero none operation enum, when set to
                           # 1, I/O maximum limit is 0
                           # when set to 2, the I/O maximum limit
                           # is none (NoLimit)
    'latencyGoal': 5000,   # Latency goal in milliseconds
    'defaultLatency': False # Use latencyGoal or defaultLatency?
}
Raises:HTTPBadRequest INV_INPUT_EXCEEDS_RANGE - Invalid input: number exceeds expected range.
Raises:HTTPNotFound NON_EXISTENT_QOS_RULE - QoS rule does not exists.
Raises:HTTPBadRequest INV_INPUT_ILLEGAL_CHAR - Illegal character in the input.
Raises:HTTPBadRequest EXISTENT_QOS_RULE - QoS rule already exists.
Raises:HTTPBadRequest INV_INPUT_IO_MIN_GOAL_GRT_MAX_LIMIT - I/O-per-second maximum limit should be greater than the minimum goal.
Raises:HTTPBadRequest INV_INPUT_BW_MIN_GOAL_GRT_MAX_LIMIT - Bandwidth maximum limit should be greater than the minimum goal.
Raises:HTTPBadRequest INV_INPUT_BELOW_RANGE - I/O-per-second limit is below range. Bandwidth limit is below range.
Raises:HTTPBadRequest UNLICENSED_FEATURE - The system is not licensed for QoS.
deleteQoSRules(targetName, targetType='vvset')[source]

Clear and Delete QoS rules.

Parameters:
  • targetType (str) – target type is vvset or sys
  • targetName (str) – the name of the target. When targetType is sys, target name must be sys:all_others.
Raises:

HTTPNotFound - NON_EXISTENT_QOS_RULE - QoS rule does not exist.

Raises:

HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Illegal character in the input

setVolumeMetaData(name, key, value)[source]

This is used to set a key/value pair metadata into a volume. If the key already exists on the volume the value will be updated.

Parameters:
  • name (str) – the volume name
  • key (str) – the metadata key name
  • value (str) – the metadata value
Raises:

HTTPBadRequest - INV_INPUT_EXCEEDS_LENGTH - Invalid input: string length exceeds limit.

Raises:

HTTPBadRequest - INV_INPUT_MISSING_REQUIRED - Required fields missing

Raises:

HTTPBadRequest - INV_INPUT_UNREC_NAME - Unrecognized name

Raises:

HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Illegal character in input

Raises:

HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist

getVolumeMetaData(name, key)[source]

This is used to get a key/value pair metadata from a volume.

Parameters:
  • name (str) – the volume name
  • key (str) – the metadata key name
Returns:

dict with the requested key’s data.

data = {
    # time of creation in seconds format
    'creationTimeSec': 1406074222
    # the date/time the key was added
    'date_added': 'Mon Jul 14 16:09:36 PDT 2014',
    'value': 'data'     # the value associated with the key
    'key': 'key_name'   # the key name
    # time of creation in date format
    'creationTime8601': '2014-07-22T17:10:22-07:00'
}
Raises:HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Illegal character in input
Raises:HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist
Raises:HTTPNotFound - NON_EXISTENT_OBJECT_KEY - Object key does not exist
getAllVolumeMetaData(name)[source]

This is used to get all key/value pair metadata from a volume.

Parameters:name (str) – the volume name
Returns:dict with all keys and associated data.
keys = {
    'total': 2,
    'members': [
        {
            # time of creation in seconds format
            'creationTimeSec': 1406074222
            # the date/time the key was added
            'date_added': 'Mon Jul 14 16:09:36 PDT 2014',
            'value': 'data'     # the value associated with the key
            'key': 'key_name'   # the key name
            # time of creation in date format
            'creationTime8601': '2014-07-22T17:10:22-07:00'
        },
        {
            # time of creation in seconds format
            'creationTimeSec': 1406074222
            # the date/time the key was added
            'date_added': 'Mon Jul 14 16:09:36 PDT 2014',
            'value': 'data'     # the value associated with the key
            'key': 'key_name_2' # the key name
            # time of creation in date format
            'creationTime8601': '2014-07-22T17:10:22-07:00'
        }
    ]
}
Raises:HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist
removeVolumeMetaData(name, key)[source]

This is used to remove a metadata key/value pair from a volume.

Parameters:
  • name (str) – the volume name
  • key (str) – the metadata key name
Returns:

None

Raises:

HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Illegal character in input

Raises:

HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist

Raises:

HTTPNotFound - NON_EXISTENT_OBJECT_KEY - Object key does not exist

findVolumeMetaData(name, key, value)[source]

Determines whether a volume contains a specific key/value pair.

Parameters:
  • name (str) – the volume name
  • key (str) – the metadata key name
  • value (str) – the metadata value
Returns:

bool

isOnlinePhysicalCopy(name)[source]

Is the volume being created by process of online copy?

Parameters:name (str) – the name of the volume
stopOnlinePhysicalCopy(name)[source]

Stopping a online physical copy operation.

Parameters:name (str) – the name of the volume
stopOfflinePhysicalCopy(name)[source]

Stopping a offline physical copy operation.

Parameters:name (str) – the name of the volume
Raises:HTTPBadRequest - INV_INPUT_ILLEGAL_CHAR - Invalid VV name or CPG name.
Raises:HTTPNotFound - NON_EXISTENT_CPG - The CPG does not exists.
Raises:HTTPForbidden - CPG_NOT_IN SAME_DOMAIN - The CPG is not in the current domain.
Raises:HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist
Raises:HTTPForbidden - VV_NOT_IN_SAME_DOMAIN - The volume is not in the same domain.
Raises:HTTPBadRequest - INV_INPUT_BAD_ENUM_VALUE - The priority value in not in the valid range(1-3).
Raises:HTTPConflict - EXISTENT_VOLUME - The volume already exists.
Raises:HTTPForbidden - INV_OPERATION_VV_SYS_VOLUME - The operation is not allowed on a system volume.
Raises:HTTPForbidden - INV_OPERATION_NON_BASE_VOLUME - The destination volume is not a base volume.
Raises:HTTPForbidden - INV_OPERATION_IN_REMOTE_COPY - The destination volume is involved in a remote copy.
Raises:HTTPForbidden - INV_OPERATION_VV_EXPORTED - The volume is exported.
Raises:HTTPForbidden - INV_OPERATION_VV_COPY_TO_SELF - The destination volume is the same as the parent.
Raises:HTTPForbidden - INV_OPERATION_VV_READONLY_SNAPSHOT - The parent volume is a read-only snapshot.
Raises:HTTPForbidden - INV_OPERATION_VV_COPY_TO_BASE - The destination volume is the base volume of a parent volume.
Raises:HTTPConflict - INV_OPERATION_VV_VOLUME_CONV_IN_PROGRESS - The volume is in a conversion operation.
Raises:HTTPForbidden - INV_OPERATION_VV_NO_SNAPSHOT_ALLOWED - The parent volume must allow snapshots.
Raises:HTTPConflict - INV_OPERATION_VV_ONLINE_COPY_IN_PROGRESS - The volume is the target of an online copy.
Raises:HTTPForbidden - INV_OPERATION_VV_CLEANUP_IN_PROGRESS - Cleanup of internal volume for the volume is in progress.
Raises:HTTPForbidden - INV_OPERATION_VV_CIRCULAR_COPY - The parent volume is a copy of the destination volume.
Raises:HTTPForbidden - INV_OPERATION_VV_PEER_VOLUME - The operation is not allowed on a peer volume.
Raises:HTTPForbidden - INV_OPERATION_VV_INTERNAL_VOLUME - The operation is not allowed on an internal volume.
Raises:HTTPForbidden - VV_IS_BEING_REMOVED - The volume is being removed.
Raises:HTTPForbidden - INV_OPERATION_VV_NOT_IN_NORMAL_STATE - The volume is not in the normal state.
Raises:HTTPForbidden - VV_IN_INCONSISTENT_STATE - The volume has an internal consistency error.
Raises:HTTPConflict - INV_OPERATION_VV_PCOPY_IN_PROGRESS - The destination volume has a physical copy in progress.
Raises:HTTPConflict - INV_OPERATION_VV_FAILED_ONLINE_COPY - Online copying of the destination volume has failed.
Raises:HTTPConflict - INV_OPERATION_VV_COPY_PARENT_TOO_BIG - The size of the parent volume is larger than the size of the destination volume.
Raises:HTTPForbidden - INV_OPERATION_VV_NO_PARENT - The volume has no physical parent.
Raises:HTTPConflict - IN_USE - The resynchronization snapshot is in a stale state.
Raises:HTTPForbidden - VV_IN_STALE_STATE - The volume is in a stale state.
Raises:HTTPNotFound - NON_EXISTENT_VVCOPY - Physical copy not found.
getAllTasks()[source]

Get the list of all Tasks

Returns:list of all Tasks
getTask(taskId)[source]

Get the status of a task.

Parameters:taskId (int) – the task id
Returns:the status of the task
Raises:HTTPBadRequest - INV_INPUT_BELOW_RANGE - Bad Request Task ID must be a positive value.
Raises:HTTPBadRequest - INV_INPUT_EXCEEDS_RANGE - Bad Request Task ID is too large.
Raises:HTTPNotFound - NON_EXISTENT_TASK - Task with the specified task ID does not exist.
Raises:HTTPBadRequest - INV_INPUT_WRONG_TYPE - Task ID is not an integer.
getPatches(history=True)[source]

Get all the patches currently affecting the system.

Parameters:history – Specify the history of all patches and updates applied to the system.
Returns:dict with total and members (see convert_cli_output_to_collection_like_wsapi())
getPatch(patch_id)[source]
Get details on a specified patch ID if it has been applied to the
system.
Parameters:patch_id – The ID of the patch.
Returns:list of str (raw lines of CLI output as strings)
getCPGStatData(name, interval='daily', history='7d')[source]

Requests CPG performance data at a sampling rate (interval) for a given length of time to sample (history)

Parameters:
  • name (str) – a valid CPG name
  • interval (str) – hourly, or daily
  • history (str) – xm for x minutes, xh for x hours, or xd for x days (e.g. 30m, 1.5h, 7d)
Returns:

dict

Raises:

SrstatldException - srstatld gives invalid output

getVolumeSnapshots(name)[source]

Shows all snapshots associated with a given volume.

Parameters:name (str) – The volume name
Returns:List of snapshot names

Previous topic

client – HP3ParClient

Next topic

exceptions – HTTP Exceptions

This Page