dellemc / dellemc.powermax / 3.0.0 / module / snapshotpolicy Manage snapshot policy on PowerMax/VMAX Storage System | "added in version" 1.5.0 of dellemc.powermax" Authors: Rajshree Khare (@khareRajshree) <ansible.team@dell.com>dellemc.powermax.snapshotpolicy (3.0.0) — module
Install with ansible-galaxy collection install dellemc.powermax:==3.0.0
collections: - name: dellemc.powermax version: 3.0.0
Managing a snapshot policy on a PowerMax storage system includes getting details of any specific snapshot policy, creating a snapshot policy, modifying snapshot policy attributes, modifying snapshot policy state, associating or disassociating storage groups to or from snapshot policy and deleting a snapshot policy.
- name: Create a snapshot policy dellemc.powermax.snapshotpolicy: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" snapshot_policy_name: "10min_policy_1" interval: "10 Minutes" secure: false snapshot_count: 10 offset_mins: 2 compliance_count_warning: 6 compliance_count_critical: 4 state: "present"
- name: Create a snapshot policy and associate storage groups to it dellemc.powermax.snapshotpolicy: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" snapshot_policy_name: "10min_policy_2" interval: "10 Minutes" secure: false snapshot_count: 12 offset_mins: 5 compliance_count_warning: 8 compliance_count_critical: 4 storage_groups: - "11_ansible_test_1" - "11_ansible_test_2" storage_group_state: "present-in-policy" state: "present"
- name: Get snapshot policy details dellemc.powermax.snapshotpolicy: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" snapshot_policy_name: "10min_policy_2" state: "present"
- name: Modify snapshot policy attributes dellemc.powermax.snapshotpolicy: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" snapshot_policy_name: "10min_policy_2" new_snapshot_policy_name: "10min_policy_2_new" interval: "10 Minutes" snapshot_count: 16 offset_mins: 8 compliance_count_warning: 9 compliance_count_critical: 7 state: "present"
- name: Modify snapshot policy, associate to storage groups dellemc.powermax.snapshotpolicy: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" snapshot_policy_name: "10min_policy_1" storage_groups: - "11_ansible_test_1" - "11_ansible_test_2" storage_group_state: "present-in-policy" state: "present"
- name: Modify snapshot policy, disassociate from storage groups dellemc.powermax.snapshotpolicy: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" snapshot_policy_name: "10min_policy_1" storage_groups: - "11_ansible_test_1" - "11_ansible_test_2" storage_group_state: "absent-in-policy" state: "present"
- name: Modify snapshot policy state to suspend dellemc.powermax.snapshotpolicy: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" snapshot_policy_name: "10min_policy_1" suspend: true state: "present"
- name: Modify snapshot policy state to resume dellemc.powermax.snapshotpolicy: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" snapshot_policy_name: "10min_policy_1" suspend: false state: "present"
- name: Delete a snapshot policy dellemc.powermax.snapshotpolicy: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" snapshot_policy_name: "10min_policy_1" state: "absent"
user: description: - The username of the Unisphere host. required: true type: str state: choices: - present - absent description: - Shows if the snapshot policy should be present or absent. required: true type: str secure: choices: - true - false description: - Secure snapshots may only be terminated after they expire or by Dell Technologies support. - If not specified, default value is False. required: false type: bool suspend: choices: - true - false description: - Suspend the snapshot policy. - True indicates snapshot policy is in suspend state. - False indicates snapshot policy is in resume state. required: false type: bool timeout: default: 120 description: - Time after which the connection will get terminated. - It is to be mentioned in seconds. type: int interval: choices: - 10 Minutes - 12 Minutes - 15 Minutes - 20 Minutes - 30 Minutes - 1 Hour - 2 Hours - 3 Hours - 4 Hours - 6 Hours - 8 Hours - 12 Hours - 1 Day - 7 Days description: - The value of the interval counter for snapshot policy execution. required: false type: str password: description: - The password of the Unisphere host. required: true type: str serial_no: description: - The serial number of the PowerMax/VMAX array. It is a required parameter for all array-specific operations except for getting a list of arrays in the Gatherfacts module. required: true type: str universion: choices: - 92 - 100 - 101 description: - Unisphere version, currently '92', '100' and '101' version is supported. required: false type: int verifycert: description: - Specifies system whether to validate SSL certificate or not, Values can be True or False or a custom file path for SSL certificate with .pem extension or .cer with base 64 encoding. required: true type: str offset_mins: description: - Defines when, within the interval the snapshots will be taken for a specified snapshot policy. - The offset must be less than the interval of the snapshot policy. - The format must be in minutes. - If not specified, default value is 0. required: false type: int unispherehost: description: - IP or FQDN of the Unisphere host required: true type: str snapshot_count: description: - The max snapshot count of the policy. - Max value is 1024. required: false type: int storage_groups: description: - List of storage groups. elements: str required: false type: list storage_group_state: choices: - present-in-policy - absent-in-policy description: - The state of the storage group with regard to the snapshot policy. - present-in-policy indicates associate SG to SP. - absent-in-policy indicates disassociate SG from SP. required: false type: str snapshot_policy_name: description: - Name of the snapshot policy. required: true type: str compliance_count_warning: description: - If the number of valid snapshots falls below this number, the compliance changes to warning (yellow). required: false type: int new_snapshot_policy_name: description: - New name of the snapshot policy. required: false type: str compliance_count_critical: description: - If the number of valid snapshots falls below this number, the compliance changes to critical (red). required: false type: int
changed: description: Whether or not the resource has changed. returned: always type: bool snapshot_policy_details: contains: compliance_count_critical: description: The number of valid snapshots that have critical compliance. type: int compliance_count_warning: description: The number of valid snapshots that have warning compliance. type: int interval_minutes: description: The interval minutes for snapshot policy execution. type: int last_time_used: description: The timestamp indicating the last time snapshot policy was used. type: str offset_minutes: description: It is the time in minutes within the interval when the snapshots will be taken for a specified Snapshot Policy. type: int secure: description: True value indicates that the secure snapshots may only be terminated after they expire or by Dell Technologies support. type: bool snapshot_count: description: It is the max snapshot count of the policy. type: int snapshot_policy_name: description: Name of the snapshot policy. type: str storage_group: description: The list of storage groups associated with the snapshot policy. type: list storage_group_count: description: The number of storage groups associated with the snapshot policy. type: int storage_group_snapshotID: description: Pair of storage group and list of snapshot IDs associated with the snapshot policy. type: list suspended: description: The state of the snapshot policy, true indicates policy is in suspend state. type: bool symmetrixID: description: The symmetrix on which snapshot policy exists. type: str description: Details of the snapshot policy. returned: When snapshot policy exists. type: complex