| 1 |
.. _tree_quota_module: |
| 2 |
|
| 3 |
|
| 4 |
tree_quota -- Manage quota tree on the Unity storage system |
| 5 |
=========================================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
Managing Quota tree on the Unity storage system includes Create quota tree, Get quota tree, Modify quota tree and Delete quota tree. |
| 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 |
filesystem_name (optional, str, None) |
| 34 |
The name of the filesystem for which quota tree is created. |
| 35 |
|
| 36 |
For creation or modification of a quota tree either *filesystem_name* or *filesystem_id* is required. |
| 37 |
|
| 38 |
|
| 39 |
filesystem_id (optional, str, None) |
| 40 |
The ID of the filesystem for which the quota tree is created. |
| 41 |
|
| 42 |
For creation of a quota tree either *filesystem_id* or *filesystem_name* is required. |
| 43 |
|
| 44 |
|
| 45 |
nas_server_name (optional, str, None) |
| 46 |
The name of the NAS server in which the filesystem is created. |
| 47 |
|
| 48 |
For creation of a quota tree either *nas_server_name* or *nas_server_id* is required. |
| 49 |
|
| 50 |
|
| 51 |
nas_server_id (optional, str, None) |
| 52 |
The ID of the NAS server in which the filesystem is created. |
| 53 |
|
| 54 |
For creation of a quota tree either *filesystem_id* or *filesystem_name* is required. |
| 55 |
|
| 56 |
|
| 57 |
tree_quota_id (optional, str, None) |
| 58 |
The ID of the quota tree. |
| 59 |
|
| 60 |
Either *tree_quota_id* or *path* to quota tree is required to view/modify/delete quota tree. |
| 61 |
|
| 62 |
|
| 63 |
path (optional, str, None) |
| 64 |
The path to the quota tree. |
| 65 |
|
| 66 |
Either *tree_quota_id* or *path* to quota tree is required to create/view/modify/delete a quota tree. |
| 67 |
|
| 68 |
Path must start with a forward slash '/'. |
| 69 |
|
| 70 |
|
| 71 |
hard_limit (optional, int, None) |
| 72 |
Hard limitation for a quota tree on the total space available. If exceeded, users in quota tree cannot write data. |
| 73 |
|
| 74 |
Value ``0`` implies no limit. |
| 75 |
|
| 76 |
One of the values of *soft_limit* and *hard_limit* can be ``0``, however, both cannot be both ``0`` during creation of a quota tree. |
| 77 |
|
| 78 |
|
| 79 |
soft_limit (optional, int, None) |
| 80 |
Soft limitation for a quota tree on the total space available. If exceeded, notification will be sent to users in the quota tree for the grace period mentioned, beyond which users cannot use space. |
| 81 |
|
| 82 |
Value ``0`` implies no limit. |
| 83 |
|
| 84 |
Both *soft_limit* and *hard_limit* cannot be ``0`` during creation of quota tree. |
| 85 |
|
| 86 |
|
| 87 |
cap_unit (optional, str, None) |
| 88 |
Unit of *soft_limit* and *hard_limit* size. |
| 89 |
|
| 90 |
It defaults to ``GB`` if not specified. |
| 91 |
|
| 92 |
|
| 93 |
description (optional, str, None) |
| 94 |
Description of a quota tree. |
| 95 |
|
| 96 |
|
| 97 |
state (True, str, None) |
| 98 |
The state option is used to mention the existence of the filesystem quota tree. |
| 99 |
|
| 100 |
|
| 101 |
unispherehost (True, str, None) |
| 102 |
IP or FQDN of the Unity management server. |
| 103 |
|
| 104 |
|
| 105 |
username (True, str, None) |
| 106 |
The username of the Unity management server. |
| 107 |
|
| 108 |
|
| 109 |
password (True, str, None) |
| 110 |
The password of the Unity management server. |
| 111 |
|
| 112 |
|
| 113 |
validate_certs (optional, bool, True) |
| 114 |
Boolean variable to specify whether or not to validate SSL certificate. |
| 115 |
|
| 116 |
``true`` - Indicates that the SSL certificate should be verified. |
| 117 |
|
| 118 |
``false`` - Indicates that the SSL certificate should not be verified. |
| 119 |
|
| 120 |
|
| 121 |
port (optional, int, 443) |
| 122 |
Port number through which communication happens with Unity management server. |
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
Notes |
| 129 |
----- |
| 130 |
|
| 131 |
.. note:: |
| 132 |
- The *check_mode* is not supported. |
| 133 |
- The modules present in this collection named as 'dellemc.unity' are built to support the Dell Unity storage platform. |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
Examples |
| 139 |
-------- |
| 140 |
|
| 141 |
.. code-block:: yaml+jinja |
| 142 |
|
| 143 |
|
| 144 |
- name: Get quota tree details by quota tree id |
| 145 |
tree_quota: |
| 146 |
unispherehost: "{{unispherehost}}" |
| 147 |
username: "{{username}}" |
| 148 |
password: "{{password}}" |
| 149 |
validate_certs: "{{validate_certs}}" |
| 150 |
tree_quota_id: "treequota_171798700679_10" |
| 151 |
state: "present" |
| 152 |
|
| 153 |
- name: Get quota tree details by quota tree path |
| 154 |
tree_quota: |
| 155 |
unispherehost: "{{unispherehost}}" |
| 156 |
username: "{{username}}" |
| 157 |
password: "{{password}}" |
| 158 |
validate_certs: "{{validate_certs}}" |
| 159 |
filesystem_name: "fs_2171" |
| 160 |
nas_server_id: "nas_21" |
| 161 |
path: "/test" |
| 162 |
state: "present" |
| 163 |
|
| 164 |
- name: Create quota tree for a filesystem with filesystem id |
| 165 |
tree_quota: |
| 166 |
unispherehost: "{{unispherehost}}" |
| 167 |
username: "{{username}}" |
| 168 |
password: "{{password}}" |
| 169 |
validate_certs: "{{validate_certs}}" |
| 170 |
filesystem_id: "fs_2171" |
| 171 |
hard_limit: 6 |
| 172 |
cap_unit: "TB" |
| 173 |
soft_limit: 5 |
| 174 |
path: "/test_new" |
| 175 |
state: "present" |
| 176 |
|
| 177 |
- name: Create quota tree for a filesystem with filesystem name |
| 178 |
tree_quota: |
| 179 |
unispherehost: "{{unispherehost}}" |
| 180 |
username: "{{username}}" |
| 181 |
password: "{{password}}" |
| 182 |
validate_certs: "{{validate_certs}}" |
| 183 |
filesystem_name: "Test_filesystem" |
| 184 |
nas_server_name: "lglad068" |
| 185 |
hard_limit: 6 |
| 186 |
cap_unit: "TB" |
| 187 |
soft_limit: 5 |
| 188 |
path: "/test_new" |
| 189 |
state: "present" |
| 190 |
|
| 191 |
- name: Modify quota tree limit usage by quota tree path |
| 192 |
tree_quota: |
| 193 |
unispherehost: "{{unispherehost}}" |
| 194 |
username: "{{username}}" |
| 195 |
password: "{{password}}" |
| 196 |
validate_certs: "{{validate_certs}}" |
| 197 |
path: "/test_new" |
| 198 |
hard_limit: 10 |
| 199 |
cap_unit: "TB" |
| 200 |
soft_limit: 8 |
| 201 |
state: "present" |
| 202 |
|
| 203 |
- name: Modify quota tree by quota tree id |
| 204 |
tree_quota: |
| 205 |
unispherehost: "{{unispherehost}}" |
| 206 |
username: "{{username}}" |
| 207 |
password: "{{password}}" |
| 208 |
validate_certs: "{{validate_certs}}" |
| 209 |
filesystem_id: "fs_2171" |
| 210 |
tree_quota_id: "treequota_171798700679_10" |
| 211 |
hard_limit: 12 |
| 212 |
cap_unit: "TB" |
| 213 |
soft_limit: 10 |
| 214 |
state: "present" |
| 215 |
|
| 216 |
- name: Delete quota tree by quota tree id |
| 217 |
tree_quota: |
| 218 |
unispherehost: "{{unispherehost}}" |
| 219 |
username: "{{username}}" |
| 220 |
password: "{{password}}" |
| 221 |
validate_certs: "{{validate_certs}}" |
| 222 |
filesystem_id: "fs_2171" |
| 223 |
tree_quota_id: "treequota_171798700679_10" |
| 224 |
state: "absent" |
| 225 |
|
| 226 |
- name: Delete quota tree by path |
| 227 |
tree_quota: |
| 228 |
unispherehost: "{{unispherehost}}" |
| 229 |
username: "{{username}}" |
| 230 |
password: "{{password}}" |
| 231 |
validate_certs: "{{validate_certs}}" |
| 232 |
filesystem_id: "fs_2171" |
| 233 |
path: "/test_new" |
| 234 |
state: "absent" |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
Return Values |
| 239 |
------------- |
| 240 |
|
| 241 |
changed (always, bool, True) |
| 242 |
Whether or not the resource has changed. |
| 243 |
|
| 244 |
|
| 245 |
get_tree_quota_details (When quota tree exists, dict, {'description': '', 'existed': True, 'filesystem': {'UnityFileSystem': {'hash': 8788549469862, 'id': 'fs_137', 'name': 'test', 'nas_server': {'id': 'nas_1', 'name': 'lglad072'}}}, 'gp_left': None, 'hard_limit': '6.0 TB', 'hash': 8788549497558, 'id': 'treequota_171798694897_1', 'path': 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER', 'size_used': 0, 'soft_limit': '5.0 TB', 'state': 0}) |
| 246 |
Details of the quota tree. |
| 247 |
|
| 248 |
|
| 249 |
filesystem (, dict, ) |
| 250 |
Filesystem details for which the quota tree is created. |
| 251 |
|
| 252 |
|
| 253 |
UnityFileSystem (, dict, ) |
| 254 |
Filesystem details for which the quota tree is created. |
| 255 |
|
| 256 |
|
| 257 |
id (, str, ) |
| 258 |
ID of the filesystem for which the quota tree is create. |
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
description (, str, ) |
| 264 |
Description of the quota tree. |
| 265 |
|
| 266 |
|
| 267 |
path (, str, ) |
| 268 |
Path to quota tree. A valid path must start with a forward slash '/'. It is mandatory while creating a quota tree. |
| 269 |
|
| 270 |
|
| 271 |
hard_limit (, int, ) |
| 272 |
Hard limit of quota tree. If the quota tree's space usage exceeds the hard limit, users in quota tree cannot write data. |
| 273 |
|
| 274 |
|
| 275 |
soft_limit (, int, ) |
| 276 |
Soft limit of the quota tree. If the quota tree's space usage exceeds the soft limit, the storage system starts to count down based on the specified grace period. |
| 277 |
|
| 278 |
|
| 279 |
id (, str, ) |
| 280 |
Quota tree ID. |
| 281 |
|
| 282 |
|
| 283 |
size_used (, int, ) |
| 284 |
Size of used space in the filesystem by the user files. |
| 285 |
|
| 286 |
|
| 287 |
gp_left (, int, ) |
| 288 |
The grace period left after the soft limit for the user quota is exceeded. |
| 289 |
|
| 290 |
|
| 291 |
state (, int, ) |
| 292 |
State of the quota tree. |
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
Status |
| 300 |
------ |
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
Authors |
| 307 |
~~~~~~~ |
| 308 |
|
| 309 |
- Spandita Panigrahi (@panigs7) <[email protected]> |
| 310 |
|