dellemc.unity.snapshot module – Manage snapshots on the Unity storage system
Note
This module is part of the dellemc.unity collection (version 2.0.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 dellemc.unity
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: dellemc.unity.snapshot
.
New in dellemc.unity 1.1.0
Synopsis
Managing snapshots on the Unity storage system includes create snapshot, delete snapshot, update snapshot, get snapshot, map host and unmap host.
Requirements
The below requirements are needed on the host that executes this module.
A Dell Unity Storage device version 5.1 or later.
Ansible-core 2.14 or later.
Python 3.9, 3.10 or 3.11.
Storops Python SDK 1.2.11.
Parameters
Parameter |
Comments |
---|---|
This option specifies whether the snapshot is auto deleted or not. If set to If set to (false), snapshot will not be auto deleted based on the pool auto deletion policy. Option auto_delete can not be set to If during creation neither auto_delete nor expiry_time is mentioned then snapshot will be created keeping auto_delete as Once the expiry_time is set then snapshot cannot be assigned to the auto delete policy. Choices:
|
|
The name of the Consistency Group for which snapshot is created. For creation of a snapshot either vol_name or cg_name is required. Not required for other operations. |
|
The additional information about the snapshot can be provided using this option. |
|
This option is for specifying the date and time after which the snapshot will expire. The time is to be mentioned in UTC timezone. The format is “MM/DD/YYYY HH:MM”. Year must be in 4 digits. |
|
The id of the host. Either host_name or host_id is required to map or unmap a snapshot from a host. Snapshot can be attached to multiple hosts. |
|
The name of the host. Either host_name or host_id is required to map or unmap a snapshot from a host. Snapshot can be attached to multiple hosts. |
|
The host_state option is used to mention the existence of the host for snapshot. It is required when a snapshot is mapped or unmapped from host. Choices:
|
|
New name for the snapshot. |
|
The password of the Unity management server. |
|
Port number through which communication happens with Unity management server. Default: |
|
The id of the snapshot. For all operations other than creation either snapshot_name or snapshot_id is required. |
|
The name of the snapshot. Mandatory parameter for creating a snapshot. For all other operations either snapshot_name or snapshot_id is required. |
|
The state option is used to mention the existence of the snapshot. Choices:
|
|
IP or FQDN of the Unity management server. |
|
The username of the Unity management server. |
|
Boolean variable to specify whether or not to validate SSL certificate.
Choices:
|
|
The name of the volume for which snapshot is created. For creation of a snapshot either vol_name or cg_name is required. Not required for other operations. |
Notes
Note
The check_mode is not supported.
The modules present in this collection named as ‘dellemc.unity’ are built to support the Dell Unity storage platform.
Examples
- name: Create a Snapshot for a CG
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
cg_name: "{{cg_name}}"
snapshot_name: "{{cg_snapshot_name}}"
description: "{{description}}"
auto_delete: false
state: "present"
- name: Create a Snapshot for a volume with Host attached
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "{{vol_name}}"
snapshot_name: "{{vol_snapshot_name}}"
description: "{{description}}"
expiry_time: "04/15/2025 16:30"
host_name: "{{host_name}}"
host_state: "mapped"
state: "present"
- name: Unmap a host for a Snapshot
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
snapshot_name: "{{vol_snapshot_name}}"
host_name: "{{host_name}}"
host_state: "unmapped"
state: "present"
- name: Map snapshot to a host
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
snapshot_name: "{{vol_snapshot_name}}"
host_name: "{{host_name}}"
host_state: "mapped"
state: "present"
- name: Update attributes of a Snapshot for a volume
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_name: "{{vol_snapshot_name}}"
new_snapshot_name: "{{new_snapshot_name}}"
description: "{{new_description}}"
host_name: "{{host_name}}"
host_state: "unmapped"
state: "present"
- name: Delete Snapshot of CG
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_name: "{{cg_snapshot_name}}"
state: "absent"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Whether or not the resource has changed. Returned: always Sample: |
|
Details of the snapshot. Returned: When snapshot exists Sample: |
|
Date and time after which the snapshot will expire. Returned: success |
|
Contains the name and id of the associated hosts. Returned: success |
|
Unique identifier of the snapshot instance. Returned: success |
|
Additional information mentioned for snapshot. Returned: success |
|
The name of the snapshot. Returned: success |
|
Id of the storage resource for which the snapshot exists. Returned: success |
|
Name of the storage resource for which the snapshot exists. Returned: success |