| 1 |
.. _device_v2_module: |
| 2 |
|
| 3 |
|
| 4 |
device_v2 -- Manage Device on Dell PowerFlex |
| 5 |
============================================ |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
Managing device on PowerFlex storage system includes adding new device, getting details of device, modifying attributes of device, and removing device. |
| 16 |
|
| 17 |
Support only for Powerflex 5.0 versions and above. |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
Requirements |
| 22 |
------------ |
| 23 |
The below requirements are needed on the host that executes this module. |
| 24 |
|
| 25 |
- A Dell PowerFlex storage system version 5.0 or later. |
| 26 |
- PyPowerFlex 2.0.0 |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
Parameters |
| 31 |
---------- |
| 32 |
|
| 33 |
current_pathname (optional, str, None) |
| 34 |
Full path of the device to be added. |
| 35 |
|
| 36 |
Required while adding a device. |
| 37 |
|
| 38 |
|
| 39 |
device_name (optional, str, None) |
| 40 |
Device name. |
| 41 |
|
| 42 |
Mutually exclusive with :emphasis:`device\_id`. |
| 43 |
|
| 44 |
|
| 45 |
device_id (optional, str, None) |
| 46 |
Device ID. |
| 47 |
|
| 48 |
Mutually exclusive with :emphasis:`device\_name`. |
| 49 |
|
| 50 |
|
| 51 |
device_group_name (optional, str, None) |
| 52 |
The name of the device group. |
| 53 |
|
| 54 |
Required while adding a device. |
| 55 |
|
| 56 |
Mutually exclusive with :emphasis:`device\_group\_id`. |
| 57 |
|
| 58 |
|
| 59 |
device_group_id (optional, str, None) |
| 60 |
The ID of the device group. |
| 61 |
|
| 62 |
Required while adding a device. |
| 63 |
|
| 64 |
Mutually exclusive with :emphasis:`device\_group\_name`. |
| 65 |
|
| 66 |
|
| 67 |
storage_node_name (optional, str, None) |
| 68 |
The name of the storage node. |
| 69 |
|
| 70 |
Required while adding a device. |
| 71 |
|
| 72 |
Mutually exclusive with :emphasis:`storage\_node\_id`. |
| 73 |
|
| 74 |
|
| 75 |
storage_node_id (optional, str, None) |
| 76 |
The ID of the storage node. |
| 77 |
|
| 78 |
Required while adding a device. |
| 79 |
|
| 80 |
Mutually exclusive with :emphasis:`storage\_node\_name`. |
| 81 |
|
| 82 |
|
| 83 |
new_device_name (optional, str, None) |
| 84 |
New name of the device. |
| 85 |
|
| 86 |
|
| 87 |
capacity_limit_gb (optional, int, None) |
| 88 |
Device capacity limit in GB. |
| 89 |
|
| 90 |
|
| 91 |
media_type (optional, str, None) |
| 92 |
Device media types. |
| 93 |
|
| 94 |
Required while adding a device. |
| 95 |
|
| 96 |
|
| 97 |
clear_error (optional, bool, None) |
| 98 |
Using the flag to clear error on a device. |
| 99 |
|
| 100 |
If the error continues to exist, the device will return to an error state as soon as it is accessed. |
| 101 |
|
| 102 |
|
| 103 |
state (optional, str, present) |
| 104 |
State of the device. |
| 105 |
|
| 106 |
|
| 107 |
force (optional, bool, None) |
| 108 |
Using the Force flag to add a device. |
| 109 |
|
| 110 |
Using the flag to clear device error state without checking. |
| 111 |
|
| 112 |
Use this flag with caution, because all data on the device will be destroyed. |
| 113 |
|
| 114 |
|
| 115 |
hostname (True, str, None) |
| 116 |
IP or FQDN of the PowerFlex host. |
| 117 |
|
| 118 |
|
| 119 |
username (True, str, None) |
| 120 |
The username of the PowerFlex host. |
| 121 |
|
| 122 |
|
| 123 |
password (True, str, None) |
| 124 |
The password of the PowerFlex host. |
| 125 |
|
| 126 |
|
| 127 |
validate_certs (optional, bool, True) |
| 128 |
Boolean variable to specify whether or not to validate SSL certificate. |
| 129 |
|
| 130 |
:literal:`true` - Indicates that the SSL certificate should be verified. |
| 131 |
|
| 132 |
:literal:`false` - Indicates that the SSL certificate should not be verified. |
| 133 |
|
| 134 |
|
| 135 |
port (optional, int, 443) |
| 136 |
Port number through which communication happens with PowerFlex host. |
| 137 |
|
| 138 |
|
| 139 |
timeout (False, int, 120) |
| 140 |
Time after which connection will get terminated. |
| 141 |
|
| 142 |
It is to be mentioned in seconds. |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
Notes |
| 149 |
----- |
| 150 |
|
| 151 |
.. note:: |
| 152 |
- The modules present in the collection named as 'dellemc.powerflex' are built to support the Dell PowerFlex storage platform. |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
Examples |
| 158 |
-------- |
| 159 |
|
| 160 |
.. code-block:: yaml+jinja |
| 161 |
|
| 162 |
|
| 163 |
- name: Create device |
| 164 |
register: device1_result |
| 165 |
dellemc.powerflex.device_v2: |
| 166 |
hostname: "{{ hostname }}" |
| 167 |
username: "{{ username }}" |
| 168 |
password: "{{ password }}" |
| 169 |
validate_certs: "{{ validate_certs }}" |
| 170 |
current_pathname: "/dev/sdc" |
| 171 |
device_group_name: "DG1" |
| 172 |
media_type: "SSD" |
| 173 |
storage_node_name: "Node1" |
| 174 |
|
| 175 |
- name: Create device using name with force flag |
| 176 |
register: device2_result |
| 177 |
dellemc.powerflex.device_v2: |
| 178 |
hostname: "{{ hostname }}" |
| 179 |
username: "{{ username }}" |
| 180 |
password: "{{ password }}" |
| 181 |
validate_certs: "{{ validate_certs }}" |
| 182 |
current_pathname: "/dev/sdd" |
| 183 |
device_group_id: "39a898be00000000" |
| 184 |
storage_node_id: "03b589bf00000003" |
| 185 |
media_type: "SSD" |
| 186 |
device_name: "node1-d2" |
| 187 |
force: true |
| 188 |
state: "present" |
| 189 |
|
| 190 |
- name: Get device details using device_id |
| 191 |
dellemc.powerflex.device_v2: |
| 192 |
hostname: "{{ hostname }}" |
| 193 |
username: "{{ username }}" |
| 194 |
password: "{{ password }}" |
| 195 |
validate_certs: "{{ validate_certs }}" |
| 196 |
device_id: "{{ device1_result.device_details.id }}" |
| 197 |
state: "present" |
| 198 |
|
| 199 |
- name: Get device details using (current_pathname, storage_node_name) |
| 200 |
dellemc.powerflex.device_v2: |
| 201 |
hostname: "{{ hostname }}" |
| 202 |
username: "{{ username }}" |
| 203 |
password: "{{ password }}" |
| 204 |
validate_certs: "{{ validate_certs }}" |
| 205 |
current_pathname: "/dev/sdd" |
| 206 |
storage_node_name: "Node1" |
| 207 |
state: "present" |
| 208 |
|
| 209 |
- name: Get device details using (current_pathname, storage_node_id) |
| 210 |
dellemc.powerflex.device_v2: |
| 211 |
hostname: "{{ hostname }}" |
| 212 |
username: "{{ username }}" |
| 213 |
password: "{{ password }}" |
| 214 |
validate_certs: "{{ validate_certs }}" |
| 215 |
current_pathname: "/dev/sdd" |
| 216 |
storage_node_id: "03b589bf00000003" |
| 217 |
state: "present" |
| 218 |
|
| 219 |
- name: Rename device |
| 220 |
dellemc.powerflex.device_v2: |
| 221 |
hostname: "{{ hostname }}" |
| 222 |
username: "{{ username }}" |
| 223 |
password: "{{ password }}" |
| 224 |
validate_certs: "{{ validate_certs }}" |
| 225 |
device_id: "{{ device1_result.device_details.id }}" |
| 226 |
new_device_name: "node1-d3" |
| 227 |
state: "present" |
| 228 |
|
| 229 |
- name: Clear device error |
| 230 |
dellemc.powerflex.device_v2: |
| 231 |
hostname: "{{ hostname }}" |
| 232 |
username: "{{ username }}" |
| 233 |
password: "{{ password }}" |
| 234 |
validate_certs: "{{ validate_certs }}" |
| 235 |
device_id: "{{ device1_result.device_details.id }}" |
| 236 |
clear_error: true |
| 237 |
force: true |
| 238 |
state: "present" |
| 239 |
|
| 240 |
- name: Clear device error with force flag |
| 241 |
dellemc.powerflex.device_v2: |
| 242 |
hostname: "{{ hostname }}" |
| 243 |
username: "{{ username }}" |
| 244 |
password: "{{ password }}" |
| 245 |
validate_certs: "{{ validate_certs }}" |
| 246 |
device_name: "{{ device2_result.device_details.name }}" |
| 247 |
clear_error: true |
| 248 |
force: true |
| 249 |
state: "present" |
| 250 |
|
| 251 |
- name: Modify device capacity limit |
| 252 |
dellemc.powerflex.device_v2: |
| 253 |
hostname: "{{ hostname }}" |
| 254 |
username: "{{ username }}" |
| 255 |
password: "{{ password }}" |
| 256 |
validate_certs: "{{ validate_certs }}" |
| 257 |
device_name: "{{ device2_result.device_details.name }}" |
| 258 |
capacity_limit_gb: 500 |
| 259 |
state: "present" |
| 260 |
|
| 261 |
- name: Remove device using device_id |
| 262 |
dellemc.powerflex.device_v2: |
| 263 |
hostname: "{{ hostname }}" |
| 264 |
username: "{{ username }}" |
| 265 |
password: "{{ password }}" |
| 266 |
validate_certs: "{{ validate_certs }}" |
| 267 |
device_id: "{{ device1_result.device_details.id }}" |
| 268 |
state: "absent" |
| 269 |
|
| 270 |
- name: Remove device using (current_pathname, storage_node_name) |
| 271 |
dellemc.powerflex.device_v2: |
| 272 |
hostname: "{{ hostname }}" |
| 273 |
username: "{{ username }}" |
| 274 |
password: "{{ password }}" |
| 275 |
validate_certs: "{{ validate_certs }}" |
| 276 |
current_pathname: "/dev/sdd" |
| 277 |
storage_node_name: "Node1" |
| 278 |
state: "absent" |
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
Return Values |
| 283 |
------------- |
| 284 |
|
| 285 |
changed (always, bool, false) |
| 286 |
Whether or not the resource has changed. |
| 287 |
|
| 288 |
|
| 289 |
device_details (When device exists, dict, {'fglNvdimmWriteCacheSize': None, 'deviceCurrentPathName': '/dev/sdd', 'rfcacheErrorDeviceDoesNotExist': False, 'logicalSectorSizeInBytes': 0, 'deviceOriginalPathName': '/dev/sdd', 'fglNvdimmMetadataAmortizationX100': None, 'capacity': 0, 'name': None, 'serialNumber': None, 'mediaType': 'SSD', 'accelerationPoolId': None, 'rfcacheProps': None, 'sdsId': None, 'storagePoolId': None, 'capacityLimitInKb': 1073479680, 'errorState': 'None', 'storageNodeId': '03b589bf00000003', 'externalAccelerationType': 'None', 'accelerationProps': None, 'ssdEndOfLifeState': 'NeverFailed', 'temperatureState': 'NeverFailed', 'aggregatedState': 'NeverFailed', 'spSdsId': None, 'deviceState': 'Normal', 'storageProps': None, 'autoDetectMediaType': None, 'longSuccessfulIos': {'shortWindow': None, 'mediumWindow': None, 'longWindow': None}, 'maxCapacityInKb': 1073479680, 'ledSetting': 'Off', 'modelName': None, 'deviceType': 'Unknown', 'vendorName': None, 'raidControllerSerialNumber': None, 'firmwareVersion': None, 'cacheLookAheadActive': False, 'writeCacheActive': False, 'ataSecurityActive': False, 'physicalSectorSizeInBytes': 0, 'mediaFailing': False, 'slotNumber': 'N/A', 'persistentChecksumState': 'StateInvalid', 'capacityInMb': 1048576, 'usableCapacityInMb': 1048320, 'deviceGroupId': '39a898be00000000', 'id': 'e7ffaabf00030002', 'links': [{'rel': 'self', 'href': '/api/instances/Device::e7ffaabf00030002'}, {'rel': '/dtapi/rest/v1/metrics/query', 'href': '/dtapi/rest/v1/metrics/query', 'body': {'resource_type': 'device', 'ids': ['e7ffaabf00030002']}}, {'rel': '/api/parent/relationship/deviceGroupId', 'href': '/api/instances/DeviceGroup::39a898be00000000'}, {'rel': '/api/parent/relationship/storageNodeId', 'href': '/api/instances/StorageNode::03b589bf00000003'}]}) |
| 290 |
Details of the device. |
| 291 |
|
| 292 |
|
| 293 |
id (, str, ) |
| 294 |
Device ID. |
| 295 |
|
| 296 |
|
| 297 |
name (, str, ) |
| 298 |
Device name. |
| 299 |
|
| 300 |
|
| 301 |
deviceCurrentPathname (, str, ) |
| 302 |
Device current path name. |
| 303 |
|
| 304 |
|
| 305 |
deviceOriginalPathname (, str, ) |
| 306 |
Device original path name. |
| 307 |
|
| 308 |
|
| 309 |
deviceState (, str, ) |
| 310 |
Indicates device state. |
| 311 |
|
| 312 |
|
| 313 |
errorState (, str, ) |
| 314 |
Indicates error state. |
| 315 |
|
| 316 |
|
| 317 |
capacityLimitInKb (, int, ) |
| 318 |
Device capacity limit in KB. |
| 319 |
|
| 320 |
|
| 321 |
maxCapacityInKb (, int, ) |
| 322 |
Maximum device capacity in KB. |
| 323 |
|
| 324 |
|
| 325 |
deviceGroupId (, str, ) |
| 326 |
Device group ID. |
| 327 |
|
| 328 |
|
| 329 |
longSuccessfulIos (, dict, ) |
| 330 |
Indicates long successful I/O operations. |
| 331 |
|
| 332 |
|
| 333 |
storageNodeId (, str, ) |
| 334 |
Storage node ID. |
| 335 |
|
| 336 |
|
| 337 |
updateConfiguration (, bool, ) |
| 338 |
Indicates whether configuration update is enabled. |
| 339 |
|
| 340 |
|
| 341 |
ledSetting (, str, ) |
| 342 |
LED setting state. |
| 343 |
|
| 344 |
|
| 345 |
aggregatedState (, str, ) |
| 346 |
Indicates aggregated device state. |
| 347 |
|
| 348 |
|
| 349 |
temperatureState (, str, ) |
| 350 |
Indicates temperature state. |
| 351 |
|
| 352 |
|
| 353 |
ssdEndOfLifeState (, str, ) |
| 354 |
Indicates SSD end of life state. |
| 355 |
|
| 356 |
|
| 357 |
modelName (, str, ) |
| 358 |
Device model name. |
| 359 |
|
| 360 |
|
| 361 |
serialNumber (, str, ) |
| 362 |
Device serial number. |
| 363 |
|
| 364 |
|
| 365 |
deviceType (, str, ) |
| 366 |
Indicates device type. |
| 367 |
|
| 368 |
|
| 369 |
mediaType (, str, ) |
| 370 |
Indicates media type. |
| 371 |
|
| 372 |
|
| 373 |
vendorName (, str, ) |
| 374 |
Device vendor name. |
| 375 |
|
| 376 |
|
| 377 |
raidControllerSerialNumber (, str, ) |
| 378 |
RAID controller serial number. |
| 379 |
|
| 380 |
|
| 381 |
firmwareVersion (, str, ) |
| 382 |
Device firmware version. |
| 383 |
|
| 384 |
|
| 385 |
cacheLookAheadActive (, bool, ) |
| 386 |
Indicates cache look-ahead active state. |
| 387 |
|
| 388 |
|
| 389 |
writeCacheActive (, bool, ) |
| 390 |
Indicates write cache active state. |
| 391 |
|
| 392 |
|
| 393 |
ataSecurityActive (, bool, ) |
| 394 |
Indicates ATA security active state. |
| 395 |
|
| 396 |
|
| 397 |
capacity (, int, ) |
| 398 |
Device capacity in bytes. |
| 399 |
|
| 400 |
|
| 401 |
logicalSectorSizeInBytes (, int, ) |
| 402 |
Logical sector size in bytes. |
| 403 |
|
| 404 |
|
| 405 |
physicalSectorSizeInBytes (, int, ) |
| 406 |
Physical sector size in bytes. |
| 407 |
|
| 408 |
|
| 409 |
mediaFailing (, bool, ) |
| 410 |
Indicates if media is failing. |
| 411 |
|
| 412 |
|
| 413 |
autoDetectMediaType (, str, ) |
| 414 |
Auto-detection result of media type. |
| 415 |
|
| 416 |
|
| 417 |
storageProps (, dict, ) |
| 418 |
Storage device properties. |
| 419 |
|
| 420 |
|
| 421 |
persistentChecksumState (, str, ) |
| 422 |
Indicates persistent checksum state. |
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
Status |
| 430 |
------ |
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
Authors |
| 437 |
~~~~~~~ |
| 438 |
|
| 439 |
- Tao He (@taohe1012) <[email protected]> |
| 440 |
|