hitachivantara.vspone_block.vsp.hv_snapshot module – Manages snapshots on Hitachi VSP storage systems.

Note

This module is part of the hitachivantara.vspone_block collection (version 3.4.0).

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

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.8

Parameters

Parameter

Comments

connection_info

dictionary / required

Information required to establish a connection to the storage system.

address

string / required

IP address or hostname of the storage system.

api_token

string

This field is used to pass the value of the lock token to operate on locked resources.

connection_type

string

Type of connection to the storage system.

Choices:

  • "direct" ← (default)

password

string

Password for authentication. This is a required field.

username

string

Username for authentication. This is a required field.

spec

dictionary / required

Specification for the snapshot task.

allocate_new_consistency_group

boolean

Specify whether to allocate a consistency group.

Choices:

  • false

  • true

auto_split

boolean

Specify whether to automatically split the pair.

Choices:

  • false

  • true

can_cascade

boolean

Specify whether the pair can be cascaded. Default is True when capacity savings is not disabled, Lun may not required to add to any host group when is it true.

Choices:

  • false

  • true

clones_automation

boolean

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.

Choices:

  • false

  • true

copy_speed

string

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.

Choices:

  • "SLOW"

  • "MEDIUM"

  • "FAST"

is_clone

boolean

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.

Choices:

  • false

  • true

is_data_reduction_force_copy

boolean

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 disabled.

Choices:

  • false

  • true

mirror_unit_id

integer

ID of the mirror unit.

pool_id

integer

ID of the pool where the snapshot will be allocated.

primary_volume_id

integer / required

ID of the primary volume.

retention_period

integer

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.

secondary_volume_id

integer

Secondary volume id.

snapshot_group_name

string

Name of the snapshot group.

state

string

The level of the snapshot task. Choices are present, absent, split, sync, restore, clone.

Choices:

  • "present" ← (default)

  • "absent"

  • "split"

  • "sync"

  • "restore"

  • "clone"

storage_system_info

dictionary

Information about the storage system. This field is an optional field.

serial

string

The serial number of the storage system.

Attributes

Attribute

Support

Description

check_mode

Support: none

Determines if the module should run in check mode.

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

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

snapshots

list / elements=dictionary

A list of snapshots gathered from the storage system.

Returned: always

can_cascade

boolean

Indicates if the snapshot can be cascaded.

Returned: success

Sample: true

concordance_rate

integer

Concordance rate of the snapshot operation.

Returned: success

Sample: 100

copy_pace_track_size

string

Copy pace track size.

Returned: success

Sample: ""

copy_rate

integer

Copy rate of the snapshot.

Returned: success

Sample: -1

is_consistency_group

boolean

Indicates if the snapshot is part of a consistency group.

Returned: success

Sample: true

mirror_unit_id

integer

ID of the mirror unit.

Returned: success

Sample: 3

pool_id

integer

ID of the pool where the snapshot is allocated.

Returned: success

Sample: 12

primary_hex_volume_id

string

Hexadecimal ID of the primary volume.

Returned: success

Sample: "00:04:06"

primary_or_secondary

string

Indicates if the volume is primary or secondary.

Returned: success

Sample: "P-VOL"

primary_volume_id

integer

ID of the primary volume.

Returned: success

Sample: 1030

progress_rate

integer

Progress rate of the snapshot operation.

Returned: success

Sample: 90

retention_period_in_hours

integer

Retention period of the snapshot.

Returned: success

Sample: 60

secondary_hex_volume_id

string

Hexadecimal ID of the secondary volume.

Returned: success

Sample: "00:04:07"

secondary_volume_id

integer

ID of the secondary volume.

Returned: success

Sample: 1031

snapshot_group_name

string

Name of the snapshot group.

Returned: success

Sample: "NewNameSPG"

snapshot_id

string

ID of the snapshot.

Returned: success

Sample: "1030,3"

status

string

Status of the snapshot.

Returned: success

Sample: "PAIR"

storage_serial_number

integer

Serial number of the storage system.

Returned: success

Sample: 810050

svol_access_mode

string

Access mode of the secondary volume.

Returned: success

Sample: ""

type

string

Type of the snapshot.

Returned: success

Sample: ""

Authors

  • Hitachi Vantara LTD (@hitachi-vantara)