dellemc.powerflex.snapshot_policy module – Manage snapshot policies on Dell PowerFlex
Note
This module is part of the dellemc.powerflex collection (version 1.9.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_policy
.
New in dellemc.powerflex 1.7.0
Synopsis
Managing snapshot policies on PowerFlex storage system includes creating, getting details, modifying attributes, adding a source volume, removing a source volume and deleting a snapshot policy.
Requirements
The below requirements are needed on the host that executes this module.
A Dell PowerFlex storage system version 3.5 or later.
Ansible-core 2.13 or later.
PyPowerFlex 1.8.0.
Python 3.9, 3.10 or 3.11.
Parameters
Parameter |
Comments |
---|---|
Access mode of the snapshot policy. Choices:
|
|
The auto snapshot creation cadence of the snapshot policy. |
|
The time between creation of two snapshots. |
|
The unit of the auto snapshot creation cadence. Choices:
|
|
IP or FQDN of the PowerFlex host. |
|
New name of the snapshot policy. |
|
Number of retained snapshots per level. |
|
The password of the PowerFlex host. |
|
Whether to pause or resume the snapshot policy. Choices:
|
|
Port number through which communication happens with PowerFlex host. Default: |
|
Whether to secure snapshots or not. Used only in the create operation. Choices:
|
|
The unique identifier of the snapshot policy. Except create operation, all other operations can be performed using snapshot_policy_id. Mutually exclusive with snapshot_policy_name. |
|
The name of the snapshot policy. It is unique across the PowerFlex array. Mutually exclusive with snapshot_policy_id. |
|
The source volume details to be added or removed. |
|
Ways to handle the snapshots created by the policy (auto snapshots). Must be provided when state is set to Choices:
|
|
Whether to detach the locked auto snapshots during removal of source volume. Choices:
|
|
The unique identifier of the source volume to be added or removed. Mutually exclusive with name. |
|
The name of the source volume to be added or removed. Mutually exclusive with id. |
|
The state of the source volume. When When Choices:
|
|
State of the snapshot policy. Choices:
|
|
Time after which connection will get terminated. It is to be mentioned in seconds. Default: |
|
The username of the PowerFlex host. |
|
Boolean variable to specify whether or not to validate SSL certificate.
Choices:
|
Notes
Note
The check_mode is supported.
The modules present in the collection named as ‘dellemc.powerflex’ are built to support the Dell PowerFlex storage platform.
Examples
- name: Create a snapshot policy
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_name: "snapshot_policy_name_1"
access_mode: "READ_WRITE"
secure_snapshots: False
auto_snapshot_creation_cadence:
time: 1
unit: "Hour"
num_of_retained_snapshots_per_level:
- 20
state: "present"
- name: Get snapshot policy details using name
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_name: "snapshot_policy_name_1"
- name: Get snapshot policy details using id
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_id: "snapshot_policy_id_1"
- name: Modify a snapshot policy
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_name: "snapshot_policy_name_1"
auto_snapshot_creation_cadence:
time: 2
unit: "Hour"
num_of_retained_snapshots_per_level:
- 40
- name: Rename a snapshot policy
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_name: "snapshot_policy_name_1"
new_name: "snapshot_policy_name_1_new"
- name: Add source volume
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_name: "snapshot_policy_name_1"
source_volume:
- name: "source_volume_name_1"
- id: "source_volume_id_2"
state: "present"
- name: Remove source volume
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_name: "{{snapshot_policy_name}}"
source_volume:
- name: "source_volume_name_1"
auto_snap_removal_action: 'Remove'
state: "absent"
- id: "source_volume_id_2"
auto_snap_removal_action: 'Remove'
detach_locked_auto_snapshots: True
state: "absent"
- name: Pause a snapshot policy
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_name: "{{snapshot_policy_name}}"
pause: True
- name: Resume a snapshot policy
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_name: "{{snapshot_policy_name}}"
pause: False
- name: Delete a snapshot policy
dellemc.powerflex.snapshot_policy:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_policy_name: "snapshot_policy_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 policy. Returned: When snapshot policy exists Sample: |
|
The snapshot rule of the snapshot policy. Returned: success |
|
The ID of the snapshot policy. Returned: success |
|
The reason for the failure of last auto snapshot creation . Returned: success |
|
Whether the last auto snapshot in first level failed. Returned: success |
|
Maximum number of VTree auto snapshots. Returned: success |
|
Name of the snapshot policy. Returned: success |
|
The time of creation of the next auto snapshot. Returned: success |
|
Number of auto snapshots. Returned: success |
|
Number of creation failures. Returned: success |
|
Number of expired but locked snapshots. Returned: success |
|
Number of locked snapshots. Returned: success |
|
Number of snapshots retained per level Returned: success |
|
Number of source volumes. Returned: success |
|
Whether the snapshots are secured. Returned: success |
|
Access mode of the snapshots. Returned: success |
|
State of the snapshot policy. Returned: success |
|
Statistics details of the snapshot policy. Returned: success |
|
Volume Ids of all the auto snapshots. Returned: success |
|
Ids of expired but locked snapshots. Returned: success |
|
Number of auto snapshots. Returned: success |
|
Number of expired but locked snapshots. Returned: success |
|
Number of source volumes. Returned: success |
|
Ids of the source volumes. Returned: success |
|
Unique identifier of the PowerFlex system. Returned: success |
|
Time of the last auto snapshot creation. Returned: success |
|
Time of the failure of the last auto snapshot creation. Returned: success |