| 1 |
.. _volume_module: |
| 2 |
|
| 3 |
|
| 4 |
volume -- Manage volume on Unity storage system |
| 5 |
=============================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
Managing volume on Unity storage system includes- Create new volume, Modify volume attributes, Map Volume to host, Unmap volume to host, Display volume details, Delete volume. |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
Requirements |
| 20 |
------------ |
| 21 |
The below requirements are needed on the host that executes this module. |
| 22 |
|
| 23 |
- A Dell Unity Storage device version 5.1 or later. |
| 24 |
- Ansible-core 2.17 or later. |
| 25 |
- Python 3.11, or 3.12. |
| 26 |
- Storops Python SDK 1.2.12. |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
Parameters |
| 31 |
---------- |
| 32 |
|
| 33 |
vol_name (optional, str, None) |
| 34 |
The name of the volume. Mandatory only for create operation. |
| 35 |
|
| 36 |
|
| 37 |
vol_id (optional, str, None) |
| 38 |
The id of the volume. |
| 39 |
|
| 40 |
It can be used only for get, modify, map/unmap host, or delete operation. |
| 41 |
|
| 42 |
|
| 43 |
pool_name (optional, str, None) |
| 44 |
This is the name of the pool where the volume will be created. |
| 45 |
|
| 46 |
Either the *pool_name* or *pool_id* must be provided to create a new volume. |
| 47 |
|
| 48 |
|
| 49 |
pool_id (optional, str, None) |
| 50 |
This is the id of the pool where the volume will be created. |
| 51 |
|
| 52 |
Either the *pool_name* or *pool_id* must be provided to create a new volume. |
| 53 |
|
| 54 |
|
| 55 |
size (optional, int, None) |
| 56 |
The size of the volume. |
| 57 |
|
| 58 |
|
| 59 |
cap_unit (optional, str, None) |
| 60 |
The unit of the volume size. It defaults to ``GB``, if not specified. |
| 61 |
|
| 62 |
|
| 63 |
description (optional, str, None) |
| 64 |
Description about the volume. |
| 65 |
|
| 66 |
Description can be removed by passing empty string (""). |
| 67 |
|
| 68 |
|
| 69 |
snap_schedule (optional, str, None) |
| 70 |
Snapshot schedule assigned to the volume. |
| 71 |
|
| 72 |
Add/Remove/Modify the snapshot schedule for the volume. |
| 73 |
|
| 74 |
|
| 75 |
compression (optional, bool, None) |
| 76 |
Boolean variable, Specifies whether or not to enable compression. Compression is supported only for thin volumes. |
| 77 |
|
| 78 |
|
| 79 |
advanced_dedup (optional, bool, None) |
| 80 |
Boolean variable, Indicates whether or not to enable advanced deduplication. |
| 81 |
|
| 82 |
Compression should be enabled to enable advanced deduplication. |
| 83 |
|
| 84 |
It can only be enabled on the all flash high end platforms. |
| 85 |
|
| 86 |
Deduplicated data will remain as is even after advanced deduplication is disabled. |
| 87 |
|
| 88 |
|
| 89 |
is_thin (optional, bool, None) |
| 90 |
Boolean variable, Specifies whether or not it is a thin volume. |
| 91 |
|
| 92 |
The value is set as ``true`` by default if not specified. |
| 93 |
|
| 94 |
|
| 95 |
sp (optional, str, None) |
| 96 |
Storage Processor for this volume. |
| 97 |
|
| 98 |
|
| 99 |
io_limit_policy (optional, str, None) |
| 100 |
IO limit policy associated with this volume. Once it is set, it cannot be removed through ansible module but it can be changed. |
| 101 |
|
| 102 |
|
| 103 |
host_name (optional, str, None) |
| 104 |
Name of the host to be mapped/unmapped with this volume. |
| 105 |
|
| 106 |
Either *host_name* or *host_id* can be specified in one task along with *mapping_state*. |
| 107 |
|
| 108 |
|
| 109 |
host_id (optional, str, None) |
| 110 |
ID of the host to be mapped/unmapped with this volume. |
| 111 |
|
| 112 |
Either *host_name* or *host_id* can be specified in one task along with *mapping_state*. |
| 113 |
|
| 114 |
|
| 115 |
hlu (optional, int, None) |
| 116 |
Host Lun Unit to be mapped/unmapped with this volume. |
| 117 |
|
| 118 |
It is an optional parameter, hlu can be specified along with *host_name* or *host_id* and *mapping_state*. |
| 119 |
|
| 120 |
If *hlu* is not specified, unity will choose it automatically. The maximum value supported is ``255``. |
| 121 |
|
| 122 |
|
| 123 |
mapping_state (optional, str, None) |
| 124 |
State of host access for volume. |
| 125 |
|
| 126 |
|
| 127 |
new_vol_name (optional, str, None) |
| 128 |
New name of the volume for rename operation. |
| 129 |
|
| 130 |
|
| 131 |
tiering_policy (optional, str, None) |
| 132 |
Tiering policy choices for how the storage resource data will be distributed among the tiers available in the pool. |
| 133 |
|
| 134 |
|
| 135 |
state (True, str, None) |
| 136 |
State variable to determine whether volume will exist or not. |
| 137 |
|
| 138 |
|
| 139 |
hosts (optional, list, None) |
| 140 |
Name of hosts for mapping to a volume. |
| 141 |
|
| 142 |
|
| 143 |
host_name (optional, str, None) |
| 144 |
Name of the host. |
| 145 |
|
| 146 |
|
| 147 |
host_id (optional, str, None) |
| 148 |
ID of the host. |
| 149 |
|
| 150 |
|
| 151 |
hlu (optional, str, None) |
| 152 |
Host Lun Unit to be mapped/unmapped with this volume. |
| 153 |
|
| 154 |
It is an optional parameter, *hlu* can be specified along with *host_name* or *host_id* and *mapping_state*. |
| 155 |
|
| 156 |
If *hlu* is not specified, unity will choose it automatically. The maximum value supported is ``255``. |
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
unispherehost (True, str, None) |
| 161 |
IP or FQDN of the Unity management server. |
| 162 |
|
| 163 |
|
| 164 |
username (True, str, None) |
| 165 |
The username of the Unity management server. |
| 166 |
|
| 167 |
|
| 168 |
password (True, str, None) |
| 169 |
The password of the Unity management server. |
| 170 |
|
| 171 |
|
| 172 |
validate_certs (optional, bool, True) |
| 173 |
Boolean variable to specify whether or not to validate SSL certificate. |
| 174 |
|
| 175 |
``true`` - Indicates that the SSL certificate should be verified. |
| 176 |
|
| 177 |
``false`` - Indicates that the SSL certificate should not be verified. |
| 178 |
|
| 179 |
|
| 180 |
port (optional, int, 443) |
| 181 |
Port number through which communication happens with Unity management server. |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
Notes |
| 188 |
----- |
| 189 |
|
| 190 |
.. note:: |
| 191 |
- The *check_mode* is not supported. |
| 192 |
- The modules present in this collection named as 'dellemc.unity' are built to support the Dell Unity storage platform. |
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
Examples |
| 198 |
-------- |
| 199 |
|
| 200 |
.. code-block:: yaml+jinja |
| 201 |
|
| 202 |
|
| 203 |
- name: Create Volume |
| 204 |
volume: |
| 205 |
unispherehost: "{{unispherehost}}" |
| 206 |
username: "{{username}}" |
| 207 |
password: "{{password}}" |
| 208 |
validate_certs: "{{validate_certs}}" |
| 209 |
vol_name: "{{vol_name}}" |
| 210 |
description: "{{description}}" |
| 211 |
pool_name: "{{pool}}" |
| 212 |
size: 2 |
| 213 |
cap_unit: "{{cap_GB}}" |
| 214 |
is_thin: True |
| 215 |
compression: True |
| 216 |
advanced_dedup: True |
| 217 |
state: "{{state_present}}" |
| 218 |
|
| 219 |
- name: Expand Volume by volume id |
| 220 |
volume: |
| 221 |
unispherehost: "{{unispherehost}}" |
| 222 |
username: "{{username}}" |
| 223 |
password: "{{password}}" |
| 224 |
validate_certs: "{{validate_certs}}" |
| 225 |
vol_id: "{{vol_id}}" |
| 226 |
size: 5 |
| 227 |
cap_unit: "{{cap_GB}}" |
| 228 |
state: "{{state_present}}" |
| 229 |
|
| 230 |
- name: Modify Volume, map host by host_name |
| 231 |
volume: |
| 232 |
unispherehost: "{{unispherehost}}" |
| 233 |
username: "{{username}}" |
| 234 |
password: "{{password}}" |
| 235 |
validate_certs: "{{validate_certs}}" |
| 236 |
vol_name: "{{vol_name}}" |
| 237 |
host_name: "{{host_name}}" |
| 238 |
hlu: 5 |
| 239 |
mapping_state: "{{state_mapped}}" |
| 240 |
state: "{{state_present}}" |
| 241 |
|
| 242 |
- name: Modify Volume, unmap host mapping by host_name |
| 243 |
volume: |
| 244 |
unispherehost: "{{unispherehost}}" |
| 245 |
username: "{{username}}" |
| 246 |
password: "{{password}}" |
| 247 |
validate_certs: "{{validate_certs}}" |
| 248 |
vol_name: "{{vol_name}}" |
| 249 |
host_name: "{{host_name}}" |
| 250 |
mapping_state: "{{state_unmapped}}" |
| 251 |
state: "{{state_present}}" |
| 252 |
|
| 253 |
- name: Map multiple hosts to a Volume |
| 254 |
volume: |
| 255 |
unispherehost: "{{unispherehost}}" |
| 256 |
username: "{{username}}" |
| 257 |
password: "{{password}}" |
| 258 |
validate_certs: "{{validate_certs}}" |
| 259 |
vol_id: "{{vol_id}}" |
| 260 |
hosts: |
| 261 |
- host_name: "10.226.198.248" |
| 262 |
hlu: 1 |
| 263 |
- host_id: "Host_929" |
| 264 |
hlu: 2 |
| 265 |
mapping_state: "mapped" |
| 266 |
state: "present" |
| 267 |
|
| 268 |
- name: Modify Volume attributes |
| 269 |
volume: |
| 270 |
unispherehost: "{{unispherehost}}" |
| 271 |
username: "{{username}}" |
| 272 |
password: "{{password}}" |
| 273 |
validate_certs: "{{validate_certs}}" |
| 274 |
vol_name: "{{vol_name}}" |
| 275 |
new_vol_name: "{{new_vol_name}}" |
| 276 |
tiering_policy: "AUTOTIER" |
| 277 |
compression: True |
| 278 |
is_thin: True |
| 279 |
advanced_dedup: True |
| 280 |
state: "{{state_present}}" |
| 281 |
|
| 282 |
- name: Delete Volume by vol name |
| 283 |
volume: |
| 284 |
unispherehost: "{{unispherehost}}" |
| 285 |
username: "{{username}}" |
| 286 |
password: "{{password}}" |
| 287 |
validate_certs: "{{validate_certs}}" |
| 288 |
vol_name: "{{vol_name}}" |
| 289 |
state: "{{state_absent}}" |
| 290 |
|
| 291 |
- name: Delete Volume by vol id |
| 292 |
volume: |
| 293 |
unispherehost: "{{unispherehost}}" |
| 294 |
username: "{{username}}" |
| 295 |
password: "{{password}}" |
| 296 |
validate_certs: "{{validate_certs}}" |
| 297 |
vol_id: "{{vol_id}}" |
| 298 |
state: "{{state_absent}}" |
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
Return Values |
| 303 |
------------- |
| 304 |
|
| 305 |
changed (always, bool, True) |
| 306 |
Whether or not the resource has changed. |
| 307 |
|
| 308 |
|
| 309 |
volume_details (When volume exists, dict, {'current_node': 'NodeEnum.SPB', 'data_reduction_percent': 0, 'data_reduction_ratio': 1.0, 'data_reduction_size_saved': 0, 'default_node': 'NodeEnum.SPB', 'description': None, 'effective_io_limit_max_iops': None, 'effective_io_limit_max_kbps': None, 'existed': True, 'family_base_lun': {'UnityLun': {'hash': 8774954523796, 'id': 'sv_27'}}, 'family_clone_count': 0, 'hash': 8774954522426, 'health': {'UnityHealth': {'hash': 8774954528278}}, 'host_access': [{'accessMask': 'PRODUCTION', 'hlu': 0, 'id': 'Host_75', 'name': '10.226.198.250'}], 'id': 'sv_27', 'io_limit_policy': None, 'is_advanced_dedup_enabled': False, 'is_compression_enabled': None, 'is_data_reduction_enabled': False, 'is_replication_destination': False, 'is_snap_schedule_paused': False, 'is_thin_clone': False, 'is_thin_enabled': False, 'metadata_size': 4294967296, 'metadata_size_allocated': 4026531840, 'name': 'VSI-UNITY-test-task', 'per_tier_size_used': [111400714240, 0, 0], 'pool': {'id': 'pool_3', 'name': 'Extreme_Perf_tier'}, 'size_allocated': 107374182400, 'size_total': 107374182400, 'size_total_with_unit': '100.0 GB', 'size_used': None, 'snap_count': 0, 'snap_schedule': None, 'snap_wwn': '60:06:01:60:5C:F0:50:00:94:3E:91:4D:51:5A:4F:97', 'snaps_size': 0, 'snaps_size_allocated': 0, 'storage_resource': {'UnityStorageResource': {'hash': 8774954518887}}, 'tiering_policy': 'TieringPolicyEnum.AUTOTIER_HIGH', 'type': 'LUNTypeEnum.VMWARE_ISCSI', 'wwn': '60:06:01:60:5C:F0:50:00:00:B5:95:61:2E:34:DB:B2'}) |
| 310 |
Details of the volume. |
| 311 |
|
| 312 |
|
| 313 |
id (, str, ) |
| 314 |
The system generated ID given to the volume. |
| 315 |
|
| 316 |
|
| 317 |
name (, str, ) |
| 318 |
Name of the volume. |
| 319 |
|
| 320 |
|
| 321 |
description (, str, ) |
| 322 |
Description about the volume. |
| 323 |
|
| 324 |
|
| 325 |
is_data_reduction_enabled (, bool, ) |
| 326 |
Whether or not compression enabled on this volume. |
| 327 |
|
| 328 |
|
| 329 |
size_total_with_unit (, str, ) |
| 330 |
Size of the volume with actual unit. |
| 331 |
|
| 332 |
|
| 333 |
snap_schedule (, dict, ) |
| 334 |
Snapshot schedule applied to this volume. |
| 335 |
|
| 336 |
|
| 337 |
tiering_policy (, str, ) |
| 338 |
Tiering policy applied to this volume. |
| 339 |
|
| 340 |
|
| 341 |
current_sp (, str, ) |
| 342 |
Current storage processor for this volume. |
| 343 |
|
| 344 |
|
| 345 |
pool (, dict, ) |
| 346 |
The pool in which this volume is allocated. |
| 347 |
|
| 348 |
|
| 349 |
host_access (, list, ) |
| 350 |
Host mapped to this volume. |
| 351 |
|
| 352 |
|
| 353 |
io_limit_policy (, dict, ) |
| 354 |
IO limit policy associated with this volume. |
| 355 |
|
| 356 |
|
| 357 |
wwn (, str, ) |
| 358 |
The world wide name of this volume. |
| 359 |
|
| 360 |
|
| 361 |
is_thin_enabled (, bool, ) |
| 362 |
Indicates whether thin provisioning is enabled for this volume. |
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
Status |
| 370 |
------ |
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
Authors |
| 377 |
~~~~~~~ |
| 378 |
|
| 379 |
- Arindam Datta (@arindam-emc) <[email protected]> |
| 380 |
- Pavan Mudunuri(@Pavan-Mudunuri) <[email protected]> |
| 381 |
|