hitachivantara.vspone_block.vsp.hv_truecopy module – Manages TrueCopy pairs on VSP block storage systems.
Note
This module is part of the hitachivantara.vspone_block collection (version 4.6.1).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install hitachivantara.vspone_block.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: hitachivantara.vspone_block.vsp.hv_truecopy.
New in hitachivantara.vspone_block 3.1.0
Synopsis
This module allows for the creation, deletion, splitting, re-syncing and resizing of TrueCopy pairs.
It also allows swap-splitting and swap-resyncing operations of TrueCopy pairs.
It supports various TrueCopy pairs operations based on the specified task level..
For examples, go to URL https://github.com/hitachi-vantara/vspone-block-ansible/blob/main/playbooks/vsp_direct/truecopy.yml
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.9
Parameters
Parameter |
Comments |
|---|---|
Information required to establish a connection to the storage system. |
|
IP address or hostname of the storage system. |
|
Token used to operate on locked resources. |
|
Type of connection to the storage system. Choices:
|
|
Password for authentication. This is a required field. |
|
Username for authentication. This is a required field. |
|
Information required to establish a connection to the secondary storage system. |
|
IP address or hostname of the Hitachi storage system. |
|
This field is used to pass the value of the lock token of the secondary storage to operate on locked resources. |
|
Password for authentication.This is a required field if api_token is not provided. |
|
Username for authentication. This is a required field if api_token is not provided. |
|
Specification for the TrueCopy pairs task. |
|
Specify beginning ldev id for LDEV range for svol. This is an optional field during create operation. If this field is specified, end_secondary_volume_id must also be specified. If this field is not specified, Ansible modules will try to create SVOL ID same as the PVOL ID if available, otherwise it will use the first available LDEV ID. |
|
Consistency Group ID, 0 to 255. This is an optional field. |
|
Name of the copy group. This is a required field for create operation. For other operations, this field is optional, but when provided, the time to complete the operation is faster. Required for the Split TrueCopy pair by copy_group_name and primary volume ID /Resync TrueCopy pair by copy_group_name and copy_pair_name /Resync TrueCopy pair /Resync TrueCopy pair by copy_group_name and primary volume ID /Swap-Split TrueCopy pair by copy_group_name and copy_pair_name /Swap-Split TrueCopy pair /Swap-Split TrueCopy pair by copy_group_name and primary volume ID /Swap-Resync TrueCopy pair by copy_group_name and copy_pair_name /Swap-Resync TrueCopy pair /Swap-Resync TrueCopy pair by copy_group_name and primary volume ID /Delete TrueCopy pair by copy_group_name and copy_pair_name /Delete TrueCopy pair /Delete TrueCopy pair by copy_group_name and primary volume ID /Expand TrueCopy pair tasks. |
|
Copy speed. This is optional for the create operation. Choices:
|
|
Name of the copy pair. This is a required field for create operation. For other operations, this field is optional, but when provided, the time to complete the operation is faster. Required for the Resync TrueCopy pair by copy_group_name and copy_pair_name /Resync TrueCopy pair /Swap-Split TrueCopy pair by copy_group_name and copy_pair_name /Swap-Split TrueCopy pair /Swap-Resync TrueCopy pair by copy_group_name and copy_pair_name /Swap-Resync TrueCopy pair /Delete TrueCopy pair by copy_group_name and copy_pair_name /Delete TrueCopy pair /Expand TrueCopy pair tasks. |
|
Perform initial copy. This is an optional field during create operation. Choices:
|
|
Specify end ldev id for LDEV range for svol. This is an optional field during create operation. If this field is specified, begin_secondary_volume_id must also be specified. If this field is not specified, Ansible modules will try to create SVOL ID same as PVOL ID iff available, otherwise it will use the first available LDEV ID. |
|
Specifies the primary volume fence level setting and determines if the host is denied access or continues to access the primary volume when the pair is suspended because of an error. This is an optional field. Choices:
|
|
This is an optional field during create operation. Depending on the value, this attribute specifies whether to register the new pair in a consistency group. If true, the new pair is registered in a consistency group. If false, the new pair is not registered in a consistency group. Choices:
|
|
Force copy for data reduction. This is an optional field during create operation. Choices:
|
|
Create a new copy group. This is an optional field during create operation. Choices:
|
|
It is applicable for split pair operation only. If true, the secondary volume will be read-writeable after split. Optional for the Split TrueCopy pair by specifying only the required fields /Split TrueCopy pair tasks. Choices:
|
|
Name of the local device group. This is an optional field. |
|
Required only for resize or expand operation. Value should be greater than the current volume size. |
|
This is an optional field during create operation. Specify the path group ID in the range from 0 to 255. If you are unsure don’t use this parameter. If you omit this value or specify 0, the lowest path group ID in the specified path group is used. |
|
Primary volume ID. This is a required field for create operation. Required for the Split TrueCopy pair by copy_group_name and primary volume ID /Resync TrueCopy pair by copy_group_name and primary volume ID /Swap-Split TrueCopy pair by copy_group_name and primary volume ID /Swap-Resync TrueCopy pair by copy_group_name and primary volume ID /Delete TrueCopy pair by copy_group_name and primary volume ID tasks. |
|
ID of the provisioned secondary volume that you want to use for the true copy creation. Required for the Create a TrueCopy pair with provisioned_secondary_volume_id /Create a TrueCopy pair with provisioned_secondary_volume_id and hostgroups tasks. |
|
Name of the remote device group. This is an optional field. |
|
Host group details of the secondary volume. Required for the Create a TrueCopy pair by specifying only the required fields /Create a TrueCopy pair with provisioned_secondary_volume_id and hostgroups /Create a TC pair using a range for secondary volume ID tasks. |
|
LUN ID of the host group on the secondary storage system. This is required for create operation. |
|
Name of the host group on the secondary storage system. This is required for create operation. |
|
Port of the host group on the secondary storage system. This is required for create operation. |
|
List of hostgroup objects for the secondary volume. |
|
LUN ID of the host group on the secondary storage system. This is not required for create operation. |
|
Name of the host group on the secondary storage system. This is required for create operation. |
|
Port of the host group on the secondary storage system. This is required for create operation. |
|
The list of iscsi targets on the secondary storage device. Required for the Create a TrueCopy-ISCSI pair by specifying only the required fields /Create a TrueCopy-ISCSI pair by specifying all the fields tasks. |
|
LUN ID. Required for the Create a TrueCopy-ISCSI pair by specifying only the required fields /Create a TrueCopy-ISCSI pair by specifying all the fields tasks. |
|
ISCSI target name. Required for the Create a TrueCopy-ISCSI pair by specifying only the required fields /Create a TrueCopy-ISCSI pair by specifying all the fields tasks. |
|
Port name. Required for the Create a TrueCopy-ISCSI pair by specifying only the required fields /Create a TrueCopy-ISCSI pair by specifying all the fields tasks. |
|
NVM subsystem details of the secondary volume. Required for the Create a TrueCopy-NVMe pair by specifying only the required fields /Create a TrueCopy-NVMe pair by specifying all the fields tasks. |
|
Name of the NVM subsystem on the secondary storage system. Required for the Create a TrueCopy-NVMe pair by specifying only the required fields /Create a TrueCopy-NVMe pair by specifying all the fields tasks. |
|
Host NQN paths information on the secondary storage system. Required for the Create a TrueCopy-NVMe pair by specifying only the required fields /Create a TrueCopy-NVMe pair by specifying all the fields tasks. |
|
ID of the dynamic pool where the secondary volume will be created. Required for the Create a TrueCopy pair by specifying only the required fields /Create a TC pair using a range for secondary volume ID /Create a TrueCopy-NVMe pair by specifying only the required fields /Create a TrueCopy-NVMe pair by specifying all the fields /Create a TrueCopy-ISCSI pair by specifying only the required fields /Create a TrueCopy-ISCSI pair by specifying all the fields tasks. |
|
Specify true to delete the SVOL. Optional for the Delete TrueCopy pair task. Choices:
|
|
The level of the TrueCopy pairs task.
Choices:
|
|
Information about the storage system. This field is an optional field. |
|
The serial number of the storage system. |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: none |
Determines if the module should run in check mode. |
Notes
Note
The output parameters
entitlement_status,subscriber_id, andpartner_idwere removed in version 3.4.0. They were also deprecated due to internal API simplification and are no longer supported.Connection type
gatewaywas removed starting from version 3.4.0. Please use an earlier version if you require this connection type.Ansible modules use a technology called copy group to manage all remote replication pair types (GAD, TC, HUR). Therefore, replication pairs created by tools that do not use copy group technology are not compatible with the Ansible modules. As a result, replication pairs created without copy group technology cannot be managed by the Ansible modules.
Before managing a TrueCopy pair through Ansible Direct Connect, you must register (or pair) the source and target storage systems in the source storage’s API server. This step is required because Ansible uses REST API calls on the backend. If you skip this step—especially if you are unfamiliar with Hitachi’s REST API—you will encounter errors when managing a TrueCopy pair through Ansible. For instructions, see Manage remote storage registration.
Before creating a TrueCopy pair, add the P-VOL to the host group, iSCSI target, or NVM subsystem on the primary storage system. Then, identify the host group to use on the secondary storage system.
For Create a TrueCopy pair by specifying only the required fields, by specifying all the fields, and using a range for secondary volume ID
If the P-VOL is unnamed, the S-VOL will be assigned a name in the format smrha-[ldev_id]. If the P-VOL has a name, the S-VOL should use the same name. (Here, smrha stands for Storage Module Red Hat Ansible.)
For Expand TrueCopy pair
First, the S-VOL size is increased, followed by the P-VOL size. If the pair is in the PAIR state, it is split before resizing. Once the resize operation is complete, the pair is re-synchronized.
To use this API, enable System Option Mode (SOM) 1198 and disable SOM 1199 on both primary and secondary storage systems.
Examples
- name: Create a TrueCopy pair
hitachivantara.vspone_block.vsp.hv_truecopy:
state: "present"
connection_info:
address: 172.1.1.126
username: "admin"
password: "secret"
secondary_connection_info:
address: 172.1.1.127
username: "admin"
password: "secret"
spec:
copy_group_name: "copy_group_name_1"
copy_pair_name: "copy_pair_name_1"
primary_volume_id: 11
is_consistency_group: true
fence_level: 'NEVER'
secondary_pool_id: 1
secondary_hostgroup:
name: ansible_test_group
port: CL1-A
lun_id: 1
- name: Split a TrueCopy pair
hitachivantara.vspone_block.vsp.hv_truecopy:
state: "split"
connection_info:
address: 172.1.1.126
username: "admin"
password: "secret"
secondary_connection_info:
address: 172.1.1.127
username: "admin"
password: "secret"
spec:
copy_group_name: "copy_group_name_1"
copy_pair_name: "copy_pair_name_1"
- name: Resync a TrueCopy pair
hitachivantara.vspone_block.vsp.hv_truecopy:
state: "resync"
connection_info:
address: 172.1.1.126
username: "admin"
password: "secret"
secondary_connection_info:
address: 172.1.1.127
username: "admin"
password: "secret"
spec:
copy_group_name: "copy_group_name_1"
copy_pair_name: "copy_pair_name_1"
- name: Swap-split a TrueCopy pair
hitachivantara.vspone_block.vsp.hv_truecopy:
state: "swap_split"
connection_info:
address: 172.1.1.127
username: "admin"
password: "secret"
secondary_connection_info:
address: 172.1.1.126
username: "admin"
password: "secret"
spec:
copy_group_name: "copy_group_name_1"
copy_pair_name: "copy_pair_name_1"
- name: Swap-resync a TrueCopy pair
hitachivantara.vspone_block.vsp.hv_truecopy:
state: "swap_resync"
connection_info:
address: 172.1.1.127
username: "admin"
password: "secret"
secondary_connection_info:
address: 172.1.1.126
username: "admin"
password: "secret"
spec:
copy_group_name: "copy_group_name_1"
copy_pair_name: "copy_pair_name_1"
- name: Delete a TrueCopy pair
hitachivantara.vspone_block.vsp.hv_truecopy:
state: "swap_resync"
connection_info:
address: 172.1.1.126
username: "admin"
password: "secret"
secondary_connection_info:
address: 172.1.1.127
username: "admin"
password: "secret"
spec:
copy_group_name: "copy_group_name_1"
copy_pair_name: "copy_pair_name_1"
- name: Increase the size of the volumes of a TrueCopy pair
hitachivantara.vspone_block.vsp.hv_truecopy:
state: "expand"
connection_info:
address: 172.1.1.126
username: "admin"
password: "secret"
secondary_connection_info:
address: 172.1.1.127
username: "admin"
password: "secret"
spec:
copy_group_name: "copy_group_name_1"
copy_pair_name: "copy_pair_name_1"
new_volume_size: 4GB
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
List of TrueCopy pair objects returned by the module. Returned: success |
|
Consistency Group ID. Returned: success Sample: |
|
Name of the copy group. Returned: success Sample: |
|
Name of the copy pair. Returned: success Sample: |
|
Copy progress rate. Returned: success Sample: |
|
Fence level. Returned: success Sample: |
|
Primary volume ID. Returned: success Sample: |
|
Primary volume ID in hex format. Returned: success Sample: |
|
PVOL status. Returned: success Sample: |
|
PVOL storage device ID. Returned: success Sample: |
|
Remote mirror copy pair ID. Returned: success Sample: |
|
Secondary volume ID. Returned: success Sample: |
|
Secondary volume ID in hex format. Returned: success Sample: |
|
Storage serial number. Returned: success Sample: |
|
SVOL status. Returned: success Sample: |
|
SVOL storage device ID. Returned: success Sample: |