ibm.storage_virtualize.ibm_sv_manage_snapshot module – This module manages snapshots (PiT image of a volume) on IBM Storage Virtualize family systems

Note

This module is part of the ibm.storage_virtualize collection (version 2.2.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 ibm.storage_virtualize.

To use it in a playbook, specify: ibm.storage_virtualize.ibm_sv_manage_snapshot.

New in ibm.storage_virtualize 1.9.0

Synopsis

  • In this implementation, a snapshot is a mutually consistent image of the volumes in a volume group or a list of independent volume(s).

  • This Ansible module provides the interface to manage snapshots through ‘addsnapshot’, ‘chsnapshot’ and ‘rmsnapshot’ Storage Virtualize commands.

Parameters

Parameter

Comments

clustername

string / required

The hostname or management IP of the Storage Virtualize system.

domain

string

Domain for the Storage Virtualize system.

Valid when hostname is used for the parameter clustername.

ignorelegacy

boolean

Specifies the addition of the volume snapshots although there are already legacy FlashCopy mappings using the volume as a source.

Choices:

  • false ← (default)

  • true

log_path

string

Path of debug log file.

name

string

Specifies the name of a snapshot.

old_name

string

Specifies the old name of a snapshot.

Valid when state=present, to rename the existing snapshot.

ownershipgroup

string

Specifies the name of the ownershipgroup.

Valid when state=present, to update an existing snapshot.

password

string

REST API password for the Storage Virtualize system.

The parameters username and password are required if not using token to authenticate a user.

retentiondays

integer

added in ibm.storage_virtualize 1.10.0

Specifies the retention period in days.

safeguarded and retentiondays are required together.

Applies, when state=present to create a safeguarded snapshot.

retentionminutes

integer

added in ibm.storage_virtualize 2.3.0

Specifies the retention period in minutes in range 1 - 1440.

retentionminutes and retentiondays are mutually exclusive.

Applies, when state=present to create a transient snapshot.

safeguarded

boolean

added in ibm.storage_virtualize 1.10.0

Flag to create a safeguarded snapshot.

safeguarded and retentiondays are required together.

Supported in SV build 8.5.2.0 or later.

Choices:

  • false

  • true

snapshot_pool

string

Specifies the name of child pool within which the snapshot is being created.

src_volume_names

string

Specifies the name of the volumes for which the snapshots are to be created.

List of volume names can be specified with the delimiter colon.

Valid when state=present, to create a snapshot.

src_volumegroup_name

string

Specifies the name of the source volume group for which the snapshot is being created.

src_volumegroup_name and src_volume_names are mutually exclusive.

Required one of src_volumegroup_name or src_volume_names for creation of snapshot.

state

string / required

Creates, updates (present), restores from (restore) or deletes (absent) a snapshot.

Choices:

  • "present"

  • "restore"

  • "absent"

token

string

The authentication token to verify a user on the Storage Virtualize system.

To generate a token, use the ibm.storage_virtualize.ibm_svc_auth module.

username

string

REST API username for the Storage Virtualize system.

The parameters username and password are required if not using token to authenticate a user.

validate_certs

boolean

Validates certification.

Choices:

  • false ← (default)

  • true

Notes

Note

  • This module supports check_mode.

  • This module automates the new Snapshot function, implemented by Storage Virtualize, which is using a simplified management model. Any user requiring the flexibility available with legacy FlashCopy can continue to use the existing module ibm.storage_virtualize.ibm_svc_manage_flashcopy.

  • Snapshots created by this Ansible module are not directly accessible from the hosts. To create a new group of host accessible volumes from a snapshot, use ibm.storage_virtualize.ibm_svc_manage_volumegroup module.

Examples

- name: Create volumegroup snapshot
  ibm.storage_virtualize.ibm_sv_manage_snapshot:
   clustername: '{{clustername}}'
   username: '{{username}}'
   password: '{{password}}'
   name: ansible_1
   src_volumegroup_name: volumegroup1
   snapshot_pool: Pool0Childpool0
   state: present
- name: Create volumes snapshot
  ibm.storage_virtualize.ibm_sv_manage_snapshot:
   clustername: '{{clustername}}'
   username: '{{username}}'
   password: '{{password}}'
   name: ansible_2
   src_volume_names: vdisk0:vdisk1
   snapshot_pool: Pool0Childpool0
   state: present
- name: Create safeguarded snapshot
  ibm.storage_virtualize.ibm_sv_manage_snapshot:
   clustername: '{{clustername}}'
   username: '{{username}}'
   password: '{{password}}'
   name: ansible_2
   src_volume_names: vdisk0:vdisk1
   safeguarded: true
   retentiondays: 1
   snapshot_pool: Pool0Childpool0
   state: present
- name: Update snapshot ansible_2
  ibm.storage_virtualize.ibm_sv_manage_snapshot:
   clustername: '{{clustername}}'
   username: '{{username}}'
   password: '{{password}}'
   name: ansible_new
   old_name: ansible_2
   ownershipgroup: ownershipgroup0
   state: present
- name: Restore volumes of a volumegroup from a snapshot
  ibm.storage_virtualize.ibm_sv_manage_snapshot:
   clustername: '{{clustername}}'
   username: '{{username}}'
   password: '{{password}}'
   name: ansible_1
   src_volumegroup_name: volumegroup1
   snapshot_pool: Pool0Childpool0
   state: restore
- name: Create transient snapshot
  ibm.storage_virtualize.ibm_sv_manage_snapshot:
   clustername: '{{clustername}}'
   username: '{{username}}'
   password: '{{password}}'
   name: ansible_2
   src_volume_names: vdisk0:vdisk1
   safeguarded: true
   retentionminutes: 5
   snapshot_pool: Pool0Childpool0
   state: present
- name: Delete volumegroup snapshot
  ibm.storage_virtualize.ibm_sv_manage_snapshot:
   clustername: '{{clustername}}'
   username: '{{username}}'
   password: '{{password}}'
   name: ansible_1
   src_volumegroup_name: volumegroup1
   state: absent
- name: Delete volume snapshot
  ibm.storage_virtualize.ibm_sv_manage_snapshot:
   clustername: '{{clustername}}'
   username: '{{username}}'
   password: '{{password}}'
   name: ansible_new
   state: absent

Authors

  • Sanjaikumaar M (@sanjaikumaar)

  • Sumit Kumar Gupta (@sumitguptaibm)