hitachivantara.vspone_block.vsp.hv_snapshot module – Manages snapshots 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_snapshot.
New in hitachivantara.vspone_block 3.0.0
Synopsis
This module allows for the creation, deletion, splitting, syncing, and restoring of snapshots on VSP block storage systems.
It supports various snapshot 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/snapshot.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. |
|
Specification for the snapshot task. |
|
Specify whether to allocate a consistency group. Required for the Create snapshot pair with a new consistency group task. Choices:
|
|
Specify whether to automatically split the pair. Choices:
|
|
Specify whether the pair can be cascaded. Default is True when capacity savings is not Choices:
|
|
Specify whether the pair is to be cloned after the pair is created. You can specify this item when true is specified for the is_clone attribute. Required for the Create and clone snapshot pair with copy speed and clones automation task. Choices:
|
|
Specify the copy speed at which the created pair is to be cloned. You can specify this item when true is specified for both the is_clone attribute and the clones_automation attribute. Required for the Create and clone snapshot pair with copy speed and clones automation task. Choices:
|
|
Specify whether to create a pair that has the clone attribute specified. If you specify true for this attribute, do not specify the auto_split attribute. When creating a Thin Image Advanced pair, you cannot specify true. Required for the Create and clone snapshot pair /Create and clone snapshot pair with copy speed and clones automation task. Choices:
|
|
Specify whether to forcibly create a pair for a volume for which the capacity saving function is enabled. Default is True when capacity savings is not Choices:
|
|
ID of the mirror unit. Required for the Split a snapshot pair /Resync a snapshot pair /Restore a snapshot pair /Delete a snapshot pair /Clone snapshot pair/Thin Image pair /Unassign floating snapshot pair /Set retention period of an existing snapshot pair /Set retention period of snapshot pair after split tasks. Optional for the Create floating snapshot pair /Assign floating snapshot pair tasks. |
|
Specify the operation type for garbage data deletion. This can be set when the should_delete_tree attribute is set to true. Required for the Deleting garbage data of all Thin Image pairs in a snapshot tree task. |
|
ID of the pool where the snapshot will be allocated. Optional for the Create a snapshot pair /Create snapshot pair with a new consistency group /Create and auto-split a snapshot pair /Create a snapshot pair using an existing consistency group /Create and clone snapshot pair /Create Thin Image Advanced snapshot pair /Set retention period of snapshot pair with auto split tasks. Required for the Create and clone snapshot pair with copy speed and clones automation /Create floating snapshot pair tasks. |
|
ID of the primary volume. Required for the Create a snapshot pair /Create snapshot pair with a new consistency group /Split a snapshot pair /Resync a snapshot pair /Create and auto-split a snapshot pair /Restore a snapshot pair /Create a snapshot pair using an existing consistency group /Delete a snapshot pair /Delete Thin Image pairs by snapshot tree /Clone snapshot pair/Thin Image pair /Create and clone snapshot pair /Create and clone snapshot pair with copy speed and clones automation /Create floating snapshot pair /Assign floating snapshot pair /Unassign floating snapshot pair /Create Thin Image Advanced snapshot pair /Set retention period of an existing snapshot pair /Set retention period of snapshot pair after split /Set retention period of snapshot pair with auto split /Deleting garbage data of all Thin Image pairs in a snapshot tree tasks. |
|
Specify the retention period for the snapshot in hours. This can be set when the snapshot status is PSUS. This attribute can be used when the storage system is VSP One B20. You can specify this attribute only if the auto_split attribute is set to true for new pair. Required for the Set retention period of an existing snapshot pair /Set retention period of snapshot pair after split /Set retention period of snapshot pair with auto split tasks. |
|
Secondary volume id. Required for the Create floating snapshot pair /Assign floating snapshot pair /Unassign floating snapshot pair tasks. Optional for the Create Thin Image Advanced snapshot pair task. |
|
Specify whether to delete the secondary volume when deleting a snapshot pair. Required for the Delete a snapshot pair task. Choices:
|
|
Specify whether to delete garbage data of all Thin Image pairs in a snapshot tree. Required for the Delete Thin Image pairs by snapshot tree task. Choices:
|
|
Name of the snapshot group. Required for the Create a snapshot pair /Create snapshot pair with a new consistency group /Create and auto-split a snapshot pair /Create a snapshot pair using an existing consistency group /Create and clone snapshot pair /Create and clone snapshot pair with copy speed and clones automation /Create floating snapshot pair /Create Thin Image Advanced snapshot pair /Set retention period of snapshot pair with auto split tasks. |
|
Should wait for final state after initiating the snapshot operation. Choices:
|
|
The level of the snapshot task. Choices are 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 input parameters
consistency_group_idandenable_quick_modewere removed in version 3.4.0. These were 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.During automatic SVOL creation in a pair setup, the system provisions a single secondary host group/iSCSI target.
For Create a snapshot pair
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.)
Only VSP One B24, B26, and B28 support Thin Image Advanced.
For Create snapshot pair with a new consistency group
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.)
Only VSP One B24, B26, and B28 support Thin Image Advanced.
For Split a snapshot pair
Splitting a snapshot pair will fail if the pair belongs to a consistency group.
For Restore a snapshot pair
To restore a Thin Image and Thin Image Advanced pair, the pair must be in PSUS status. After restoration, the Thin Image Advanced pair remains in PSUS status, while the Thin Image pair changes to PAIR status.
For Delete a snapshot pair
If the pair includes an SVOL, it is unmapped from the associated host group(s), iSCSI target(s), and NVM subsystem(s), and then deleted.
For Delete Thin Image pairs by snapshot tree
Thin Image Advanced is not available for this task.
For Assign floating snapshot pair
Thin Image Advanced pairs must have a PSUS status assigned.
For Unassign floating snapshot pair
The SVOL is detached from the mapped host groups, iSCSI targets, and NVM subsystems, and then deleted.
For Set retention period of an existing snapshot pair
If your P-VOL and S-VOL are a new Thin Image (HTI) pair and the desired state is split, the workflow is
Create the new TI pair (from two unpaired volumes).
Split the pair to store snapshot data (so the snapshot is preserved and copy-on-write stops).
For Set retention period of snapshot pair after split If your P-VOL and S-VOL are a new Thin Image (HTI) pair and the desired state is split, the workflow is
Create the new TI pair (from two unpaired volumes).
Split the pair to store snapshot data (so the snapshot is preserved and copy-on-write stops).
For Set retention period of snapshot pair with auto split If your P-VOL and S-VOL are a new Thin Image (HTI) pair and the desired state is split, the workflow is
Create the new TI pair (from two unpaired volumes).
Split the pair to store snapshot data (so the snapshot is preserved and copy-on-write stops).
For Deleting garbage data of all Thin Image pairs in a snapshot tree
Thin Image Advanced pairs do not support this task.
Examples
- name: Create a snapshot
hitachivantara.vspone_block.vsp.hv_snapshot:
state: present
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
pool_id: 1
snapshot_group_name: "snap_group"
- name: Create a thin image advance cascade
hitachivantara.vspone_block.vsp.hv_snapshot:
state: present
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
pool_id: 1
snapshot_group_name: "snap_group"
can_cascade: true
is_data_reduction_force_copy: true
- name: Create a thin image clone pair
hitachivantara.vspone_block.vsp.hv_snapshot:
state: present
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
pool_id: 1
snapshot_group_name: "snap_group"
is_clone: true
- name: Clone a thin image clone pair
hitachivantara.vspone_block.vsp.hv_snapshot:
state: clone
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
mirror_unit: 3
- name: Delete a snapshot
hitachivantara.vspone_block.vsp.hv_snapshot:
state: absent
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
mirror_unit: 10
- name: Split a snapshot
hitachivantara.vspone_block.vsp.hv_snapshot:
state: split
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
mirror_unit: 10
- name: Resync a snapshot
hitachivantara.vspone_block.vsp.hv_snapshot:
state: resync
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
mirror_unit: 10
- name: Restore a snapshot
hitachivantara.vspone_block.vsp.hv_snapshot:
state: restore
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
mirror_unit: 3
- name: Set the retention period for a snapshot
hitachivantara.vspone_block.vsp.hv_snapshot:
state: split
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
mirror_unit: 3
retention_period: 500
- name: Set the retention period for a snapshot with auto split.
hitachivantara.vspone_block.vsp.hv_snapshot:
state: split
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 123
mirror_unit: 3
retention_period: 500
pool_id: 1
snapshot_group_name: "snap_group"
- name: Create and clone snapshot pair with copy speed and clones automation
hitachivantara.vspone_block.vsp.hv_snapshot:
state: "present"
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 100
pool_id: 5
snapshot_group_name: "snapshot-group-name-1"
is_clone: true
copy_speed: "FAST"
clones_automation: true
- name: Create floating snapshot pair
hitachivantara.vspone_block.vsp.hv_snapshot:
state: "present"
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 100
secondary_volume_id: -1
pool_id: 5
snapshot_group_name: "snapshot-group-name-1"
mirror_unit_id: 4
- name: Assign floating snapshot pair
hitachivantara.vspone_block.vsp.hv_snapshot:
state: "present"
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 100
secondary_volume_id: 200
mirror_unit_id: 1
- name: Unassign floating snapshot pair
hitachivantara.vspone_block.vsp.hv_snapshot:
state: "present"
connection_info:
address: storage1.company.com
username: "username"
password: "password"
spec:
primary_volume_id: 100
secondary_volume_id: -1
mirror_unit_id: 1
- name: Deleting garbage data of all Thin Image pairs in a snapshot tree
hitachivantara.vspone_block.vsp.hv_snapshot:
connection_info:
address: storage1.company.com
username: "username"
password: "password"
state: "defragment"
spec:
primary_volume_id: 100
operation_type: "start"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
A list of snapshots gathered from the storage system. Returned: always |
|
Indicates if the snapshot can be cascaded. Returned: success Sample: |
|
Concordance rate of the snapshot operation. Returned: success Sample: |
|
Copy pace track size. Returned: success Sample: |
|
Copy rate of the snapshot. Returned: success Sample: |
|
Indicates if the snapshot is a clone. Returned: success Sample: |
|
Indicates if the snapshot has been cloned. Returned: success Sample: |
|
Indicates if the snapshot is part of a consistency group. Returned: success Sample: |
|
Indicates if data reduction force copy is enabled. Returned: success Sample: |
|
Indicates if redirect-on-write is enabled. Returned: success Sample: |
|
Indicates if the snapshot data is read-only. Returned: success |
|
Indicates if data is written in the secondary volume. Returned: success Sample: |
|
ID of the mirror unit. Returned: success Sample: |
|
ID of the pool where the snapshot is allocated. Returned: success Sample: |
|
Hexadecimal ID of the primary volume. Returned: success Sample: |
|
ID of the primary volume. Returned: success Sample: |
|
Progress rate of the snapshot operation. Returned: success Sample: |
|
List of host groups for the primary volume. Returned: success Sample: |
|
NVM subsystem name for the primary volume. Returned: success Sample: |
|
Processing status of the primary volume. Returned: success Sample: |
|
Retention period of the snapshot. Returned: success Sample: |
|
Hexadecimal ID of the secondary volume. Returned: success Sample: |
|
ID of the secondary volume. Returned: success Sample: |
|
Name of the snapshot group. Returned: success Sample: |
|
ID of the snapshot. Returned: success Sample: |
|
Time when the snapshot was split. Returned: success Sample: |
|
Status of the snapshot. Returned: success Sample: |
|
List of host groups for the secondary volume. Returned: success Sample: |
|
NVM subsystem name for the secondary volume. Returned: success Sample: |
|
Processing status of the secondary volume. Returned: success Sample: |
|
Type of the snapshot. Returned: success Sample: |