dellemc.powerflex.snapshot_v2 module – Manage Snapshots on Dell PowerFlex
Note
This module is part of the dellemc.powerflex collection (version 3.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.powerflex. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: dellemc.powerflex.snapshot_v2.
New in dellemc.powerflex 3.0.0
Synopsis
- Managing snapshots on PowerFlex Storage System includes creating, getting details, modifying the attributes and deleting snapshot.
Requirements
The below requirements are needed on the host that executes this module.
- A Dell PowerFlex storage system version 5.0 or later.
- PyPowerFlex 2.0.0
Parameters
Parameter | Comments |
|---|---|
desired_retention integer | The retention value for the Snapshot. If the desired_retention is not mentioned during creation, snapshot will be created with unlimited retention. Maximum supported desired retention is 31 days. |
hostname aliases: gateway_host string / required | IP or FQDN of the PowerFlex host. |
password string / required | The password of the PowerFlex host. |
port integer | Port number through which communication happens with PowerFlex host. Default: |
remove_mode string | Removal mode for the snapshot. It defaults to Choices:
|
retention_unit string | The unit for retention. It defaults to Choices:
|
snapshot_id string | The ID of the Snapshot. |
snapshot_name string | The name of the snapshot. Mandatory for create operation. Specify either snapshot_name or snapshot_id (but not both) for any operation. |
snapshot_new_name string | New name of the snapshot. Used to rename the snapshot. |
state string | State of the snapshot. Choices:
|
timeout integer | Time after which connection will get terminated. It is to be mentioned in seconds. Default: |
username string / required | The username of the PowerFlex host. |
validate_certs aliases: verifycert boolean | Boolean variable to specify whether or not to validate SSL certificate.
Choices:
|
vol_id string | The ID of the volume. |
vol_name string | The name of the volume for which snapshot will be taken. Specify either vol_name or vol_id while creating snapshot. |
Attributes
Attribute | Support | Description |
|---|---|---|
check_mode | Support: full | Runs task to validate without performing action on the target machine. |
diff_mode | Support: full | Runs the task to report the changes made or to be made. |
Notes
Note
- Snapshots are read-only since PowerFlex 5.0.0
- The modules present in the collection named as ‘dellemc.powerflex’ are built to support the Dell PowerFlex storage platform.
Examples
- name: Create snapshot
dellemc.powerflex.snapshot_v2:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_name: "ansible_snapshot"
vol_name: "ansible_volume"
desired_retention: 2
state: "present"
- name: Get snapshot details using snapshot id
dellemc.powerflex.snapshot_v2:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_id: "fe6cb28200000007"
state: "present"
- name: Rename snapshot
dellemc.powerflex.snapshot_v2:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_id: "fe6cb28200000007"
snapshot_new_name: "ansible_renamed_snapshot_10"
state: "present"
- name: Delete snapshot
dellemc.powerflex.snapshot_v2:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_id: "fe6cb28200000007"
remove_mode: "ONLY_ME"
state: "absent"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
changed boolean | Whether or not the resource has changed. Returned: always Sample: |
snapshot_details dictionary | Details of the snapshot. Returned: When snapshot exists Sample: |
|
ancestorVolumeId string |
The ID of the root of the specified volume’s V-Tree. Returned: success |
|
ancestorVolumeName string |
The name of the root of the specified volume’s V-Tree. Returned: success |
|
creationTime integer |
The creation time of the snapshot. Returned: success |
|
id string |
The ID of the snapshot. Returned: success |
|
name string |
Name of the snapshot. Returned: success |
|
retentionInHours integer |
Retention of the snapshot in hours. Returned: success |
|
secureSnapshotExpTime integer |
Expiry time of the snapshot. Returned: success |
|
sizeInGb integer |
Size of the snapshot. Returned: success |
|
sizeInKb integer |
Size of the snapshot. Returned: success |
|
storagePoolId string |
The ID of the Storage pool in which snapshot resides. Returned: success |
|
storagePoolName string |
The name of the Storage pool in which snapshot resides. Returned: success |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/dellemc/powerflex/snapshot_v2_module.html