client
– HPE3ParClient
HPE 3PAR 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 hpe3parclient.client.HPE3ParClient(api_url, secure=False, timeout=None, suppress_ssl_warnings=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
- 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.
- 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. For the primera array there is support for only thin and DECO volume. To create DECO volume ‘tdvv’ and ‘compression’ both must be True. If only one of them is specified, it results in HTTPBadRequest.
- 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, appType=None)[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.
- promoteVirtualCopy(snapshot, optional=None)[source]
Revert a volume to snapshot.
- Parameters
snapshot (str) – the snapshot name
optional (dict) – Dictionary of optional params
optional = { 'online': False, # should execute promote # operation on online volume? 'allowRemoteCopyParent': 'False', # allow promote operation if # volume is in remote copy # volume group? 'priority': 1 # taskPriorityEnum (does not # apply to online copy) }
- Raises
HTTPForbidden
- VV_NOT_STARTED - Volume is not started.- Raises
HTTPForbidden
- VV_IS_BEING_REMOVED - The volume is being removed.- Raises
HTTPForbidden
- VV_IN_STALE_STATE - The volume is in a stale state.- Raises
HTTPForbidden
- INV_OPERATION_CANNOT_STOP_ONLINE_PROMOTE - The online promote cannot be stopped.- Raises
HTTPConflict
- INV_OPERATION_VV_BASE_VOLUME - The volume is a base volume.- Raises
HTTPConflict
- INV_OPERATION_VV_PCOPY_IN_PROGRESS - The destination volume has a physical copy in progress.- Raises
HTTPForbidden
- INV_OPERATION_PARENT_PCOPY_IN_PROGRESS - The parent is involved in a physical copy.- Raises
HTTPConflict
- INV_OPERATION_VV_TUNE_IN_PROGRESS - Volume tuning is in progress.- Raises
HTTPForbidden
- INV_OPERATION_VV_IN_REMOTE_COPY - The volume is involved in Remote Copy.- Raises
HTTPForbidden
- INV_OPERATION_PARENT_VV_EXPORTED - Parent volume is exported.- Raises
HTTPForbidden
- INV_OPERATION_VV_EXPORTED - Parent volume is exported.- Raises
HTTPForbidden
- INV_OPERATION_PROMOTE_TARGET_NOT_BASE_VV - The promote target is not a base volume.- Raises
HTTPConflict
- INV_OPERATION_PARENT_SIZE_HAS_INCREASED - The parent volume size has increased.- Raises
HTTPConflict
- INV_OPERATION_PARAM_CONFLICT - Parameters cannot be present at the same time.- Raises
HTTPConflict
- INV_OPERATION_VV_IS_BUSY - Volume is currently busy.- Raises
HTTPConflict
- INV_OPERATION_VV_PROMOTE_IN_PROGRESS - Volume promotion is in progress.- Raises
HTTPConflict
- INV_OPERATION_VV_PROMOTE_IS_NOT_IN_PROGRESS - Volume promotion is not in progress.
- 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 'addToSet': "", # The name of the volume set to which the system # adds your created snapshots. # If does not exist, it will be created. 'syncSnapRcopy': False # When this is set to true, synchronous snapshots are # taken of a volume in a remote copy group. }
- Raises
HTTPNotFound
- NON_EXISTENT_VOL - The volume does not exist- Raises
HTTPForbidden
- PERM_DENIED - Permission denied- Raises
HTTPForbidden
- INV_OPERATION_VV_READONLY_RCOPY - syncSnapRcopy can only be used in the creation of read-only snapshots
- 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
- 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
- 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.
- 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
- getFCPorts(state=None)[source]
Get a list of Fibre Channel Ports.
- Returns
list of Fibre Channel 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
- 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 (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
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 HPE 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 'match': False, # By default, all snapshots are created read-write. # Match the read-only or read-write setting of parent. # Do not combine the readOnly and match options. 'expirationHours': 36, # time from now to expire 'retentionHours': 12, # time from now to expire 'addToSet': "" # The name of the volume set to which the system # adds your created snapshots. # If does not exist, it will be created. }
- 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.
- 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.
- resyncPhysicalCopy(volume_name)[source]
Resynchronizes a physical copy.
- Parameters
volume_name (string) – The name of the volume
- 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
- getRemoteCopyInfo()[source]
Querying Overall Remote-Copy Information
- Returns
Overall Remote Copy Information
- getRemoteCopyGroups()[source]
Returns information on all Remote Copy Groups
- Returns
list of Remote Copy Groups
- getRemoteCopyGroup(name)[source]
Returns information on one Remote Copy Group
- Parameters
name (str) – the remote copy group name
- Returns
Remote Copy Group
- createRemoteCopyGroup(name, targets, optional=None)[source]
Creates a remote copy group
- Parameters
name (str) – the remote copy group name
targets (list) – Specifies the attributes of the target of the remote-copy group.
optional (dict) – dict of other optional items
targets = [ { "targetName": "name", # Target name associated with # the remote-copy group to be # created "mode": 2, # Specifies the volume group # mode. # 1 - The remote-copy group mode # is synchronous. # 2 - The remote-copy group mode # is periodic. Deprecated, use 3 # 3 - The remote-copy group mode # is periodic. # 4 - Remote-copy group mode is # asynchronous. "userCPG": "SOME_CPG", # Specifies the user CPG # that will be used for # volumes that are # autocreated on the # target. "snapCPG": "SOME_SNAP_CPG" # Specifies the snap CPG # that will be used for # volumes that are # autocreated on the # target. } ] optional = { "localSnapCPG" : "SNAP_CPG", # Specifies the local snap # CPG that will be used for # volumes that are autocreated. "localUserCPG" : "SOME_CPG", # Specifies the local user # CPG that will be used for # volumes that are autocreated. "domain" : "some-domain" # Specifies the attributes of # the target of the # remote-copy group. }
- Raises
HTTPBadRequest
- INV_INPUT_ILLEGAL_CHAR - Invalid character in the remote-copy group or volume name.- Raises
HTTPNotFound
- EXISTENT_RCOPY_GROUP - The remote-copy group already exists.- Raises
HTTPConflict
- RCOPY_GROUP_TOO_MANY_TARGETS - Too many remote-copy group targets have been specified.- Raises
HTTPBadRequest
- INV_INPUT_BAD_ENUM_VALUE - The mode is not valid.- Raises
HTTPBadRequest
- RCOPY_GROUP_TARGET_NOT_UNIQUE - The remote-copy group target is not unique.- Raises
HTTPForbidden
- RCOPY_IS_NOT_READY - The remote-copy configuration is not ready for commands.- Raises
HTTPForbidden
- RCOPY_GROUP_MODE_NOT_SUPPORTED - The remote-copy group mode is not supported.- Raises
HTTPConflict
- RCOPY_GROUP_MAX_GROUP_REACHED_PERIODIC - The maximum number of remote-copy groups in periodic mode has been reached.- Raises
HTTPConflict
- RCOPY_GROUP_MAX_GROUP_REACHED_PERIODIC - The maximum number of remote-copy groups in periodic mode has been reached.- Raises
HTTPForbidden
- RCOPY_GROUP_SECONDARY_GROUP_MORE_THAN_ONE_BACKUP_TARGET - Secondary groups should have only one target that is not a backup.- Raises
HTTPServiceUnavailable
- RCOPY_GROUP_MORE_THAN_ONE_SYNC_TARGET - Remote-copy groups can have no more than one synchronous-mode target.- Raises
HTTPServiceUnavailable
- RCOPY_GROUP_MORE_THAN_ONE_PERIODIC_TARGET - Remote-copy groups can have no more than one periodic-mode target.- Raises
HTTPForbidden
- RCOPY_GROUP_ONE_TO_ONE_CONFIG_FOR_MIXED_MODE - Mixed mode is supported in a 1-to-1 remote-copy configuration.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_TARGET - The specified target is not a target of the remote-copy group.- Raises
HTTPNotImplemented
- RCOPY_TARGET_IN_PEER_PERSISTENCE_SYNC_GROUP_ONLY - The remote-copy target is configured with peer persistence; only synchronous groups can be added.- Raises
HTTPNotImplemented
- RCOPY_TARGET_MODE_NOT_SUPPORTED - The remote-copy target mode is not supported.- Raises
HTTPNotImplemented
- RCOPY_TARGET_MULTI_TARGET_NOT_SUPPORTED - The remote-copy target was created in an earlier version of the HP 3PAR OS that does not support multiple targets.- Raises
HTTPNotImplemented
- RCOPY_TARGET_VOL_AUTO_CREATION_NOT_SUPPORTED - The remote-copy target is in an older version of the HP 3PAR OS that does not support autocreation of- Raises
HTTPBadRequest
- RCOPY_GROUP_MIXED_MODES_ON_ONE_TARGET - Remote-copy groups with different modes on a single target are not supported.- Raises
HTTPNotFound
- NON_EXISTENT_CPG - The CPG does not exists.- Raises
HTTPForbidden
- CPG_NOT_IN_SAME_DOMAIN - Snap CPG is not in the same domain as the user CPG.- Raises
HTTPBadRequest
- NON_EXISTENT_DOMAIN - Domain doesn’t exist.- Raises
HTTPForbidden
- RCOPY_GROUP_HAS_NO_CPG - No CPG has been defined for the remote-copy group on the target.- Raises
HTTPServiceUnavailable
- RCOPY_MAX_SYNC_TARGET_REACHED - The maximum number of remote-copy synchronous targets has been reached.- Raises
HTTPServiceUnavailable
- RCOPY_MAX_PERIODIC_TARGET_REACHED - The maximum number of remote-copy periodic targets has been reached.
- removeRemoteCopyGroup(name, keep_snap=False)[source]
Deletes a remote copy group
- Parameters
name (str) – the remote copy group name
keep_snap (bool) – used to retain the local volume resynchronization snapshot. NOTE: to retain the snapshot pass ‘true’ to keep_snap
- Raises
HTTPNotFound
- NON_EXISTENT_RCOPY_GROUP - The remote-copy group does not exist.- Raises
HTTPForbidden
- RCOPY_GROUP_STARTED - The remote-copy group has already been started.- Raises
HTTPForbidden
- RCOPY_GROUP_IS_BUSY - The remote-copy group is currently busy; retry later.- Raises
HTTPForbidden
- RCOPY_TARGET_IS_NOT_READY - The remote-copy group target is not ready.- Raises
HTTPForbidden
- RCOPY_GROUP_OPERATION_ONLY_ON_PRIMARY_SIDE - The operation should be performed only on the primary side.- Raises
HTTPForbidden
- RCOPY_GROUP_RENAME_RESYNC_SNAPSHOT_FAILED - Renaming of the remote-copy group resynchronization snapshot failed.- Raises
HTTPForbidden
- RCOPY_GROUP_IN_FAILOVER_STATE - The remote-copy group is in failover state; both the source system and the target system are in the primary state.- Raises
HTTPNotFound
- RCOPY_GROUP_TARGET_VOLUME_MISMATCH - Secondary group on target system has a mismatched volume configuration.
- modifyRemoteCopyGroup(name, optional=None)[source]
Modifies a remote copy group
- Parameters
name (str) – the remote copy group name
optional (dict) – dict of other optional items
optional = { "localUserCPG": "CPG", # Specifies the local user # CPG that will be used for # autocreated volumes. "localSnapCPG": "SNAP_CPG", # Specifies the local snap # CPG that will be used for # autocreated volumes. "targets": targets, # Specifies the attributes of # the remote-copy group # target. "unsetUserCPG": False, # If True, this option # unsets the localUserCPG and # remoteUserCPG of the # remote-copy group. "unsetSnapCPG": Flase # If True, this option # unsets the localSnapCPG and # remoteSnapCPG of the # remote-copy group. } targets = [ { "targetName": "name", # Specifies the target name # associated with the # remote-copy group to be # created. "remoteUserCPG": "CPG", # Specifies the user CPG # on the target that will be # used for autocreated # volumes. "remoteSnapCPG": "SNAP_CPG", # Specifies the snap CPG # on the target that will be # used for autocreated # volumes. "syncPeriod": 300, # Specifies that asynchronous # periodic remote-copy groups # should be synchronized # periodically to the # <period_value>. # Range is 300 - 31622400 # seconds (1 year). "rmSyncPeriod": False, # If True, this option # resets the syncPeriod # time to 0 (zero). # If False, the # syncPeriod value is 0 # (zero), then Ignore. # If False, and the # syncPeriod value is # positive, then then the # synchronizaiton period # is set. "mode": 2, # Volume group mode. Can be # either synchronous or # periodic. # 1 - The remote-copy group # mode is synchronous. # 2 - The remote-copy group # mode is periodic. # 3 - The remote-copy group # mode is periodic. # 4 - Remote-copy group mode # is asynchronous. "snapFrequency": 300, # Async mode only. Specifies # the interval in seconds at # which Remote Copy takes # coordinated snapshots. Range # is 300-31622400 seconds # (1 year). "rmSnapFrequency": False, # If True, this option resets # the snapFrequency time # rmSnapFrequency to 0 (zero). # If False and the # snapFrequency value is 0 # (zero), then Ignore. If # False, and the snapFrequency # value is positive, sets the # snapFrequency value. "policies": policies # The policy assigned to # the remote-copy group. } ] policies = { "autoRecover": False, # If the remote copy is stopped # as a result of links going # down, the remote-copy group # can be automatically # restarted after the links # come back up. "overPeriodAlert": False, # If synchronization of an # asynchronous periodic # remote-copy group takes # longer to complete than its # synchronization period, an # alert is generated. "autoFailover": False, # Automatic failover on a # remote-copy group. "pathManagement": False # Automatic failover on a # remote-copy group. }
- Raises
HTTPNotFound
- NON_EXISTENT_RCOPY_GROUP - The remote-copy group does not exist.- Raises
HTTPForbidden
- RCOPY_GROUP_OPERATION_ONLY_ON_PRIMARY_SIDE - The operation should be performed only on the primary side.- Raises
HTTPForbidden
- RCOPY_GROUP_IS_NOT_PERIODIC - Target in group is not periodic.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_POLICY_FOR_PERIODIC_GROUP - Invalid policy for a periodic group.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_POLICY_FOR_SYNC_GROUP - Invalid policy for a synchronous target.- Raises
HTTPNotFound
- NON_EXISTENT_CPG - The CPG does not exists.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_TARGET - The specified target is not a target of the remote-copy group.- Raises
HTTPForbidden
- CPG_NOT_IN_SAME_DOMAIN - Snap CPG is not in the same domain as the user CPG.- Raises
HTTPBadRequest
- INV_INPUT_BELOW_RANGE - The minimum allowable period is 300 seconds.- Raises
HTTPBadRequest
- INV_INPUT_EXCEEDS_RANGE - Invalid input: the period is too long.- Raises
HTTPForbidden
- RCOPY_GROUP_STARTED - The remote-copy group has already been started.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_OPERATION_ON_MULTIPLE_TARGETS - The operation is not supported on multiple targets.- Raises
HTTPBadRequest
- RCOPY_GROUP_TARGET_NOT_UNIQUE - The remote-copy group target is not unique.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_TARGET_NUMBER - The wrong number of targets is specified for the remote-copy group.
- getRemoteCopyGroupVolumes(remoteCopyGroupName)[source]
Returns information on all volumes in a Remote Copy Groups
- Parameters
remoteCopyGroupName (str) – the remote copy group name
- Returns
list of volumes in a Remote Copy Groups
- getRemoteCopyGroupVolume(remoteCopyGroupName, volumeName)[source]
Returns information on one volume of a Remote Copy Group
- Parameters
remoteCopyGroupName (str) – the remote copy group name
volumeName (str) – the remote copy group name
- Returns
RemoteVolume
- addVolumeToRemoteCopyGroup(name, volumeName, targets, optional=None, useHttpPost=False)[source]
Adds a volume to a remote copy group
- Parameters
name (string) – Name of the remote copy group
volumeName (string) – Specifies the name of the existing virtual volume to be admitted to an existing remote-copy group.
targets (list) – Specifies the attributes of the target of the remote-copy group.
optional (dict) – dict of other optional items
targets = [ { "targetName": "name", # The target name # associated with this # group. "secVolumeName": "sec_vol_name" # Specifies the name of # the secondary volume # on the target system. } ] optional = { "snapshotName": "snapshot_name", # The optional read-only # snapshotName is a # starting snapshot when # the group is started # without performing a # full resynchronization. # Instead, for # synchronized groups, # the volume # synchronizes deltas # between this # snapshotName and # the base volume. For # periodic groups, the # volume synchronizes # deltas between this # snapshotName and a # snapshot of the base. "volumeAutoCreation": False, # If set to true, the # secondary volumes # should be created # automatically on the # target using the CPG # associated with the # remote-copy group on # that target. "skipInitialSync": False # If set to true, the # volume should skip the # initial sync. This is # for the admission of # volumes that have # been pre-synced with # the target volume. }
- Raises
HTTPNotFound
- NON_EXISTENT_RCOPY_GROUP - The remote-copy group does not exist.- Raises
HTTPNotFound
- NON_EXISTENT_VOL - volume doesn’t exist- Raises
HTTPNotFound
- NON_EXISTENT_SNAPSHOT - The specified snapshot does not exist.- Raises
HTTPForbidden
- RCOPY_GROUP_SNAPSHOT_IS_RW - The specified snapshot can only be read-only.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_IS_RO - The volume to be admitted to the remote-copy group cannot be read-only.- Raises
HTTPForbidden
- RCOPY_GROUP_HAS_NO_CPG - No CPG has been defined for the remote-copy group on the target.- Raises
HTTPConflict
- RCOPY_GROUP_EXISTENT_VOL - The specified volume is already in the remote-copy group.- Raises
HTTPConflict
- RCOPY_GROUP_EXISTENT_VOL_ON_TARGET - The specified secondary volume to be automatically created already exists on the target.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_TARGET - The specified target is not a target of the remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_SIZE_NOT_MATCH - The size of the volume added to the remote-copy group does not match the size of the volume on the target.- Raises
HTTPNotFound
- RCOPY_GROUP_NON_EXISTENT_VOL_ON_TARGET - The specified secondary volume does not exist on the target.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_NO_SNAPSHOT_SPACE - The volume to be admitted into the remote-copy group requires that snapshot space be allocated.- Raises
HTTPForbidden
- RCOPY_GROUP_TARGET_VOL_NO_SNAPSHOT_SPACE - The specified secondary volumes on the target require snapshot space.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_IS_PHYSICAL_COPY - A physical copy cannot be added to a remote-copy group- Raises
HTTPForbidden
- RCOPY_GROUP_MAX_VOL_REACHED_PERIODIC - The number of periodic-mode volumes on the system has reached the limit.- Raises
HTTPForbidden
- RCOPY_GROUP_MAX_VOL_REACHED_SYNC - The number of synchronous-mode volumes on the system has reached the limit.- Raises
HTTPForbidden
- RCOPY_GROUP_MAX_VOL_REACHED - The number of volumes on the system has reached the limit.- Raises
HTTPForbidden
- RCOPY_IS_NOT_READY - The remote-copy configuration is not ready- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_INTERNAL_CONSISTENCY_ERR - The volume to be admitted into the remote-copy group has an internal consistency error.- Raises
HTTPForbidden
- RCOPY_GROUP_IS_BEING_REMOVED - The volume to be admitted into the remote-copy group is being removed.- Raises
HTTPForbidden
- RCOPY_GROUPSNAPSHOT_PARENT_MISMATCH - The names of the snapshot and its parent do not match.- Raises
HTTPForbidden
- RCOPY_GROUP_TARGET_VOL_EXPORTED - Secondary volumes cannot be admitted when they are exported.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_IS_PEER_PROVISIONED - A peer-provisioned volume cannot be admitted into a remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_ONLINE_CONVERSION - Online volume conversions do not support remote copy.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_ONLINE_PROMOTE - Online volume promotes do not support remote copy.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_ONLINE_COPY - Online volume copies do not support remote copy.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_CLEAN_UP - Cleanup of internal volume is in progress.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_IS_INTERNAL - Internal volumes cannot be admitted into a remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_NOT_IN_SAME_DOMAIN - The remote-copy group has a different domain than the volume.- Raises
HTTPForbidden
- RCOPY_GROUP_STARTED - The remote-copy group has already been started.- Raises
HTTPForbidden
- RCOPY_GROUP_IS_BUSY - The remote-copy group is currently busy; retry later.- Raises
HTTPForbidden
- RCOPY_GROUP_VOL_IN_OTHER_GROUP - The volume is already in another remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_TARGET_NUMBER - The wrong number of targets is specified for the remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_TARGET - The specified target is not a target of the remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_NOT_SUPPORT_VOL_ID - The target for the remote-copy group does not support volume IDs.- Raises
HTTPForbidden
- RCOPY_GROUP_IS_SELF_MIRRORED - The target is self-mirrored.- Raises
HTTPForbidden
- RCOPY_GROUP_TARGET_VOL_IS_RO - The remote-copy target volume cannot be read-only.- Raises
HTTPForbidden
- RCOPY_GROUP_OPERATION_ONLY_ON_PRIMARY_SIDE - The operation should be performed only on the primary side.- Raises
HTTPForbidden
- RCOPY_TARGET_IS_NOT_READY - The remote-copy group target is not ready.- Raises
HTTPNotImplemented
- RCOPY_UNSUPPORTED_TARGET_VERSION - The target HP 3PAR OS version is not supported.- Raises
HTTPForbidden
- RCOPY_GROUP_MULTIPLE_VOL_IN_SAME_FAMILY - A remote-copy group cannot contain multiple volumes in the same family tree.- Raises
HTTPForbidden
- RCOPY_GROUP_MULTIPLE_RW_SNAPSHOT_IN_SAME_FAMILY - Only one read/write snapshot in the same family can be added to a remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_SYNC_SNAPSHOT_IN_MULTIPLE_TARGET - A synchronization snapshot cannot be set with multiple targets.- Raises
HTTPForbidden
- RCOPY_GROUP_ADD_VOL_FAILED - Failed to add volume to the remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_ADD_VOL_FAILED_PARTIAL - Adding volume to remote-copy group succeeded on some targets.- Raises
HTTPForbidden
- INV_OPERATION_SET_AUTO_CREATED - The set was created automatically Members cannot be added or removed.- Raises
HTTPForbidden
- RCOPY_GROUP_SECONDARY_DOES_NOT_MATCH_PRIMARY - The remote-copy group is in the failover state. Both systems are in the primary state.
- removeVolumeFromRemoteCopyGroup(name, volumeName, optional=None, removeFromTarget=False, useHttpDelete=True)[source]
Removes a volume from a remote copy group
- Parameters
name (string) – Name of the remote copy group
volumeName (string) – Specifies the name of the existing virtual volume to be removed from an existing remote-copy group.
optional (dict) – dict of other optional items
optional = { "keepSnap": False # If true, the resynchronization # snapshot of the local volume is # retained. }
- Raises
HTTPNotFound
- NON_EXISTENT_RCOPY_GROUP - The remote-copy group does not exist.- Raises
HTTPNotFound
- NON_EXISTENT_VOL - volume doesn’t exist- Raises
HTTPForbidden
- RCOPY_IS_NOT_READY - The remote-copy configuration is not ready for commands.- Raises
HTTPForbidden
- RCOPY_GROUP_STARTED - The remote-copy group has already been started.- Raises
HTTPForbidden
- RCOPY_GROUP_IS_BUSY - The remote-copy group is currently busy; retry later.- Raises
HTTPNotFound
- RCOPY_GROUP_VOL_NOT_IN_GROUP - The volume is not in the remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_RENAME_RESYNC_SNAPSHOT_FAILED - Renaming of the remote-copy group resynchronization snapshot failed.- Raises
HTTPConflict
- RCOPY_GROUP_CREATED_MIRROR_CONFIG_OFF - The remote-copy group was created when the configuration mirroring policy was turned off on the target. However, this policy is now turned on. In order to dismiss a volume from the remote-copy group, the configuration mirroring policy must be turned off. Retry after turning the policy off.- Raises
HTTPForbidden
- RCOPY_GROUP_OPERATION_ONLY_ON_PRIMARY_SIDE - The operation should be performed only on the primary side.- Raises
HTTPForbidden
- RCOPY_TARGET_IS_NOT_READY - The remote-copy group target is not ready.
- startRemoteCopy(name, optional=None)[source]
Starts a remote copy
- Parameters
name (string) – Name of the remote copy group
optional (dict) – dict of other optional items
# All the volumes in the group must be specified. While specifying # the pair, the starting snapshot is optional. If it is not # specified, a full resynchronization of the volume is performed. startingSnapshots = [ { "volumeName": "vol_name", # Volume name "snapshotName": "snap_name" # Snapshot name } ] optional = { "skipInitialSync": False, # If True, the volume # should skip the initial # synchronization and # sets the volumes to # a synchronized state. "targetName": "target_name", # The target name associated # with this group. "startingSnapshots": startingSnapshots }
- Raises
HTTPNotFound
- NON_EXISTENT_RCOPY_GROUP - The remote-copy group does not exist.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_TARGET - The specified target is not a target of the remote-copy group.- Raises
HTTPForbidden
- RCOPY_GROUP_STARTED - The remote-copy group has already been started.- Raises
HTTPBadRequest
- RCOPY_GROUP_EMPTY - The remote-copy group must contain volumes before being started.- Raises
HTTPForbidden
- RCOPY_GROUP_OPERATION_ONLY_ON_PRIMARY_SIDE - The operation should be performed only on the primary side.- Raises
HTTPBadRequest
- RCOPY_TARGET_NOT_SPECIFIED - A target must be specified to complete this operation.- Raises
HTTPBadRequest
- RCOPY_GROUP_NOT_ALL_VOLUMES_SPECIFIED - All the volumes in the remote-copy group must be specified to complete this operation.- Raises
HTTPNotFound
- RCOPY_GROUP_EXISTENT_VOL_WWN_ON_TARGET - Secondary volume WWN already exists on the target.- Raises
HTTPNotFound
- RCOPY_GROUP_VOLUME_ALREADY_SYNCED - Volume is already synchronized.- Raises
HTTPBadRequest
- RCOPY_GROUP_INCORRECT_SNAPSHOT_OR_VOLUME_SPECIFIED - An incorrect starting snapshot or volume was specified, or the snapshot or volume does not exist.
- stopRemoteCopy(name, optional=None)[source]
Stops a remote copy
- Parameters
name (string) – Name of the remote copy group
optional (dict) – dict of other optional items
optional = { "noSnapshot": False, # If true, this option turns # off creation of snapshots # in synchronous and # periodic modes, and # deletes the current # synchronization snapshots. "targetName": "target_name" # The target name associated # with this group }
- Raises
HTTPNotFound
- NON_EXISTENT_RCOPY_GROUP - The remote-copy group does not exist.- Raises
HTTPForbidden
- RCOPY_TARGET_IS_NOT_READY - The remote-copy group target is not ready.
- synchronizeRemoteCopyGroup(name, optional=None)[source]
Synchronizing a remote copy group
- Parameters
name (string) – Name of the remote copy group
optional (dict) – dict of other optional items
optional = { "noResyncSnapshot": False, # If true, does not save # the resynchronization # snapshot. Applicable # only to remote-copy # groups in asychronous # periodic mode. "targetName": "target_name", # The target name # assoicated with the # remote-copy group. "fullSync": False # If true, this option # forces a full # synchronization of the # remote-copy group, even # if the volumes are # already synchronized. # This option, which # applies only to volume # groups in synchronous # mode, can be used to # resynchronize volumes # that have become # inconsistent. }
- Raises
HTTPNotFound
- NON_EXISTENT_RCOPY_GROUP - The remote-copy group does not exist.- Raises
HTTPForbidden
- RCOPY_GROUP_OPERATION_ONLY_ON_PRIMARY_SIDE - The operation should be performed only on the primary side.- Raises
HTTPForbidden
- UNLICENSED_FEATURE - The system is not licensed for this feature.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_TARGET - The specified target is not a target of the remote-copy group.- Raises
HTTPForbidden
- RCOPY_TARGET_IS_NOT_READY - The remote-copy group target is not ready.- Raises
HTTPForbidden
- RCOPY_GROUP_INVOLVED_IN_SYNCHRONIZATION - The remote-copy group is already involved in synchronization.- Raises
HTTPForbidden
- RCOPY_GROUP_STARTED - The remote-copy group has already been started.
- recoverRemoteCopyGroupFromDisaster(name, action, optional=None)[source]
Recovers a remote copy group from a disaster
The action may be any of values 6 through 11:
- RC_ACTION_CHANGE_DIRECTION - Changes the current
direction of the remote-copy groups.
- RC_ACTION_CHANGE_TO_PRIMARY - Changes the secondary
groups to primary groups on the active system.
- RC_ACTION_MIGRATE_GROUP - Migrates the remote-copy
group from the primary system to the secondary system without impacting I/O.
- RC_ACTION_CHANGE_TO_SECONDARY - Changes the primary
remote-copy group on the backup system to the secondary remote-copy group.
- RC_ACTION_CHANGE_TO_NATURUAL_DIRECTION - Changes all
remote-copy groups to their natural direction and starts them.
- RC_ACTION_OVERRIDE_FAIL_SAFE - Overrides the failsafe
state that is applied to the remote-copy group.
- Parameters
name (string) – Name of the remote copy group
action (int) – Specifies the action to be taken on the specified group.
optional (dict) – dict of other optional items
optional = { "targetName": "target_name", # The target name # associated with this # group. "skipStart": False, # If true, groups are not # started after role reversal # is completed. Valid for # only FAILOVER, RECOVER, # and RESTORE operations. "skipSync": False, # If true, the groups are # not synchronized after # role reversal is # completed. Valid only for # FAILOVER, RECOVER, and # RESTORE operations. "discardNewData": False, # If true and the group # has multiple targets, # don't check other targets # of the group to see if # newer data should be # pushed from them. # Valid only for FAILOVER # operation. "skipPromote": False, # If true, the snapshots of # the groups that are # switched from secondary # to primary are not # promoted to the base # volume. Valid only for # FAILOVER and REVERSE # operations. "noSnapshot": False, # If true, the snapshots # are not taken of the # groups that are switched # from secondary to # primary. Valid for # FAILOVER, REVERSE, and # RESTORE operations. "stopGroups": False, # If true, the groups are # stopped before performing # the reverse operation. # Valid only for REVERSE # operation. "localGroupsDirection": False # If true, the group's # direction is changed only # on the system where the # operation is run. Valid # only for REVERSE operation }
- Raises
HTTPNotFound
- NON_EXISTENT_RCOPY_GROUP - The remote-copy group does not exist.- Raises
HTTPForbidden
- UNLICENSED_FEATURE - System is not licensed for this feature.- Raises
HTTPBadRequest
- RCOPY_GROUP_INV_TARGET - Specified target is not in remote copy group.- Raises
HTTPForbidden
- INV_INPUT_MISSING_REQUIRED - Group has multiple targets.- Raises
HTTPForbidden
- INV_OPERATION_RCOPY_GROUP_ROLE_CONFLICT - Group is not in correct role for this operation.- Raises
HTTPForbidden
- RCOPY_GROUP_INV_OPERATION_ON_MULTIPLE_TARGETS - The operation is not supported on multiple targets.- Raises
HTTPForbidden
- RCOPY_GROUP_NOT_STOPPED - Remote copy group is not stopped.- Raises
HTTPForbidden
- INV_OPERATION_RCOPY_GROUP_ROLE_CONFLICT - Group is not in correct role for this operation.- Raises
HTTPForbidden
- RCOPY_GROUP_NOT_STARTED - Remote copy not started.- Raises
HTTPForbidden
- INV_INPUT_PARAM_CONFLICT - Parameters cannot be present at the same time.- Raises
HTTPForbidden
- INV_OPERATION_VV_PROMOTE_IN_PROGRESS - Volume promotion is in progress.- Raises
HTTPForbidden
- RCOPY_GROUP_IS_BUSY - Remote copy group is currently busy.- Raises
HTTPForbidden
- RCOPY_GROUP_STARTED - Remote copy group has already been started.- Raises
HTTPForbidden
- RCOPY_GROUP_EMPTY - Remote copy group does not contain any volumes.- Raises
HTTPForbidden
- RCOPY_GROUP_OPERATION_ONLY_ON_PRIMARY_SIDE - Operation should only be issued on primary side.- Raises
HTTPForbidden
- RCOPY_GROUP_OPERATION_ONLY_ON_SECONDARY_SIDE - Operation should only be issued on secondary side.
- toggleRemoteCopyConfigMirror(target, mirror_config=True)[source]
Used to toggle config mirroring policies on a target device.
- Parameters
target (string) – The 3PAR target name to enable/disable config mirroring.
mirror_config (bool) – Specifies whether to enable or disable config mirroring.
- admitRemoteCopyLinks(targetName, source_port, target_port_wwn_or_ip)[source]
Adding remote copy link from soure to target.
- Parameters
targetName (string) – The name of target system
source_port (string) – Source ethernet/Fibre channel port
target_port_wwn_or_ip (string) – Target system’s peer port WWN/IP
- dismissRemoteCopyLinks(targetName, source_port, target_port_wwn_or_ip)[source]
Dismiss remote copy link from soure to target.
- Parameters
targetName (string) – The name of target system
source_port (string) – Source ethernet/Fibre channel port
target_port_wwn_or_ip (string) – Target system’s peer port WWN/IP
- rcopyServiceExists()[source]
Checking remote copy service status.
- Returns
True if remote copy service status is ‘Started’ False if remote copy service status is ‘Stopped’
- getRemoteCopyLink(link_name)[source]
Querying specific remote copy link
- Returns
Specific remote copy link info
- rcopyLinkExists(targetName, local_port, target_system_peer_port)[source]
Checking remote copy link from soure to target.
- Parameters
targetName (string) – The name of target system
local_port (string) – Source ethernet/Fibre channel port
target_system_peer_port (string) – Target system’s peer port WWN/IP
- Returns
True if remote copy link exists False if remote copy link doesn’t exist
- admitRemoteCopyTarget(targetName, mode, remote_copy_group_name, optional=None)[source]
Adding target to remote copy group
- Parameters
targetName (string) – The name of target system
mode (string) – synchronization mode
remote_copy_group_name (string) –
:param optional :type optional: dict
optional = { "volumePairs": [{ "sourceVolumeName": "source_name", # The target volume # name associated with # this group. "targetVolumeName": "target_name" # The target volume # name associated with # this group. }] }
- dismissRemoteCopyTarget(targetName, remote_copy_group_name)[source]
Removing target from remote copy group
- Parameters
targetName (string) – The name of target system
remote_copy_group_name (string) –
- targetInRemoteCopyGroupExists(target_name, remote_copy_group_name)[source]
Determines whether target is present in remote copy group.
- Parameters
target_name (string) – The name of target system
remote_copy_group_name (string) –
- Returns
bool
- remoteCopyGroupStatusCheck(remote_copy_group_name)[source]
Determines whether all volumes syncStatus is synced or not when remote copy group status is started. If all volumes syncStatus is ‘synced’ then it will return true else false
- Parameters
remote_copy_group_name (string) – Remote copy group name
- Returns
- True If remote copy group is started and all
volume syncStatus is ‘synced’ i.e. 3
- False If remote copy group is started and some
volume status is not ‘synced’.
- remoteCopyGroupStatusStartedCheck(remote_copy_group_name)[source]
Checks whether remote copy group status is started or not
- Parameters
remote_copy_group_name (string) – Remote copy group name
- Returns
- True If remote copy group is in started
state i.e. 3
- False If remote copy group is not in started
state
- remoteCopyGroupStatusStoppedCheck(remote_copy_group_name)[source]
Checks whether remote copy group status is stopped or not
- Parameters
remote_copy_group_name (string) – Remote copy group name
- Returns
- True If remote copy group is in stopped
state i.e. 5
- False If remote copy group is not in started
state
- getVolumeSnapshots(name, live_test=True)[source]
Shows all snapshots associated with a given volume.
- Parameters
name (str) – The volume name
- Returns
List of snapshot names
- getSnapshotsOfVolume(snapcpgName, volName)[source]
Gets list of snapshots of a volume.
- Parameters
snapcpgName (str) – The name of the CPG in which the volume snapshot(s) are present
volName (str) – The volume name for which the list of snapshots needs to be retrieved
- Returns
list of snapshots of volName
- getSchedule(schedule_name)[source]
Get Schedule
- Parameters
schedule_name (string) – The name of the schedule to get information
- createSchedule(schedule_name, task, taskfreq)[source]
Create Schedule for volume snapshot.
- Parameters
schedule_name (string) – The name of the schedule
task (string) – command to for which schedule is created
taskfreq (string) – frequency of schedule
- modifySchedule(name, schedule_opt)[source]
Modify Schedule.
- Parameters
name (string) – The name of the schedule
schedule_opt (dict) – dictionary of option to be modified
mod_request = { 'newName': 'myNewName', # New name of the schedule 'taskFrequency': '0 * * * *' # String containing cron or # @monthly, @hourly, @daily, # @yearly and @weekly. }
- suspendSchedule(schedule_name)[source]
Suspend Schedule
- Parameters
schedule_name (string) – The name of the schedule to get information
- resumeSchedule(schedule_name)[source]
Resume Schedule
- Parameters
schedule_name (string) – The name of the schedule to get information
- deleteSchedule(schedule_name)[source]
Delete Schedule
- Parameters
schedule_name (string) – The name of the schedule to delete
- getScheduleStatus(schedule_name)[source]
Checks schedule status active/suspended and returns it.
- Parameters
schedule_name (string) – Schedule name
- Returns
True If active, False if suspended
- createFlashCache(sizeInGib, mode)[source]
Creates a new FlashCache
- Parameters
sizeInGib (int) – Specifies the node pair size of the Flash Cache on the system.
mode (int) – Simulator: 1 Real: 2 (default)
- Raises
HTTPBadRequest
- NO_SPACE - Not enough space is available for the operation.- Raises
HTTPBadRequest
- INV_INPUT_EXCEEDS_RANGE - A JSON input object contains a name-value pair with a numeric value that exceeds the expected range. Flash Cache exceeds the expected range. The HTTP ref member contains the name.- Raises
HTTPConflict
- EXISTENT_FLASH_CACHE - The Flash Cache already exists.- Raises
HTTPForbidden
- FLASH_CACHE_NOT_SUPPORTED - Flash Cache is not supported.- Raises
HTTPBadRequest
- INV_FLASH_CACHE_SIZE - Invalid Flash Cache size. The size must be a multiple of 16 G.
- deleteFlashCache()[source]
Deletes an existing Flash Cache
- Raises
HTTPForbidden
- FLASH_CACHE_IS_BEING_REMOVED - Unable to delete the Flash Cache, the Flash Cache is being removed.- Raises
HTTPForbidden
- FLASH_CACHE_NOT_SUPPORTED - Flash Cache is not supported on this system.- Raises
HTTPNotFound
- NON_EXISTENT_FLASH_CACHE - The Flash Cache does not exist.
- tuneVolume(volName, tune_operation, optional=None)[source]
Tune a volume.
- Parameters
name (str) – the name of the volume
tune_operation (int) – tune_operation 1 for USR_CPG 2 for SNP_CPG
optional (dict) – dictionary of volume attributes to change
optional = { 'userCPG': 'User CPG name', # Required if tuneOperation is 1 'snapCPG': 'Snap CPG name', # Required if tuneOperation is 2 'conversionOperation': 1, # For TPVV 1, For FPVV 2, For TDVV 3 # For CONVERT_TO_DECO 4 (Primera Only) 'compression': False, # compression is not supported for # FPVV }
- Raises
HTTPForbidden
- CPG_NOT_IN_SAME_DOMAIN - Snap CPG is not in the same domain as the user CPG.- Raises
HTTPBadRequest
- INV_INPUT_ILLEGAL_CHAR - Invalid VV name or CPG name.- Raises
HTTPForbidden
- INV_INPUT_VV_IS_FPVV - The volume is already fully provisioned.- Raises
HTTPForbidden
- INV_INPUT_VV_IS_TDVV - The volume is already deduplicated.- Raises
HTTPForbidden
- INV_INPUT_VV_IS_TPVV - The volume is already thinly provisioned.- Raises
HTTPForbidden
- INV_OPERATION_UNSUPPORTED_VV_TYPE - Invalid operation: Cannot grow this type of volume.- Raises
HTTPForbidden
- INV_OPERATION_VV_MODIFY_USR_CPG_TDVV - Cannot change USR CPG of a TDVV to a different CPG..- Raises
HTTPForbidden
- INV_OPERATION_VV_NON_BASE_VOLUME - The destination volume is not a base volume.- Raises
HTTPForbidden
- INV_OPERATION_VV_SYS_VOLUME - The volume is a system volume. This operation is not allowed on a system volume.- Raises
HTTPForbidden
- INV_OPERATION_VV_CLEANUP_IN_PROGRESS - Internal volume cleanup is in progress.- Raises
HTTPForbidden
- INV_OPERATION_VV_INTERNAL_VOLUME - Cannot modify an internal volume- Raises
HTTPConflict
- INV_OPERATION_VV_VOLUME_CONV_IN_PROGRESS - Invalid operation: VV conversion is in progress.- Raises
HTTPForbidden
- INV_OPERATION_VV_NOT_IN_NORMAL_STATE - Volume state is not normal- Raises
HTTPForbidden
- INV_OPERATION_VV_PEER_VOLUME - Cannot modify a peer volume.- Raises
HTTPConflict
- INV_OPERATION_VV_TASK_CANCEL_IN_PROGRESS - Invalid operation: A task involving the volume is being canceled..- Raises
HTTPConflict
- INV_OPERATION_VV_PROMOTE_IN_PROGRESS - Invalid operation: Volume promotion is in progress.- Raises
HTTPConflict
- INV_OPERATION_VV_TUNE_IN_PROGRESS - Invalid operation: Volume tuning is in progress.- Raises
HTTPBadRequest
- NO_SPACE - Not Enough space is available- Raises
HTTPForbidden
- NODE_DOWN - The node is down.- Raises
HTTPNotFound
- NON_EXISTENT_CPG - The CPG does not exists.- Raises
HTTPNotFound
- NON_EXISTENT_VOL - volume doesn’t exist- Raises
HTTPForbidden
- VV_IN_INCONSISTENT_STATE - The volume has an internal consistency error.- Raises
HTTPForbidden
- VV_IS_BEING_REMOVED - The volume is being removed.- Raises
HTTPForbidden
- VV_NEEDS_TO_BE_CHECKED - The volume needs to be checked.- Raises
HTTPForbidden
- VV_NOT_STARTED - Volume is not started.- Raises
HTTPForbidden
- INV_INPUT_VV_IS_FPVV - A fully provisioned volume cannot be compressed.