| 1 |
.. _snapshot_v2_module: |
| 2 |
|
| 3 |
|
| 4 |
snapshot_v2 -- Manage Snapshots on Dell PowerFlex |
| 5 |
================================================= |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
Managing snapshots on PowerFlex Storage System includes creating, getting details, modifying the attributes and deleting snapshot. |
| 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 5.0 or later. |
| 24 |
- PyPowerFlex 2.0.0 |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
Parameters |
| 29 |
---------- |
| 30 |
|
| 31 |
snapshot_name (optional, str, None) |
| 32 |
The name of the snapshot. |
| 33 |
|
| 34 |
Mandatory for create operation. |
| 35 |
|
| 36 |
Specify either :emphasis:`snapshot\_name` or :emphasis:`snapshot\_id` (but not both) for any operation. |
| 37 |
|
| 38 |
|
| 39 |
snapshot_id (optional, str, None) |
| 40 |
The ID of the Snapshot. |
| 41 |
|
| 42 |
|
| 43 |
vol_name (optional, str, None) |
| 44 |
The name of the volume for which snapshot will be taken. |
| 45 |
|
| 46 |
Specify either :emphasis:`vol\_name` or :emphasis:`vol\_id` while creating snapshot. |
| 47 |
|
| 48 |
|
| 49 |
vol_id (optional, str, None) |
| 50 |
The ID of the volume. |
| 51 |
|
| 52 |
|
| 53 |
snapshot_new_name (optional, str, None) |
| 54 |
New name of the snapshot. Used to rename the snapshot. |
| 55 |
|
| 56 |
|
| 57 |
desired_retention (optional, int, None) |
| 58 |
The retention value for the Snapshot. |
| 59 |
|
| 60 |
If the desired\_retention is not mentioned during creation, snapshot will be created with unlimited retention. |
| 61 |
|
| 62 |
Maximum supported desired retention is 31 days. |
| 63 |
|
| 64 |
|
| 65 |
retention_unit (optional, str, None) |
| 66 |
The unit for retention. It defaults to :literal:`hours`\ , if not specified. |
| 67 |
|
| 68 |
|
| 69 |
remove_mode (optional, str, None) |
| 70 |
Removal mode for the snapshot. |
| 71 |
|
| 72 |
It defaults to :literal:`ONLY\_ME`\ , if not specified. |
| 73 |
|
| 74 |
|
| 75 |
state (optional, str, present) |
| 76 |
State of the snapshot. |
| 77 |
|
| 78 |
|
| 79 |
hostname (True, str, None) |
| 80 |
IP or FQDN of the PowerFlex host. |
| 81 |
|
| 82 |
|
| 83 |
username (True, str, None) |
| 84 |
The username of the PowerFlex host. |
| 85 |
|
| 86 |
|
| 87 |
password (True, str, None) |
| 88 |
The password of the PowerFlex host. |
| 89 |
|
| 90 |
|
| 91 |
validate_certs (optional, bool, True) |
| 92 |
Boolean variable to specify whether or not to validate SSL certificate. |
| 93 |
|
| 94 |
:literal:`true` - Indicates that the SSL certificate should be verified. |
| 95 |
|
| 96 |
:literal:`false` - Indicates that the SSL certificate should not be verified. |
| 97 |
|
| 98 |
|
| 99 |
port (optional, int, 443) |
| 100 |
Port number through which communication happens with PowerFlex host. |
| 101 |
|
| 102 |
|
| 103 |
timeout (False, int, 120) |
| 104 |
Time after which connection will get terminated. |
| 105 |
|
| 106 |
It is to be mentioned in seconds. |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
Notes |
| 113 |
----- |
| 114 |
|
| 115 |
.. note:: |
| 116 |
- Snapshots are read-only since PowerFlex 5.0.0 |
| 117 |
- The modules present in the collection named as 'dellemc.powerflex' are built to support the Dell PowerFlex storage platform. |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
Examples |
| 123 |
-------- |
| 124 |
|
| 125 |
.. code-block:: yaml+jinja |
| 126 |
|
| 127 |
|
| 128 |
- name: Create snapshot |
| 129 |
dellemc.powerflex.snapshot_v2: |
| 130 |
hostname: "{{hostname}}" |
| 131 |
username: "{{username}}" |
| 132 |
password: "{{password}}" |
| 133 |
validate_certs: "{{validate_certs}}" |
| 134 |
snapshot_name: "ansible_snapshot" |
| 135 |
vol_name: "ansible_volume" |
| 136 |
desired_retention: 2 |
| 137 |
state: "present" |
| 138 |
|
| 139 |
- name: Get snapshot details using snapshot id |
| 140 |
dellemc.powerflex.snapshot_v2: |
| 141 |
hostname: "{{hostname}}" |
| 142 |
username: "{{username}}" |
| 143 |
password: "{{password}}" |
| 144 |
validate_certs: "{{validate_certs}}" |
| 145 |
snapshot_id: "fe6cb28200000007" |
| 146 |
state: "present" |
| 147 |
|
| 148 |
- name: Rename snapshot |
| 149 |
dellemc.powerflex.snapshot_v2: |
| 150 |
hostname: "{{hostname}}" |
| 151 |
username: "{{username}}" |
| 152 |
password: "{{password}}" |
| 153 |
validate_certs: "{{validate_certs}}" |
| 154 |
snapshot_id: "fe6cb28200000007" |
| 155 |
snapshot_new_name: "ansible_renamed_snapshot_10" |
| 156 |
state: "present" |
| 157 |
|
| 158 |
- name: Delete snapshot |
| 159 |
dellemc.powerflex.snapshot_v2: |
| 160 |
hostname: "{{hostname}}" |
| 161 |
username: "{{username}}" |
| 162 |
password: "{{password}}" |
| 163 |
validate_certs: "{{validate_certs}}" |
| 164 |
snapshot_id: "fe6cb28200000007" |
| 165 |
remove_mode: "ONLY_ME" |
| 166 |
state: "absent" |
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
Return Values |
| 171 |
------------- |
| 172 |
|
| 173 |
changed (always, bool, false) |
| 174 |
Whether or not the resource has changed. |
| 175 |
|
| 176 |
|
| 177 |
snapshot_details (When snapshot exists, dict, {'accessModeLimit': 'ReadOnly', 'ancestorVolumeId': 'cdd883cf00000002', 'ancestorVolumeName': 'ansible-volume-1', 'autoSnapshotGroupId': None, 'compressionMethod': 'Invalid', 'consistencyGroupId': '22f1e80c00000001', 'creationTime': 1631619229, 'dataLayout': 'MediumGranularity', 'genType': 'EC', 'id': 'cdd883d000000004', 'links': [{'href': '/api/instances/Volume::cdd883d000000004', 'rel': 'self'}, {'href': '/api/instances/Volume::cdd883d000000004/relationships /Statistics', 'rel': '/api/Volume/relationship/Statistics'}, {'href': '/api/instances/Volume::cdd883cf00000002', 'rel': '/api/parent/relationship/ancestorVolumeId'}, {'href': '/api/instances/VTree::6e86255c00000001', 'rel': '/api/parent/relationship/vtreeId'}, {'href': '/api/instances/StoragePool::e0d8f6c900000000', 'rel': '/api/parent/relationship/storagePoolId'}], 'lockedAutoSnapshot': False, 'lockedAutoSnapshotMarkedForRemoval': False, 'managedBy': 'ScaleIO', 'mappedSdcInfo': None, 'name': 'ansible_vol_snap_1', 'notGenuineSnapshot': False, 'nsid': 23, 'originalExpiryTime': 0, 'pairIds': None, 'replicationJournalVolume': False, 'replicationTimeStamp': 0, 'retentionInHours': 0, 'retentionLevels': [], 'secureSnapshotExpTime': 0, 'sizeInGb': 16, 'sizeInKb': 16777216, 'snplIdOfAutoSnapshot': None, 'snplIdOfSourceVolume': None, 'storagePoolId': 'e0d8f6c900000000', 'storagePoolName': 'pool1', 'timeStampIsAccurate': False, 'useRmcache': False, 'volumeClass': 'defaultclass', 'volumeReplicationState': 'UnmarkedForReplication', 'volumeType': 'Snapshot', 'vtreeId': '6e86255c00000001'}) |
| 178 |
Details of the snapshot. |
| 179 |
|
| 180 |
|
| 181 |
ancestorVolumeId (, str, ) |
| 182 |
The ID of the root of the specified volume's V-Tree. |
| 183 |
|
| 184 |
|
| 185 |
ancestorVolumeName (, str, ) |
| 186 |
The name of the root of the specified volume's V-Tree. |
| 187 |
|
| 188 |
|
| 189 |
creationTime (, int, ) |
| 190 |
The creation time of the snapshot. |
| 191 |
|
| 192 |
|
| 193 |
id (, str, ) |
| 194 |
The ID of the snapshot. |
| 195 |
|
| 196 |
|
| 197 |
name (, str, ) |
| 198 |
Name of the snapshot. |
| 199 |
|
| 200 |
|
| 201 |
secureSnapshotExpTime (, int, ) |
| 202 |
Expiry time of the snapshot. |
| 203 |
|
| 204 |
|
| 205 |
sizeInKb (, int, ) |
| 206 |
Size of the snapshot. |
| 207 |
|
| 208 |
|
| 209 |
sizeInGb (, int, ) |
| 210 |
Size of the snapshot. |
| 211 |
|
| 212 |
|
| 213 |
retentionInHours (, int, ) |
| 214 |
Retention of the snapshot in hours. |
| 215 |
|
| 216 |
|
| 217 |
storagePoolId (, str, ) |
| 218 |
The ID of the Storage pool in which snapshot resides. |
| 219 |
|
| 220 |
|
| 221 |
storagePoolName (, str, ) |
| 222 |
The name of the Storage pool in which snapshot resides. |
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
Status |
| 230 |
------ |
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
Authors |
| 237 |
~~~~~~~ |
| 238 |
|
| 239 |
- Yuhao Liu (@RayLiu7) <[email protected]> |
| 240 |
|