summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/powerflex/docs/modules/snapshot.rst
blob: 052453ad24022e0dfecebf60a7bb8c5748b45318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
.. _snapshot_module:


snapshot -- Manage Snapshots on Dell PowerFlex
==============================================

.. contents::
   :local:
   :depth: 1


Synopsis
--------

Managing snapshots on PowerFlex Storage System includes creating, getting details, mapping/unmapping to/from SDC, 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 3.6 or later.
- Ansible-core 2.14 or later.
- PyPowerFlex 1.9.0.
- Python 3.9, 3.10 or 3.11.



Parameters
----------

  snapshot_name (optional, str, None)
    The name of the snapshot.

    Mandatory for create operation.

    Specify either *snapshot_name* or *snapshot_id* (but not both) for any operation.


  snapshot_id (optional, str, None)
    The ID of the Snapshot.


  vol_name (optional, str, None)
    The name of the volume for which snapshot will be taken.

    Specify either *vol_name* or *vol_id* while creating snapshot.


  vol_id (optional, str, None)
    The ID of the volume.


  read_only (optional, bool, None)
    Specifies whether mapping of the created snapshot volume will have read-write access or limited to read-only access.

    If ``true``, snapshot is created with read-only access.

    If ``false``, snapshot is created with read-write access.


  size (optional, int, None)
    The size of the snapshot.


  cap_unit (optional, str, None)
    The unit of the volume size. It defaults to ``GB``, if not specified.


  snapshot_new_name (optional, str, None)
    New name of the snapshot. Used to rename the snapshot.


  allow_multiple_mappings (optional, bool, None)
    Specifies whether to allow multiple mappings or not.


  desired_retention (optional, int, None)
    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.


  retention_unit (optional, str, None)
    The unit for retention. It defaults to ``hours``, if not specified.


  sdc (optional, list, None)
    Specifies SDC parameters.


    sdc_name (optional, str, None)
      Name of the SDC.

      Specify either *sdc_name*, *sdc_id* or *sdc_ip*.

      Mutually exclusive with *sdc_id* and *sdc_ip*.


    sdc_id (optional, str, None)
      ID of the SDC.

      Specify either *sdc_name*, *sdc_id* or *sdc_ip*.

      Mutually exclusive with *sdc_name* and *sdc_ip*.


    sdc_ip (optional, str, None)
      IP of the SDC.

      Specify either *sdc_name*, *sdc_id* or *sdc_ip*.

      Mutually exclusive with *sdc_id* and *sdc_ip*.


    access_mode (optional, str, None)
      Define the access mode for all mappings of the snapshot.


    bandwidth_limit (optional, int, None)
      Limit of snapshot network bandwidth.

      Need to mention in multiple of 1024 Kbps.

      To set no limit, 0 is to be passed.


    iops_limit (optional, int, None)
      Limit of snapshot IOPS.

      Minimum IOPS limit is 11 and specify 0 for unlimited iops.



  sdc_state (optional, str, None)
    Mapping state of the SDC.


  remove_mode (optional, str, None)
    Removal mode for the snapshot.

    It defaults to ``ONLY_ME``, if not specified.


  state (True, str, None)
    State of the snapshot.


  hostname (True, str, None)
    IP or FQDN of the PowerFlex host.


  username (True, str, None)
    The username of the PowerFlex host.


  password (True, str, None)
    The password of the PowerFlex host.


  validate_certs (optional, bool, True)
    Boolean variable to specify whether or not to validate SSL certificate.

    ``true`` - Indicates that the SSL certificate should be verified.

    ``false`` - Indicates that the SSL certificate should not be verified.


  port (optional, int, 443)
    Port number through which communication happens with PowerFlex host.


  timeout (False, int, 120)
    Time after which connection will get terminated.

    It is to be mentioned in seconds.





Notes
-----

.. note::
   - The *check_mode* is not supported.
   - The modules present in the collection named as 'dellemc.powerflex' are built to support the Dell PowerFlex storage platform.




Examples
--------

.. code-block:: yaml+jinja

    
    - name: Create snapshot
      dellemc.powerflex.snapshot:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        snapshot_name: "ansible_snapshot"
        vol_name: "ansible_volume"
        read_only: false
        desired_retention: 2
        state: "present"

    - name: Get snapshot details using snapshot id
      dellemc.powerflex.snapshot:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        snapshot_id: "fe6cb28200000007"
        state: "present"

    - name: Map snapshot to SDC
      dellemc.powerflex.snapshot:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        snapshot_id: "fe6cb28200000007"
        sdc:
          - sdc_ip: "198.10.xxx.xxx"
          - sdc_id: "663ac0d200000001"
        allow_multiple_mappings: true
        sdc_state: "mapped"
        state: "present"

    - name: Modify the attributes of SDC mapped to snapshot
      dellemc.powerflex.snapshot:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        snapshot_id: "fe6cb28200000007"
        sdc:
          - sdc_ip: "198.10.xxx.xxx"
            iops_limit: 11
            bandwidth_limit: 4096
          - sdc_id: "663ac0d200000001"
            iops_limit: 20
            bandwidth_limit: 2048
        allow_multiple_mappings: true
        sdc_state: "mapped"
        state: "present"

    - name: Extend the size of snapshot
      dellemc.powerflex.snapshot:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        snapshot_id: "fe6cb28200000007"
        size: 16
        state: "present"

    - name: Unmap SDCs from snapshot
      dellemc.powerflex.snapshot:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        snapshot_id: "fe6cb28200000007"
        sdc:
          - sdc_ip: "198.10.xxx.xxx"
          - sdc_id: "663ac0d200000001"
        sdc_state: "unmapped"
        state: "present"

    - name: Rename snapshot
      dellemc.powerflex.snapshot:
        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:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        snapshot_id: "fe6cb28200000007"
        remove_mode: "ONLY_ME"
        state: "absent"



Return Values
-------------

changed (always, bool, false)
  Whether or not the resource has changed.


snapshot_details (When snapshot exists, dict, {'accessModeLimit': 'ReadOnly', 'ancestorVolumeId': 'cdd883cf00000002', 'ancestorVolumeName': 'ansible-volume-1', 'autoSnapshotGroupId': None, 'compressionMethod': 'Invalid', 'consistencyGroupId': '22f1e80c00000001', 'creationTime': 1631619229, 'dataLayout': 'MediumGranularity', '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, '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, 'volumeReplicationState': 'UnmarkedForReplication', 'volumeType': 'Snapshot', 'vtreeId': '6e86255c00000001'})
  Details of the snapshot.


  ancestorVolumeId (, str, )
    The ID of the root of the specified volume's V-Tree.


  ancestorVolumeName (, str, )
    The name of the root of the specified volume's V-Tree.


  creationTime (, int, )
    The creation time of the snapshot.


  id (, str, )
    The ID of the snapshot.


  mappedSdcInfo (, dict, )
    The details of the mapped SDC.


    sdcId (, str, )
      ID of the SDC.


    sdcName (, str, )
      Name of the SDC.


    sdcIp (, str, )
      IP of the SDC.


    accessMode (, str, )
      Mapping access mode for the specified snapshot.


    limitIops (, int, )
      IOPS limit for the SDC.


    limitBwInMbps (, int, )
      Bandwidth limit for the SDC.



  name (, str, )
    Name of the snapshot.


  secureSnapshotExpTime (, int, )
    Expiry time of the snapshot.


  sizeInKb (, int, )
    Size of the snapshot.


  sizeInGb (, int, )
    Size of the snapshot.


  retentionInHours (, int, )
    Retention of the snapshot in hours.


  storagePoolId (, str, )
    The ID of the Storage pool in which snapshot resides.


  storagePoolName (, str, )
    The name of the Storage pool in which snapshot resides.






Status
------





Authors
~~~~~~~

- Akash Shendge (@shenda1) <ansible.team@dell.com>