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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
|
.. _volume_module:
volume -- Manage volumes on Dell PowerFlex
==========================================
.. contents::
:local:
:depth: 1
Synopsis
--------
Managing volumes on PowerFlex storage system includes creating, getting details, modifying attributes and deleting volume.
It also includes adding/removing snapshot policy, mapping/unmapping volume to/from SDC and listing associated snapshots.
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
----------
vol_name (optional, str, None)
The name of the volume.
Mandatory for create operation.
It is unique across the PowerFlex array.
Mutually exclusive with *vol_id*.
vol_id (optional, str, None)
The ID of the volume.
Except create operation, all other operations can be performed using *vol_id*.
Mutually exclusive with *vol_name*.
storage_pool_name (optional, str, None)
The name of the storage pool.
Either name or the id of the storage pool is required for creating a volume.
During creation, if storage pool name is provided then either protection domain name or id must be mentioned along with it.
Mutually exclusive with *storage_pool_id*.
storage_pool_id (optional, str, None)
The ID of the storage pool.
Either name or the id of the storage pool is required for creating a volume.
Mutually exclusive with *storage_pool_name*.
protection_domain_name (optional, str, None)
The name of the protection domain.
During creation of a volume, if more than one storage pool exists with the same name then either protection domain name or id must be mentioned along with it.
Mutually exclusive with *protection_domain_id*.
protection_domain_id (optional, str, None)
The ID of the protection domain.
During creation of a volume, if more than one storage pool exists with the same name then either protection domain name or id must be mentioned along with it.
Mutually exclusive with *protection_domain_name*.
vol_type (optional, str, None)
Type of volume provisioning.
compression_type (optional, str, None)
Type of the compression method.
use_rmcache (optional, bool, None)
Whether to use RM Cache or not.
snapshot_policy_name (optional, str, None)
Name of the snapshot policy.
To remove/detach snapshot policy, empty *snapshot_policy_id*/*snapshot_policy_name* is to be passed along with *auto_snap_remove_type*.
snapshot_policy_id (optional, str, None)
ID of the snapshot policy.
To remove/detach snapshot policy, empty *snapshot_policy_id*/*snapshot_policy_name* is to be passed along with *auto_snap_remove_type*.
auto_snap_remove_type (optional, str, None)
Whether to remove or detach the snapshot policy.
To remove/detach snapshot policy, empty *snapshot_policy_id*/*snapshot_policy_name* is to be passed along with *auto_snap_remove_type*.
If the snapshot policy name/id is passed empty then *auto_snap_remove_type* is defaulted to ``detach``.
size (optional, int, None)
The size of the volume.
Size of the volume will be assigned as higher multiple of 8 GB.
cap_unit (optional, str, None)
The unit of the volume size. It defaults to 'GB'.
vol_new_name (optional, str, None)
New name of the volume. Used to rename the volume.
allow_multiple_mappings (optional, bool, None)
Specifies whether to allow or not allow multiple mappings.
If the volume is mapped to one SDC then for every new mapping *allow_multiple_mappings* has to be passed as true.
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 volume.
bandwidth_limit (optional, int, None)
Limit of volume 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 volume IOPS.
Minimum IOPS limit is 11 and specify 0 for unlimited iops.
sdc_state (optional, str, None)
Mapping state of the SDC.
delete_snapshots (optional, bool, None)
If ``true``, the volume and all its dependent snapshots will be deleted.
If ``false``, only the volume will be deleted.
It can be specified only when the *state* is ``absent``.
It defaults to ``false``, if not specified.
state (True, str, None)
State of the volume.
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 a volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
storage_pool_name: "pool_1"
protection_domain_name: "pd_1"
vol_type: "THICK_PROVISIONED"
compression_type: "NORMAL"
use_rmcache: true
size: 16
state: "present"
- name: Map a SDC to volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
allow_multiple_mappings: true
sdc:
- sdc_id: "92A304DB-EFD7-44DF-A07E-D78134CC9764"
access_mode: "READ_WRITE"
sdc_state: "mapped"
state: "present"
- name: Unmap a SDC to volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
sdc:
- sdc_id: "92A304DB-EFD7-44DF-A07E-D78134CC9764"
sdc_state: "unmapped"
state: "present"
- name: Map multiple SDCs to a volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
protection_domain_name: "pd_1"
sdc:
- sdc_id: "92A304DB-EFD7-44DF-A07E-D78134CC9764"
access_mode: "READ_WRITE"
bandwidth_limit: 2048
iops_limit: 20
- sdc_ip: "198.10.xxx.xxx"
access_mode: "READ_ONLY"
allow_multiple_mappings: true
sdc_state: "mapped"
state: "present"
- name: Get the details of the volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_id: "fe6c8b7100000005"
state: "present"
- name: Modify the details of the Volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
storage_pool_name: "pool_1"
new_vol_name: "new_sample_volume"
size: 64
state: "present"
- name: Delete the Volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
delete_snapshots: false
state: "absent"
- name: Delete the Volume and all its dependent snapshots
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
delete_snapshots: true
state: "absent"
Return Values
-------------
changed (always, bool, false)
Whether or not the resource has changed.
volume_details (When volume exists, dict, {'accessModeLimit': 'ReadWrite', 'ancestorVolumeId': None, 'autoSnapshotGroupId': None, 'compressionMethod': 'Invalid', 'consistencyGroupId': None, 'creationTime': 1631618520, 'dataLayout': 'MediumGranularity', 'id': 'cdd883cf00000002', 'links': [{'href': '/api/instances/Volume::cdd883cf00000002', 'rel': 'self'}, {'href': '/api/instances/Volume::cdd883cf00000002/relationships /Statistics', 'rel': '/api/Volume/relationship/Statistics'}, {'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-volume-1', 'notGenuineSnapshot': False, 'originalExpiryTime': 0, 'pairIds': None, 'protectionDomainId': '9300c1f900000000', 'protectionDomainName': 'domain1', 'replicationJournalVolume': False, 'replicationTimeStamp': 0, 'retentionLevels': [], 'secureSnapshotExpTime': 0, 'sizeInGB': 16, 'sizeInKb': 16777216, 'snapshotPolicyId': None, 'snapshotPolicyName': None, 'snapshotsList': [{'accessModeLimit': 'ReadOnly', 'ancestorVolumeId': 'cdd883cf00000002', '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, 'retentionLevels': [], 'secureSnapshotExpTime': 0, 'sizeInKb': 16777216, 'snplIdOfAutoSnapshot': None, 'snplIdOfSourceVolume': None, 'storagePoolId': 'e0d8f6c900000000', 'timeStampIsAccurate': False, 'useRmcache': False, 'volumeReplicationState': 'UnmarkedForReplication', 'volumeType': 'Snapshot', 'vtreeId': '6e86255c00000001'}], 'statistics': {'childVolumeIds': [], 'descendantVolumeIds': [], 'initiatorSdcId': None, 'mappedSdcIds': ['c42425XXXXXX'], 'numOfChildVolumes': 0, 'numOfDescendantVolumes': 0, 'numOfMappedSdcs': 1, 'registrationKey': None, 'registrationKeys': [], 'replicationJournalVolume': False, 'replicationState': 'UnmarkedForReplication', 'reservationType': 'NotReserved', 'rplTotalJournalCap': 0, 'rplUsedJournalCap': 0, 'userDataReadBwc': {'numOccured': 0, 'numSeconds': 0, 'totalWeightInKb': 0}, 'userDataSdcReadLatency': {'numOccured': 0, 'numSeconds': 0, 'totalWeightInKb': 0}, 'userDataSdcTrimLatency': {'numOccured': 0, 'numSeconds': 0, 'totalWeightInKb': 0}, 'userDataSdcWriteLatency': {'numOccured': 0, 'numSeconds': 0, 'totalWeightInKb': 0}, 'userDataTrimBwc': {'numOccured': 0, 'numSeconds': 0, 'totalWeightInKb': 0}, 'userDataWriteBwc': {'numOccured': 0, 'numSeconds': 0, 'totalWeightInKb': 0}}, 'snplIdOfAutoSnapshot': None, 'snplIdOfSourceVolume': None, 'storagePoolId': 'e0d8f6c900000000', 'storagePoolName': 'pool1', 'timeStampIsAccurate': False, 'useRmcache': False, 'volumeReplicationState': 'UnmarkedForReplication', 'volumeType': 'ThinProvisioned', 'vtreeId': '6e86255c00000001'})
Details of the volume.
id (, str, )
The ID of the volume.
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 volume.
limitIops (, int, )
IOPS limit for the SDC.
limitBwInMbps (, int, )
Bandwidth limit for the SDC.
name (, str, )
Name of the volume.
sizeInKb (, int, )
Size of the volume in Kb.
sizeInGb (, int, )
Size of the volume in Gb.
storagePoolId (, str, )
ID of the storage pool in which volume resides.
storagePoolName (, str, )
Name of the storage pool in which volume resides.
protectionDomainId (, str, )
ID of the protection domain in which volume resides.
protectionDomainName (, str, )
Name of the protection domain in which volume resides.
snapshotPolicyId (, str, )
ID of the snapshot policy associated with volume.
snapshotPolicyName (, str, )
Name of the snapshot policy associated with volume.
snapshotsList (, str, )
List of snapshots associated with the volume.
statistics (, dict, )
Statistics details of the storage pool.
numOfChildVolumes (, int, )
Number of child volumes.
numOfMappedSdcs (, int, )
Number of mapped Sdcs of the volume.
Status
------
Authors
~~~~~~~
- P Srinivas Rao (@srinivas-rao5) <ansible.team@dell.com>
|