| 1 | # redfish_storage_volume |
| 2 | |
| 3 | Role to create, modify, initialize, or delete a single storage volume. |
| 4 | |
| 5 | ## Requirements |
| 6 | |
| 7 | ### Development |
| 8 | |
| 9 | Requirements to develop and contribute to the role. |
| 10 | |
| 11 | ``` |
| 12 | ansible |
| 13 | docker |
| 14 | molecule |
| 15 | python |
| 16 | ``` |
| 17 | |
| 18 | ### Production |
| 19 | |
| 20 | Requirements to use the role. |
| 21 | |
| 22 | ``` |
| 23 | ansible |
| 24 | python |
| 25 | ``` |
| 26 | |
| 27 | ### Ansible collections |
| 28 | |
| 29 | Collections required to use the role |
| 30 | |
| 31 | ``` |
| 32 | dellemc.openmanage |
| 33 | ``` |
| 34 | |
| 35 | ## Role Variables |
| 36 | |
| 37 | <table> |
| 38 | <thead> |
| 39 | <tr> |
| 40 | <th>Name</th> |
| 41 | <th>Required</th> |
| 42 | <th>Default Value</th> |
| 43 | <th>Choices</th> |
| 44 | <th>Type</th> |
| 45 | <th>Description</th> |
| 46 | </tr> |
| 47 | </thead> |
| 48 | <tbody> |
| 49 | <tr> |
| 50 | <td>hostname</td> |
| 51 | <td>true</td> |
| 52 | <td></td> |
| 53 | <td></td> |
| 54 | <td>str</td> |
| 55 | <td>- iDRAC IP Address</td> |
| 56 | </tr> |
| 57 | <tr> |
| 58 | <td>username</td> |
| 59 | <td>true</td> |
| 60 | <td></td> |
| 61 | <td></td> |
| 62 | <td>str</td> |
| 63 | <td>- iDRAC username</td> |
| 64 | </tr> |
| 65 | <tr> |
| 66 | <td>password</td> |
| 67 | <td>true</td> |
| 68 | <td></td> |
| 69 | <td></td> |
| 70 | <td>str</td> |
| 71 | <td>- iDRAC user password.</td> |
| 72 | </tr> |
| 73 | <tr> |
| 74 | <td>https_port</td> |
| 75 | <td>false</td> |
| 76 | <td>443</td> |
| 77 | <td></td> |
| 78 | <td>int</td> |
| 79 | <td>- iDRAC port.</td> |
| 80 | </tr> |
| 81 | <tr> |
| 82 | <td>validate_certs</td> |
| 83 | <td>false</td> |
| 84 | <td>true</td> |
| 85 | <td></td> |
| 86 | <td>bool</td> |
| 87 | <td>- If C(false), the SSL certificates will not be validated.<br>- Configure C(false) only on personally controlled sites where self-signed certificates are used.</td> |
| 88 | </tr> |
| 89 | <tr> |
| 90 | <td>ca_path</td> |
| 91 | <td>false</td> |
| 92 | <td></td> |
| 93 | <td></td> |
| 94 | <td>path</td> |
| 95 | <td>- The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.</td> |
| 96 | </tr> |
| 97 | <tr> |
| 98 | <td>https_timeout</td> |
| 99 | <td>false</td> |
| 100 | <td>30</td> |
| 101 | <td></td> |
| 102 | <td>int</td> |
| 103 | <td>- The HTTPS socket level timeout in seconds.</td> |
| 104 | </tr> |
| 105 | <tr> |
| 106 | <td>controller_id</td> |
| 107 | <td>false</td> |
| 108 | <td></td> |
| 109 | <td></td> |
| 110 | <td>str</td> |
| 111 | <td>- Fully Qualified Device Descriptor (FQDD) of the storage controller.For example- RAID.Slot.1-1.</br>This option is mandatory when I(state) is C(present) while creating a volume.</td> |
| 112 | </tr> |
| 113 | <tr> |
| 114 | <td>volume_id</td> |
| 115 | <td>false</td> |
| 116 | <td></td> |
| 117 | <td></td> |
| 118 | <td>str</td> |
| 119 | <td>- FQDD of existing volume.For example- Disk.Virtual.4:RAID.Slot.1-1. </br>- This option is mandatory in the following scenarios, I(state) is C(present), when updating a volume. I(state) is C(absent), when deleting a volume.I(command) is C(initialize), when initializing a volume.</td> |
| 120 | </tr> |
| 121 | <tr> |
| 122 | <td>state</td> |
| 123 | <td>false</td> |
| 124 | <td>present</td> |
| 125 | <td>[present, absent]</td> |
| 126 | <td>str</td> |
| 127 | <td>- C(present) creates a storage volume for the specified I (controller_id), or modifies the storage volume for the specified I (volume_id). "Note: Modification of an existing volume properties depends on drive and controller capabilities". </br> C(absent) deletes the volume for the specified I(volume_id).</td> |
| 128 | </tr> |
| 129 | <tr> |
| 130 | <td>command</td> |
| 131 | <td>false</td> |
| 132 | <td></td> |
| 133 | <td>[initialize]</td> |
| 134 | <td>str</td> |
| 135 | <td>- C(initialize) initializes an existing storage volume for a specified I(volume_id).</td> |
| 136 | </tr> |
| 137 | <tr> |
| 138 | <td>raid_type</td> |
| 139 | <td>false</td> |
| 140 | <td></td> |
| 141 | <td></td> |
| 142 | <td>str</td> |
| 143 | <td>- One of the following raid types must be selected to create a volume.</br> |
| 144 | - C(RAID0) to create a RAID0 type volume.</br> |
| 145 | - C(RAID1) to create a RAID1 type volume.</br> |
| 146 | - C(RAID5) to create a RAID5 type volume.</br> |
| 147 | - C(RAID6) to create a RAID6 type volume.</br> |
| 148 | - C(RAID10) to create a RAID10 type volume.</br> |
| 149 | - C(RAID50) to create a RAID50 type volume.</br> |
| 150 | - C(RAID60) to create a RAID60 type volume.</td> |
| 151 | </tr> |
| 152 | <tr> |
| 153 | <td>name</td> |
| 154 | <td>false</td> |
| 155 | <td></td> |
| 156 | <td></td> |
| 157 | <td>str</td> |
| 158 | <td>- Name of the volume to be created.</br> |
| 159 | - Only applicable when I(state) is C(present).</br> |
| 160 | - This will be deprecated. Please use I(volume_name) for specifying the volume name.</td> |
| 161 | </tr> |
| 162 | <tr> |
| 163 | <td>volume_name</td> |
| 164 | <td>false</td> |
| 165 | <td></td> |
| 166 | <td></td> |
| 167 | <td>str</td> |
| 168 | <td>- Name of the volume to be created.</br> |
| 169 | - Only applicable when I(state) is C(present).</td> |
| 170 | </tr> |
| 171 | <tr> |
| 172 | <td>drives</td> |
| 173 | <td>false</td> |
| 174 | <td></td> |
| 175 | <td></td> |
| 176 | <td>list</td> |
| 177 | <td>- FQDD of the Physical disks. For example- Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1. </br>- Only applicable when I(state) is C(present) when creating a new volume.</td> |
| 178 | </tr> |
| 179 | <tr> |
| 180 | <td>block_size_bytes</td> |
| 181 | <td>false</td> |
| 182 | <td></td> |
| 183 | <td></td> |
| 184 | <td>int</td> |
| 185 | <td>- Block size in bytes.Only applicable when I(state) is C(present).</td> |
| 186 | </tr> |
| 187 | </tr> |
| 188 | <tr> |
| 189 | <td>capacity_bytes</td> |
| 190 | <td>false</td> |
| 191 | <td></td> |
| 192 | <td></td> |
| 193 | <td>str</td> |
| 194 | <td>- Volume size in bytes.</br>- Only applicable when I(state) is C(present).</td> |
| 195 | </tr> |
| 196 | <tr> |
| 197 | <td>optimum_io_size_bytes</td> |
| 198 | <td>false</td> |
| 199 | <td></td> |
| 200 | <td></td> |
| 201 | <td>str</td> |
| 202 | <td>- Stripe size value must be in multiples of 64 * 1024.</br>- Only applicable when I(state) is C(present).</td> |
| 203 | </tr> |
| 204 | <tr> |
| 205 | <td>encryption_types</td> |
| 206 | <td>false</td> |
| 207 | <td></td> |
| 208 | <td>[NativeDriveEncryption, ControllerAssisted, SoftwareAssisted]</td> |
| 209 | <td>str</td> |
| 210 | <td>- The following encryption types can be selected.</br> |
| 211 | C(ControllerAssisted) The volume is encrypted by the storage controller entity.</br> |
| 212 | C(NativeDriveEncryption) The volume utilizes the native drive encryption capabilities of the drive hardware.</br> |
| 213 | C(SoftwareAssisted) The volume is encrypted by the software running on the system or the operating system.</br> |
| 214 | Only applicable when I(state) is C(present).</td> |
| 215 | </tr> |
| 216 | <tr> |
| 217 | <td>encrypted</td> |
| 218 | <td>false</td> |
| 219 | <td></td> |
| 220 | <td></td> |
| 221 | <td>bool</td> |
| 222 | <td>- Indicates whether volume is currently utilizing encryption or not.</br>- Only applicable when I(state) is C(present).</td> |
| 223 | </tr> |
| 224 | <tr> |
| 225 | <td>oem</td> |
| 226 | <td>false</td> |
| 227 | <td></td> |
| 228 | <td></td> |
| 229 | <td>dict</td> |
| 230 | <td>- Includes OEM extended payloads.</br>- Only applicable when I(state) is I(present).</td> |
| 231 | </tr> |
| 232 | <tr> |
| 233 | <td>initialize_type</td> |
| 234 | <td>false</td> |
| 235 | <td>Fast</td> |
| 236 | <td>[Fast, Slow]</td> |
| 237 | <td>str</td> |
| 238 | <td>- Initialization type of existing volume.</br> Only applicable when I(command) is C(initialize).</td> |
| 239 | </tr> |
| 240 | <tr> |
| 241 | <td>job_wait</td> |
| 242 | <td>false</td> |
| 243 | <td>true</td> |
| 244 | <td></td> |
| 245 | <td>bool</td> |
| 246 | <td>- Determines whether to wait for the job completion or not.</td> |
| 247 | </tr> |
| 248 | <tr> |
| 249 | <td>job_wait_timeout</td> |
| 250 | <td>false</td> |
| 251 | <td></td> |
| 252 | <td>300</td> |
| 253 | <td>int</td> |
| 254 | <td>- The maximum wait time of I(job_wait) in seconds. The job is tracked only for this duration.</br>- This option is applicable when I(job_wait) is C(True).</td> |
| 255 | </tr> |
| 256 | <tr> |
| 257 | <td>apply_time</td> |
| 258 | <td>false</td> |
| 259 | <td></td> |
| 260 | <td>[Immediate, OnReset]</td> |
| 261 | <td>str</td> |
| 262 | <td>- Apply time of the Volume configuration.</br> |
| 263 | - C(Immediate) allows you to apply the volume configuration on the host server immediately and apply the changes. This is applicable for I(job_wait).</br> |
| 264 | - C(OnReset) allows you to apply the changes on the next reboot of the host server.</br> |
| 265 | - I(apply_time) has a default value based on the different types of the controller.</br> |
| 266 | - For example, BOSS-S1 and BOSS-N1 controllers have a default value of I(apply_time) as C(OnReset).</br> |
| 267 | - PERC controllers have a default value of I(apply_time) as C(Immediate).</td> |
| 268 | </tr> |
| 269 | <tr> |
| 270 | <td>reboot_server</td> |
| 271 | <td></td> |
| 272 | <td>false</td> |
| 273 | <td></td> |
| 274 | <td>bool</td> |
| 275 | <td>- Reboot the server to apply the changes.</br> |
| 276 | - I(reboot_server) is applicable only when I(apply_timeout) is C(OnReset) or when the default value for the apply time of the controller is C(OnReset).</td> |
| 277 | </tr> |
| 278 | <tr> |
| 279 | <td>force_reboot</td> |
| 280 | <td></td> |
| 281 | <td>false</td> |
| 282 | <td></td> |
| 283 | <td>bool</td> |
| 284 | <td>- Reboot the server forcefully to apply the changes when the normal reboot fails.</br> |
| 285 | - I(force_reboot) is applicable only when I(reboot_server) is C(true).</td> |
| 286 | </tr> |
| 287 | </tbody> |
| 288 | </table> |
| 289 | |
| 290 | ## Fact variables |
| 291 | |
| 292 | <table> |
| 293 | <thead> |
| 294 | <tr> |
| 295 | <th>Name</th> |
| 296 | <th>Sample</th> |
| 297 | <th>Description</th> |
| 298 | </tr> |
| 299 | </thead> |
| 300 | <tbody> |
| 301 | <tr> |
| 302 | <td>redfish_storage_volume_out</td> |
| 303 | <td>{"changed": true, |
| 304 | "failed": false, |
| 305 | "msg": "Successfully submitted create volume task." |
| 306 | }</td> |
| 307 | <td>Module output of the redfish storage volume</td> |
| 308 | </tbody> |
| 309 | </table> |
| 310 | |
| 311 | ## Examples |
| 312 | |
| 313 | --- |
| 314 | |
| 315 | ```yml |
| 316 | - name: Create a volume with supported options |
| 317 | ansible.builtin.include_role: |
| 318 | name: redfish_storage_volume |
| 319 | vars: |
| 320 | hostname: "192.168.0.1" |
| 321 | username: "username" |
| 322 | password: "password" |
| 323 | state: "present" |
| 324 | raid_type: "RAID1" |
| 325 | volume_name: "VD0" |
| 326 | controller_id: "RAID.Slot.1-1" |
| 327 | drives: |
| 328 | - Disk.Bay.5:Enclosure.Internal.0-1:RAID.Slot.1-1 |
| 329 | - Disk.Bay.6:Enclosure.Internal.0-1:RAID.Slot.1-1 |
| 330 | block_size_bytes: 512 |
| 331 | capacity_bytes: 299439751168 |
| 332 | optimum_io_size_bytes: 65536 |
| 333 | encryption_types: NativeDriveEncryption |
| 334 | encrypted: true |
| 335 | ``` |
| 336 | |
| 337 | ```yml |
| 338 | - name: Create a volume with apply time |
| 339 | ansible.builtin.include_role: |
| 340 | name: redfish_storage_volume |
| 341 | vars: |
| 342 | hostname: "192.168.0.1" |
| 343 | username: "username" |
| 344 | password: "password" |
| 345 | state: "present" |
| 346 | raid_type: "RAID6" |
| 347 | volume_name: "Raid6_VD" |
| 348 | controller_id: "RAID.Slot.1-1" |
| 349 | drives: |
| 350 | - Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1 |
| 351 | - Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.1-1 |
| 352 | - Disk.Bay.5:Enclosure.Internal.0-1:RAID.Slot.1-1 |
| 353 | - Disk.Bay.6:Enclosure.Internal.0-1:RAID.Slot.1-1 |
| 354 | apply_time: OnReset |
| 355 | reboot_server: true |
| 356 | force_reboot: true |
| 357 | ``` |
| 358 | |
| 359 | ```yml |
| 360 | - name: Create a volume with minimum options |
| 361 | ansible.builtin.include_role: |
| 362 | name: redfish_storage_volume |
| 363 | vars: |
| 364 | hostname: "192.168.0.1" |
| 365 | username: "username" |
| 366 | password: "password" |
| 367 | state: "present" |
| 368 | controller_id: "RAID.Slot.1-1" |
| 369 | raid_type: "RAID0" |
| 370 | drives: |
| 371 | - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1 |
| 372 | ``` |
| 373 | |
| 374 | ```yml |
| 375 | - name: Modify a volume's encryption type settings |
| 376 | ansible.builtin.include_role: |
| 377 | name: redfish_storage_volume |
| 378 | vars: |
| 379 | hostname: "192.168.0.1" |
| 380 | username: "username" |
| 381 | password: "password" |
| 382 | state: "present" |
| 383 | volume_id: "Disk.Virtual.5:RAID.Slot.1-1" |
| 384 | encryption_types: "ControllerAssisted" |
| 385 | encrypted: true |
| 386 | ``` |
| 387 | |
| 388 | ```yml |
| 389 | - name: Delete an existing volume |
| 390 | ansible.builtin.include_role: |
| 391 | name: redfish_storage_volume |
| 392 | vars: |
| 393 | hostname: "192.168.0.1" |
| 394 | username: "username" |
| 395 | password: "password" |
| 396 | state: "absent" |
| 397 | volume_id: "Disk.Virtual.5:RAID.Slot.1-1" |
| 398 | ``` |
| 399 | |
| 400 | ```yml |
| 401 | - name: Initialize an existing volume |
| 402 | ansible.builtin.include_role: |
| 403 | name: redfish_storage_volume |
| 404 | vars: |
| 405 | hostname: "192.168.0.1" |
| 406 | username: "username" |
| 407 | password: "password" |
| 408 | command: "initialize" |
| 409 | volume_id: "Disk.Virtual.6:RAID.Slot.1-1" |
| 410 | initialize_type: "Slow" |
| 411 | ``` |
| 412 | ## Author Information |
| 413 | |
| 414 | --- |
| 415 | |
| 416 | Dell Technologies <br> |
| 417 | Kritika Bhateja ([email protected]) 2023 |