| 1 |
.. _snapshot_policy_module: |
| 2 |
|
| 3 |
|
| 4 |
snapshot_policy -- Manage snapshot policies on Dell PowerFlex |
| 5 |
============================================================= |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
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. |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
Requirements |
| 20 |
------------ |
| 21 |
The below requirements are needed on the host that executes this module. |
| 22 |
|
| 23 |
- A Dell PowerFlex storage system version 3.6 or later. |
| 24 |
- PyPowerFlex 2.0.0. |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
Parameters |
| 29 |
---------- |
| 30 |
|
| 31 |
snapshot_policy_name (optional, str, None) |
| 32 |
The name of the snapshot policy. |
| 33 |
|
| 34 |
It is unique across the PowerFlex array. |
| 35 |
|
| 36 |
Mutually exclusive with :emphasis:`snapshot\_policy\_id`. |
| 37 |
|
| 38 |
|
| 39 |
snapshot_policy_id (optional, str, None) |
| 40 |
The unique identifier of the snapshot policy. |
| 41 |
|
| 42 |
Except create operation, all other operations can be performed using :emphasis:`snapshot\_policy\_id`. |
| 43 |
|
| 44 |
Mutually exclusive with :emphasis:`snapshot\_policy\_name`. |
| 45 |
|
| 46 |
|
| 47 |
auto_snapshot_creation_cadence (optional, dict, None) |
| 48 |
The auto snapshot creation cadence of the snapshot policy. |
| 49 |
|
| 50 |
|
| 51 |
time (optional, int, None) |
| 52 |
The time between creation of two snapshots. |
| 53 |
|
| 54 |
|
| 55 |
unit (optional, str, Minute) |
| 56 |
The unit of the auto snapshot creation cadence. |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
num_of_retained_snapshots_per_level (optional, list, None) |
| 61 |
Number of retained snapshots per level. |
| 62 |
|
| 63 |
|
| 64 |
new_name (optional, str, None) |
| 65 |
New name of the snapshot policy. |
| 66 |
|
| 67 |
|
| 68 |
access_mode (optional, str, None) |
| 69 |
Access mode of the snapshot policy. |
| 70 |
|
| 71 |
READ\_ONLY access\_mode is allowed only since PowerFlex 5.0. |
| 72 |
|
| 73 |
|
| 74 |
secure_snapshots (optional, bool, None) |
| 75 |
Whether to secure snapshots or not. |
| 76 |
|
| 77 |
Used only in the create operation. |
| 78 |
|
| 79 |
|
| 80 |
source_volume (optional, list, None) |
| 81 |
The source volume details to be added or removed. |
| 82 |
|
| 83 |
|
| 84 |
id (optional, str, None) |
| 85 |
The unique identifier of the source volume to be added or removed. |
| 86 |
|
| 87 |
Mutually exclusive with :emphasis:`name`. |
| 88 |
|
| 89 |
|
| 90 |
name (optional, str, None) |
| 91 |
The name of the source volume to be added or removed. |
| 92 |
|
| 93 |
Mutually exclusive with :emphasis:`id`. |
| 94 |
|
| 95 |
|
| 96 |
auto_snap_removal_action (optional, str, None) |
| 97 |
Ways to handle the snapshots created by the policy (auto snapshots). |
| 98 |
|
| 99 |
Must be provided when :emphasis:`state` is set to :literal:`'absent'`. |
| 100 |
|
| 101 |
|
| 102 |
detach_locked_auto_snapshots (optional, bool, None) |
| 103 |
Whether to detach the locked auto snapshots during removal of source volume. |
| 104 |
|
| 105 |
|
| 106 |
state (optional, str, present) |
| 107 |
The state of the source volume. |
| 108 |
|
| 109 |
When :literal:`present`\ , source volume will be added to the snapshot policy. |
| 110 |
|
| 111 |
When :literal:`absent`\ , source volume will be removed from the snapshot policy. |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
pause (optional, bool, None) |
| 116 |
Whether to pause or resume the snapshot policy. |
| 117 |
|
| 118 |
|
| 119 |
state (optional, str, present) |
| 120 |
State of the snapshot policy. |
| 121 |
|
| 122 |
|
| 123 |
hostname (True, str, None) |
| 124 |
IP or FQDN of the PowerFlex host. |
| 125 |
|
| 126 |
|
| 127 |
username (True, str, None) |
| 128 |
The username of the PowerFlex host. |
| 129 |
|
| 130 |
|
| 131 |
password (True, str, None) |
| 132 |
The password of the PowerFlex host. |
| 133 |
|
| 134 |
|
| 135 |
validate_certs (optional, bool, True) |
| 136 |
Boolean variable to specify whether or not to validate SSL certificate. |
| 137 |
|
| 138 |
:literal:`true` - Indicates that the SSL certificate should be verified. |
| 139 |
|
| 140 |
:literal:`false` - Indicates that the SSL certificate should not be verified. |
| 141 |
|
| 142 |
|
| 143 |
port (optional, int, 443) |
| 144 |
Port number through which communication happens with PowerFlex host. |
| 145 |
|
| 146 |
|
| 147 |
timeout (False, int, 120) |
| 148 |
Time after which connection will get terminated. |
| 149 |
|
| 150 |
It is to be mentioned in seconds. |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
Notes |
| 157 |
----- |
| 158 |
|
| 159 |
.. note:: |
| 160 |
- Deprecate statistics since PowerFlex 5.0. |
| 161 |
- Only READ\_ONLY access\_mode is allowed since PowerFlex 5.0. |
| 162 |
- The modules present in the collection named as 'dellemc.powerflex' are built to support the Dell PowerFlex storage platform. |
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
Examples |
| 168 |
-------- |
| 169 |
|
| 170 |
.. code-block:: yaml+jinja |
| 171 |
|
| 172 |
|
| 173 |
- name: Create a snapshot policy |
| 174 |
dellemc.powerflex.snapshot_policy: |
| 175 |
hostname: "{{hostname}}" |
| 176 |
username: "{{username}}" |
| 177 |
password: "{{password}}" |
| 178 |
validate_certs: "{{validate_certs}}" |
| 179 |
snapshot_policy_name: "snapshot_policy_name_1" |
| 180 |
access_mode: "READ_WRITE" |
| 181 |
secure_snapshots: false |
| 182 |
auto_snapshot_creation_cadence: |
| 183 |
time: 1 |
| 184 |
unit: "Hour" |
| 185 |
num_of_retained_snapshots_per_level: |
| 186 |
- 20 |
| 187 |
state: "present" |
| 188 |
|
| 189 |
- name: Get snapshot policy details using name |
| 190 |
dellemc.powerflex.snapshot_policy: |
| 191 |
hostname: "{{hostname}}" |
| 192 |
username: "{{username}}" |
| 193 |
password: "{{password}}" |
| 194 |
validate_certs: "{{validate_certs}}" |
| 195 |
snapshot_policy_name: "snapshot_policy_name_1" |
| 196 |
|
| 197 |
- name: Get snapshot policy details using id |
| 198 |
dellemc.powerflex.snapshot_policy: |
| 199 |
hostname: "{{hostname}}" |
| 200 |
username: "{{username}}" |
| 201 |
password: "{{password}}" |
| 202 |
validate_certs: "{{validate_certs}}" |
| 203 |
snapshot_policy_id: "snapshot_policy_id_1" |
| 204 |
|
| 205 |
- name: Modify a snapshot policy |
| 206 |
dellemc.powerflex.snapshot_policy: |
| 207 |
hostname: "{{hostname}}" |
| 208 |
username: "{{username}}" |
| 209 |
password: "{{password}}" |
| 210 |
validate_certs: "{{validate_certs}}" |
| 211 |
snapshot_policy_name: "snapshot_policy_name_1" |
| 212 |
auto_snapshot_creation_cadence: |
| 213 |
time: 2 |
| 214 |
unit: "Hour" |
| 215 |
num_of_retained_snapshots_per_level: |
| 216 |
- 40 |
| 217 |
|
| 218 |
- name: Rename a snapshot policy |
| 219 |
dellemc.powerflex.snapshot_policy: |
| 220 |
hostname: "{{hostname}}" |
| 221 |
username: "{{username}}" |
| 222 |
password: "{{password}}" |
| 223 |
validate_certs: "{{validate_certs}}" |
| 224 |
snapshot_policy_name: "snapshot_policy_name_1" |
| 225 |
new_name: "snapshot_policy_name_1_new" |
| 226 |
|
| 227 |
- name: Add source volume |
| 228 |
dellemc.powerflex.snapshot_policy: |
| 229 |
hostname: "{{hostname}}" |
| 230 |
username: "{{username}}" |
| 231 |
password: "{{password}}" |
| 232 |
validate_certs: "{{validate_certs}}" |
| 233 |
snapshot_policy_name: "snapshot_policy_name_1" |
| 234 |
source_volume: |
| 235 |
- name: "source_volume_name_1" |
| 236 |
- id: "source_volume_id_2" |
| 237 |
state: "present" |
| 238 |
|
| 239 |
- name: Remove source volume |
| 240 |
dellemc.powerflex.snapshot_policy: |
| 241 |
hostname: "{{hostname}}" |
| 242 |
username: "{{username}}" |
| 243 |
password: "{{password}}" |
| 244 |
validate_certs: "{{validate_certs}}" |
| 245 |
snapshot_policy_name: "{{snapshot_policy_name}}" |
| 246 |
source_volume: |
| 247 |
- name: "source_volume_name_1" |
| 248 |
auto_snap_removal_action: 'Remove' |
| 249 |
state: "absent" |
| 250 |
- id: "source_volume_id_2" |
| 251 |
auto_snap_removal_action: 'Remove' |
| 252 |
detach_locked_auto_snapshots: true |
| 253 |
state: "absent" |
| 254 |
|
| 255 |
- name: Pause a snapshot policy |
| 256 |
dellemc.powerflex.snapshot_policy: |
| 257 |
hostname: "{{hostname}}" |
| 258 |
username: "{{username}}" |
| 259 |
password: "{{password}}" |
| 260 |
validate_certs: "{{validate_certs}}" |
| 261 |
snapshot_policy_name: "{{snapshot_policy_name}}" |
| 262 |
pause: true |
| 263 |
|
| 264 |
- name: Resume a snapshot policy |
| 265 |
dellemc.powerflex.snapshot_policy: |
| 266 |
hostname: "{{hostname}}" |
| 267 |
username: "{{username}}" |
| 268 |
password: "{{password}}" |
| 269 |
validate_certs: "{{validate_certs}}" |
| 270 |
snapshot_policy_name: "{{snapshot_policy_name}}" |
| 271 |
pause: false |
| 272 |
|
| 273 |
- name: Delete a snapshot policy |
| 274 |
dellemc.powerflex.snapshot_policy: |
| 275 |
hostname: "{{hostname}}" |
| 276 |
username: "{{username}}" |
| 277 |
password: "{{password}}" |
| 278 |
validate_certs: "{{validate_certs}}" |
| 279 |
snapshot_policy_name: "snapshot_policy_name" |
| 280 |
state: "absent" |
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
Return Values |
| 285 |
------------- |
| 286 |
|
| 287 |
changed (always, bool, false) |
| 288 |
Whether or not the resource has changed. |
| 289 |
|
| 290 |
|
| 291 |
snapshot_policy_details (When snapshot policy exists, dict, {'autoSnapshotCreationCadenceInMin': 120, 'id': '15ae842800000004', 'lastAutoSnapshotCreationFailureReason': 'NR', 'lastAutoSnapshotFailureInFirstLevel': False, 'links': [{'href': '/api/instances/SnapshotPolicy::15ae842800000004', 'rel': 'self'}, {'href': '/api/instances/SnapshotPolicy::15ae842800000004/relationships/Statistics', 'rel': '/api/SnapshotPolicy/relationship/Statistics'}, {'href': '/api/instances/SnapshotPolicy::15ae842800000004/relationships/SourceVolume', 'rel': '/api/SnapshotPolicy/relationship/SourceVolume'}, {'href': '/api/instances/SnapshotPolicy::15ae842800000004/relationships/AutoSnapshotVolume', 'rel': '/api/SnapshotPolicy/relationship/AutoSnapshotVolume'}, {'href': '/api/instances/System::0e7a082862fedf0f', 'rel': '/api/parent/relationship/systemId'}], 'maxVTreeAutoSnapshots': 40, 'name': 'Sample_snapshot_policy_1', 'nextAutoSnapshotCreationTime': 1683709201, 'numOfAutoSnapshots': 0, 'numOfCreationFailures': 0, 'numOfExpiredButLockedSnapshots': 0, 'numOfLockedSnapshots': 0, 'numOfRetainedSnapshotsPerLevel': [40], 'numOfSourceVolumes': 0, 'secureSnapshots': False, 'snapshotAccessMode': 'ReadWrite', 'snapshotPolicyState': 'Active', 'statistics': {'autoSnapshotVolIds': [], 'expiredButLockedSnapshotsIds': [], 'numOfAutoSnapshots': 0, 'numOfExpiredButLockedSnapshots': 0, 'numOfSrcVols': 0, 'srcVolIds': []}, 'systemId': '0e7a082862fedf0f', 'timeOfLastAutoSnapshot': 0, 'timeOfLastAutoSnapshotCreationFailure': 0}) |
| 292 |
Details of the snapshot policy. |
| 293 |
|
| 294 |
|
| 295 |
autoSnapshotCreationCadenceInMin (, int, ) |
| 296 |
The snapshot rule of the snapshot policy. |
| 297 |
|
| 298 |
|
| 299 |
id (, str, ) |
| 300 |
The ID of the snapshot policy. |
| 301 |
|
| 302 |
|
| 303 |
lastAutoSnapshotCreationFailureReason (, str, ) |
| 304 |
The reason for the failure of last auto snapshot creation . |
| 305 |
|
| 306 |
|
| 307 |
name (, str, ) |
| 308 |
Name of the snapshot policy. |
| 309 |
|
| 310 |
|
| 311 |
lastAutoSnapshotFailureInFirstLevel (, bool, ) |
| 312 |
Whether the last auto snapshot in first level failed. |
| 313 |
|
| 314 |
|
| 315 |
maxVTreeAutoSnapshots (, int, ) |
| 316 |
Maximum number of VTree auto snapshots. |
| 317 |
|
| 318 |
|
| 319 |
nextAutoSnapshotCreationTime (, int, ) |
| 320 |
The time of creation of the next auto snapshot. |
| 321 |
|
| 322 |
|
| 323 |
numOfAutoSnapshots (, int, ) |
| 324 |
Number of auto snapshots. |
| 325 |
|
| 326 |
|
| 327 |
numOfCreationFailures (, int, ) |
| 328 |
Number of creation failures. |
| 329 |
|
| 330 |
|
| 331 |
numOfExpiredButLockedSnapshots (, int, ) |
| 332 |
Number of expired but locked snapshots. |
| 333 |
|
| 334 |
|
| 335 |
numOfLockedSnapshots (, int, ) |
| 336 |
Number of locked snapshots. |
| 337 |
|
| 338 |
|
| 339 |
numOfRetainedSnapshotsPerLevel (, list, ) |
| 340 |
Number of snapshots retained per level |
| 341 |
|
| 342 |
|
| 343 |
numOfSourceVolumes (, int, ) |
| 344 |
Number of source volumes. |
| 345 |
|
| 346 |
|
| 347 |
secureSnapshots (, bool, ) |
| 348 |
Whether the snapshots are secured. |
| 349 |
|
| 350 |
|
| 351 |
snapshotAccessMode (, str, ) |
| 352 |
Access mode of the snapshots. |
| 353 |
|
| 354 |
|
| 355 |
snapshotPolicyState (, str, ) |
| 356 |
State of the snapshot policy. |
| 357 |
|
| 358 |
|
| 359 |
systemId (, str, ) |
| 360 |
Unique identifier of the PowerFlex system. |
| 361 |
|
| 362 |
|
| 363 |
timeOfLastAutoSnapshot (, str, ) |
| 364 |
Time of the last auto snapshot creation. |
| 365 |
|
| 366 |
|
| 367 |
timeOfLastAutoSnapshotCreationFailure (, str, ) |
| 368 |
Time of the failure of the last auto snapshot creation. |
| 369 |
|
| 370 |
|
| 371 |
statistics (, dict, ) |
| 372 |
Statistics details of the snapshot policy. Deprecated since PowerFlex 5.0. |
| 373 |
|
| 374 |
|
| 375 |
autoSnapshotVolIds (, list, ) |
| 376 |
Volume Ids of all the auto snapshots. |
| 377 |
|
| 378 |
|
| 379 |
expiredButLockedSnapshotsIds (, list, ) |
| 380 |
Ids of expired but locked snapshots. |
| 381 |
|
| 382 |
|
| 383 |
numOfAutoSnapshots (, int, ) |
| 384 |
Number of auto snapshots. |
| 385 |
|
| 386 |
|
| 387 |
numOfExpiredButLockedSnapshots (, int, ) |
| 388 |
Number of expired but locked snapshots. |
| 389 |
|
| 390 |
|
| 391 |
numOfSrcVols (, int, ) |
| 392 |
Number of source volumes. |
| 393 |
|
| 394 |
|
| 395 |
srcVolIds (, list, ) |
| 396 |
Ids of the source volumes. |
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
Status |
| 405 |
------ |
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
Authors |
| 412 |
~~~~~~~ |
| 413 |
|
| 414 |
- Trisha Datta (@trisha-dell) <[email protected]> |
| 415 |
|