summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/unity/docs/modules/filesystem.rst
blob: 81881dfbbd15fe8ec28143ae225915163996790c (plain)
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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
.. _filesystem_module:


filesystem -- Manage filesystem on Unity storage system
=======================================================

.. contents::
   :local:
   :depth: 1


Synopsis
--------

Managing filesystem on Unity storage system includes Create new filesystem, Modify snapschedule attribute of filesystem, Modify filesystem attributes, Display filesystem details, Display filesystem snapshots, Display filesystem snapschedule, Delete snapschedule associated with the filesystem, Delete filesystem, Create new filesystem with quota configuration, Enable, modify and disable replication.



Requirements
------------
The below requirements are needed on the host that executes this module.

- A Dell Unity Storage device version 5.1 or later.
- Ansible-core 2.12 or later.
- Python 3.9, 3.10 or 3.11.
- Storops Python SDK 1.2.11.



Parameters
----------

  filesystem_name (optional, str, None)
    The name of the filesystem. Mandatory only for the create operation. All the operations are supported through *filesystem_name*.

    It is mutually exclusive with *filesystem_id*.


  filesystem_id (optional, str, None)
    The id of the filesystem.

    It can be used only for get, modify, or delete operations.

    It is mutually exclusive with *filesystem_name*.


  pool_name (optional, str, None)
    This is the name of the pool where the filesystem will be created.

    Either the *pool_name* or *pool_id* must be provided to create a new filesystem.


  pool_id (optional, str, None)
    This is the ID of the pool where the filesystem will be created.

    Either the *pool_name* or *pool_id* must be provided to create a new filesystem.


  size (optional, int, None)
    The size of the filesystem.


  cap_unit (optional, str, None)
    The unit of the filesystem size. It defaults to ``GB``, if not specified.


  nas_server_name (optional, str, None)
    Name of the NAS server on which filesystem will be hosted.


  nas_server_id (optional, str, None)
    ID of the NAS server on which filesystem will be hosted.


  supported_protocols (optional, str, None)
    Protocols supported by the file system.

    It will be overridden by NAS server configuration if NAS Server is ``Multiprotocol``.


  description (optional, str, None)
    Description about the filesystem.

    Description can be removed by passing empty string ("").


  smb_properties (optional, dict, None)
    Advance settings for SMB. It contains optional candidate variables.


    is_smb_sync_writes_enabled (optional, bool, None)
      Indicates whether the synchronous writes option is enabled on the file system.


    is_smb_notify_on_access_enabled (optional, bool, None)
      Indicates whether notifications of changes to directory file structure are enabled.


    is_smb_op_locks_enabled (optional, bool, None)
      Indicates whether opportunistic file locking is enabled on the file system.


    is_smb_notify_on_write_enabled (optional, bool, None)
      Indicates whether file write notifications are enabled on the file system.


    smb_notify_on_change_dir_depth (optional, int, None)
      Integer variable, determines the lowest directory level to which the enabled notifications apply.

      Minimum value is ``1``.



  data_reduction (optional, bool, None)
    Boolean variable, specifies whether or not to enable compression. Compression is supported only for thin filesystem.


  is_thin (optional, bool, None)
    Boolean variable, specifies whether or not it is a thin filesystem.


  access_policy (optional, str, None)
    Access policy of a filesystem.


  locking_policy (optional, str, None)
    File system locking policies. These policy choices control whether the NFSv4 range locks must be honored.


  tiering_policy (optional, str, None)
    Tiering policy choices for how the storage resource data will be distributed among the tiers available in the pool.


  quota_config (optional, dict, None)
    Configuration for quota management. It contains optional parameters.


    grace_period (optional, int, None)
      Grace period set in quota configuration after soft limit is reached.

      If *grace_period* is not set during creation of filesystem, it will be set to ``7 days`` by default.


    grace_period_unit (optional, str, None)
      Unit of grace period.

      Default unit is ``days``.


    default_hard_limit (optional, int, None)
      Default hard limit for user quotas and tree quotas.

      If *default_hard_limit* is not set while creation of filesystem, it will be set to ``0B`` by default.


    default_soft_limit (optional, int, None)
      Default soft limit for user quotas and tree quotas.

      If *default_soft_limit* is not set while creation of filesystem, it will be set to ``0B`` by default.


    is_user_quota_enabled (optional, bool, None)
      Indicates whether the user quota is enabled.

      If *is_user_quota_enabled* is not set while creation of filesystem, it will be set to ``false`` by default.

      Parameters *is_user_quota_enabled* and *quota_policy* are mutually exclusive.


    quota_policy (optional, str, None)
      Quota policy set in quota configuration.

      If *quota_policy* is not set while creation of filesystem, it will be set to ``FILE_SIZE`` by default.

      Parameters *is_user_quota_enabled* and *quota_policy* are mutually exclusive.


    cap_unit (optional, str, None)
      Unit of *default_soft_limit* and *default_hard_limit* size.

      Default unit is ``GB``.



  state (True, str, None)
    State variable to determine whether filesystem will exist or not.


  snap_schedule_name (optional, str, None)
    This is the name of an existing snapshot schedule which is to be associated with the filesystem.

    This is mutually exclusive with *snapshot_schedule_id*.


  snap_schedule_id (optional, str, None)
    This is the id of an existing snapshot schedule which is to be associated with the filesystem.

    This is mutually exclusive with *snapshot_schedule_name*.


  replication_params (optional, dict, None)
    Settings required for enabling or modifying replication.


    replication_name (optional, str, None)
      Name of the replication session.


    new_replication_name (optional, str, None)
      Replication name to rename the session to.


    replication_mode (optional, str, None)
      The replication mode.

      This is a mandatory field while creating a replication session.


    rpo (optional, int, None)
      Maximum time to wait before the system syncs the source and destination LUNs.

      The *rpo* option should be specified if the *replication_mode* is ``asynchronous``.

      The value should be in range of ``5`` to ``1440`` for ``asynchronous``, ``0`` for ``synchronous`` and ``-1`` for ``manual``.


    replication_type (optional, str, None)
      Type of replication.


    remote_system (optional, dict, None)
      Details of remote system to which the replication is being configured.

      The *remote_system* option should be specified if the *replication_type* is ``remote``.


      remote_system_host (True, str, None)
        IP or FQDN for remote Unity unisphere Host.


      remote_system_username (True, str, None)
        User name of remote Unity unisphere Host.


      remote_system_password (True, str, None)
        Password of remote Unity unisphere Host.


      remote_system_verifycert (optional, bool, True)
        Boolean variable to specify whether or not to validate SSL certificate of remote Unity unisphere Host.

        ``true`` - Indicates that the SSL certificate should be verified.

        ``false`` - Indicates that the SSL certificate should not be verified.


      remote_system_port (optional, int, 443)
        Port at which remote Unity unisphere is hosted.



    destination_pool_id (optional, str, None)
      ID of pool to allocate destination filesystem.


    destination_pool_name (optional, str, None)
      Name of pool to allocate destination filesystem.



  replication_state (optional, str, None)
    State of the replication.


  unispherehost (True, str, None)
    IP or FQDN of the Unity management server.


  username (True, str, None)
    The username of the Unity management server.


  password (True, str, None)
    The password of the Unity management server.


  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 Unity management server.





Notes
-----

.. note::
   - SMB shares, NFS exports, and snapshots associated with filesystem need to be deleted prior to deleting a filesystem.
   - The *quota_config* parameter can be used to update default hard limit and soft limit values to limit the maximum space that can be used. By default they both are set to 0 during filesystem creation which means unlimited.
   - The *check_mode* is not supported.
   - The modules present in this collection named as 'dellemc.unity' are built to support the Dell Unity storage platform.




Examples
--------

.. code-block:: yaml+jinja

    
    - name: Create FileSystem
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_name: "ansible_test_fs"
        nas_server_name: "lglap761"
        pool_name: "pool_1"
        size: 5
        state: "present"

    - name: Create FileSystem with quota configuration
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_name: "ansible_test_fs"
        nas_server_name: "lglap761"
        pool_name: "pool_1"
        size: 5
        quota_config:
            grace_period: 8
            grace_period_unit: "days"
            default_soft_limit: 10
            is_user_quota_enabled: False
        state: "present"

    - name: Expand FileSystem size
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_name: "ansible_test_fs"
        nas_server_name: "lglap761"
        size: 10
        state: "present"

    - name: Expand FileSystem size
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_name: "ansible_test_fs"
        nas_server_name: "lglap761"
        size: 10
        state: "present"

    - name: Modify FileSystem smb_properties
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_name: "ansible_test_fs"
        nas_server_name: "lglap761"
        smb_properties:
          is_smb_op_locks_enabled: True
          smb_notify_on_change_dir_depth: 5
          is_smb_notify_on_access_enabled: True
        state: "present"

    - name: Modify FileSystem Snap Schedule
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_id: "fs_141"
        snap_schedule_id: "{{snap_schedule_id}}"
        state: "{{state_present}}"

    - name: Get details of FileSystem using id
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_id: "rs_405"
        state: "present"

    - name: Delete a FileSystem using id
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_id: "rs_405"
        state: "absent"

    - name: Enable replication on the fs
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_id: "rs_405"
        replication_params:
          replication_name: "test_repl"
          replication_type: "remote"
          replication_mode: "asynchronous"
          rpo: 60
          remote_system:
            remote_system_host: '0.1.2.3'
            remote_system_verifycert: False
            remote_system_username: 'username'
            remote_system_password: 'password'
          destination_pool_name: "pool_test_1"
        replication_state: "enable"
        state: "present"

    - name: Modify replication on the fs
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_id: "rs_405"
        replication_params:
          replication_name: "test_repl"
          new_replication_name: "test_repl_updated"
          replication_mode: "asynchronous"
          rpo: 50
        replication_state: "enable"
        state: "present"

    - name: Disable replication on the fs
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_id: "rs_405"
        replication_state: "disable"
        state: "present"

    - name: Disable replication by specifying replication_name on the fs
      dellemc.unity.filesystem:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        filesystem_id: "rs_405"
        replication_params:
            replication_name: "test_replication"
        replication_state: "disable"
        state: "present"



Return Values
-------------

changed (always, bool, True)
  Whether or not the resource has changed.


filesystem_details (When filesystem exists, dict, {'access_policy': 'AccessPolicyEnum.UNIX', 'cifs_notify_on_change_dir_depth': 512, 'cifs_share': None, 'data_reduction_percent': 0, 'data_reduction_ratio': 1.0, 'data_reduction_size_saved': 0, 'description': '', 'existed': True, 'folder_rename_policy': 'FSRenamePolicyEnum.SMB_RENAME_FORBIDDEN', 'format': 'FSFormatEnum.UFS64', 'hash': 8735427610152, 'health': {'UnityHealth': {'hash': 8735427614928}}, 'host_io_size': 'HostIOSizeEnum.GENERAL_8K', 'id': 'fs_65916', 'is_advanced_dedup_enabled': False, 'is_cifs_notify_on_access_enabled': False, 'is_cifs_notify_on_write_enabled': False, 'is_cifs_op_locks_enabled': False, 'is_cifs_sync_writes_enabled': False, 'is_data_reduction_enabled': False, 'is_read_only': False, 'is_smbca': False, 'is_thin_enabled': True, 'locking_policy': 'FSLockingPolicyEnum.MANDATORY', 'metadata_size': 11274289152, 'metadata_size_allocated': 4294967296, 'min_size_allocated': 0, 'name': 'test_fs', 'nas_server': {'id': 'nas_18', 'name': 'test_nas1'}, 'nfs_share': None, 'per_tier_size_used': [6979321856, 0, 0], 'pool': {'id': 'pool_7', 'name': 'pool 7'}, 'pool_full_policy': 'ResourcePoolFullPolicyEnum.FAIL_WRITES', 'quota_config': {'default_hard_limit': '0B', 'default_soft_limit': '0B', 'grace_period': '7.0 days', 'id': 'quotaconfig_171798760421_0', 'is_user_quota_enabled': False, 'quota_policy': 'QuotaPolicyEnum.FILE_SIZE'}, 'replication_sessions': {'current_transfer_est_remain_time': 0, 'id': '***', 'last_sync_time': '2022-05-12 11:20:38+00:00', 'local_role': 'ReplicationSessionReplicationRoleEnum.SOURCE', 'max_time_out_of_sync': 60, 'members': None, 'name': 'local_repl_new', 'network_status': 'ReplicationSessionNetworkStatusEnum.OK', 'remote_system': {'UnityRemoteSystem': {'hash': 8735426929707}}, 'replication_resource_type': 'ReplicationEndpointResourceTypeEnum.FILESYSTEM', 'src_resource_id': 'res_66444', 'src_status': 'ReplicationSessionStatusEnum.OK', 'status': 'ReplicationOpStatusEnum.AUTO_SYNC_CONFIGURED', 'sync_progress': 0, 'sync_state': 'ReplicationSessionSyncStateEnum.IDLE'}, 'size_allocated': 283148288, 'size_allocated_total': 4578148352, 'size_preallocated': 2401173504, 'size_total': 10737418240, 'size_total_with_unit': '10.0 GB', 'size_used': 1620312064, 'snap_count': 2, 'snaps_size': 21474869248, 'snaps_size_allocated': 32768, 'snapshots': [], 'supported_protocols': 'FSSupportedProtocolEnum.NFS', 'tiering_policy': 'TieringPolicyEnum.AUTOTIER_HIGH', 'type': 'FilesystemTypeEnum.FILESYSTEM'})
  Details of the filesystem.


  id (, str, )
    The system generated ID given to the filesystem.


  name (, str, )
    Name of the filesystem.


  description (, str, )
    Description about the filesystem.


  is_data_reduction_enabled (, bool, )
    Whether or not compression enabled on this filesystem.


  size_total_with_unit (, str, )
    Size of the filesystem with actual unit.


  tiering_policy (, str, )
    Tiering policy applied to this filesystem.


  is_cifs_notify_on_access_enabled (, bool, )
    Indicates whether the system generates a notification when a user accesses the file system.


  is_cifs_notify_on_write_enabled (, bool, )
    Indicates whether the system generates a notification when the file system is written to.


  is_cifs_op_locks_enabled (, bool, )
    Indicates whether opportunistic file locks are enabled for the file system.


  is_cifs_sync_writes_enabled (, bool, )
    Indicates whether the CIFS synchronous writes option is enabled for the file system.


  cifs_notify_on_change_dir_depth (, int, )
    Indicates the lowest directory level to which the enabled notifications apply, if any.


  pool (, dict, )
    The pool in which this filesystem is allocated.


    id (, str, )
      The system ID given to the pool.


    name (, str, )
      The name of the storage pool.



  nas_server (, dict, )
    The NAS Server details on which this filesystem is hosted.


    id (, str, )
      The system ID given to the NAS Server.


    name (, str, )
      The name of the NAS Server.



  snapshots (, list, )
    The list of snapshots of this filesystem.


    id (, str, )
      The system ID given to the filesystem snapshot.


    name (, str, )
      The name of the filesystem snapshot.



  is_thin_enabled (, bool, )
    Indicates whether thin provisioning is enabled for this filesystem.


  snap_schedule_id (, str, )
    Indicates the id of the snap schedule associated with the filesystem.


  snap_schedule_name (, str, )
    Indicates the name of the snap schedule associated with the filesystem.


  quota_config (, dict, )
    Details of quota configuration of the filesystem created.


    grace_period (, str, )
      Grace period set in quota configuration after soft limit is reached.


    default_hard_limit (, int, )
      Default hard limit for user quotas and tree quotas.


    default_soft_limit (, int, )
      Default soft limit for user quotas and tree quotas.


    is_user_quota_enabled (, bool, )
      Indicates whether the user quota is enabled.


    quota_policy (, str, )
      Quota policy set in quota configuration.



  replication_sessions (, dict, )
    List of replication sessions if replication is enabled.


    id (, str, )
      ID of replication session


    name (, str, )
      Name of replication session


    remote_system (, dict, )
      Remote system


      id (, str, )
        ID of remote system








Status
------





Authors
~~~~~~~

- Arindam Datta (@dattaarindam) <ansible.team@dell.com>
- Meenakshi Dembi (@dembim) <ansible.team@dell.com>
- Spandita Panigrahi (@panigs7) <ansible.team@dell.com>