dellemc.unity.filesystem (2.0.0) — module

Manage filesystem on Unity storage system

| "added in version" 1.1.0 of dellemc.unity"

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

Install collection

Install with ansible-galaxy collection install dellemc.unity:==2.0.0


Add to requirements.yml

  collections:
    - name: dellemc.unity
      version: 2.0.0

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"

Inputs

    
port:
    default: 443
    description:
    - Port number through which communication happens with Unity management server.
    type: int

size:
    description:
    - The size of the filesystem.
    type: int

state:
    choices:
    - absent
    - present
    description:
    - State variable to determine whether filesystem will exist or not.
    required: true
    type: str

is_thin:
    description:
    - Boolean variable, specifies whether or not it is a thin filesystem.
    type: bool

pool_id:
    description:
    - This is the ID of the pool where the filesystem will be created.
    - Either the I(pool_name) or I(pool_id) must be provided to create a new filesystem.
    type: str

cap_unit:
    choices:
    - GB
    - TB
    description:
    - The unit of the filesystem size. It defaults to C(GB), if not specified.
    type: str

password:
    description:
    - The password of the Unity management server.
    required: true
    type: str

username:
    description:
    - The username of the Unity management server.
    required: true
    type: str

pool_name:
    description:
    - This is the name of the pool where the filesystem will be created.
    - Either the I(pool_name) or I(pool_id) must be provided to create a new filesystem.
    type: str

description:
    description:
    - Description about the filesystem.
    - Description can be removed by passing empty string ("").
    type: str

quota_config:
    description:
    - Configuration for quota management. It contains optional parameters.
    suboptions:
      cap_unit:
        choices:
        - MB
        - GB
        - TB
        description:
        - Unit of I(default_soft_limit) and I(default_hard_limit) size.
        - Default unit is C(GB).
        type: str
      default_hard_limit:
        description:
        - Default hard limit for user quotas and tree quotas.
        - If I(default_hard_limit) is not set while creation of filesystem, it will be
          set to C(0B) by default.
        type: int
      default_soft_limit:
        description:
        - Default soft limit for user quotas and tree quotas.
        - If I(default_soft_limit) is not set while creation of filesystem, it will be
          set to C(0B) by default.
        type: int
      grace_period:
        description:
        - Grace period set in quota configuration after soft limit is reached.
        - If I(grace_period) is not set during creation of filesystem, it will be set
          to C(7 days) by default.
        type: int
      grace_period_unit:
        choices:
        - minutes
        - hours
        - days
        description:
        - Unit of grace period.
        - Default unit is C(days).
        type: str
      is_user_quota_enabled:
        description:
        - Indicates whether the user quota is enabled.
        - If I(is_user_quota_enabled) is not set while creation of filesystem, it will
          be set to C(false) by default.
        - Parameters I(is_user_quota_enabled) and I(quota_policy) are mutually exclusive.
        type: bool
      quota_policy:
        choices:
        - FILE_SIZE
        - BLOCKS
        description:
        - Quota policy set in quota configuration.
        - If I(quota_policy) is not set while creation of filesystem, it will be set to
          C(FILE_SIZE) by default.
        - Parameters I(is_user_quota_enabled) and I(quota_policy) are mutually exclusive.
        type: str
    type: dict

access_policy:
    choices:
    - NATIVE
    - UNIX
    - WINDOWS
    description:
    - Access policy of a filesystem.
    type: str

filesystem_id:
    description:
    - The id of the filesystem.
    - It can be used only for get, modify, or delete operations.
    - It is mutually exclusive with I(filesystem_name).
    type: str

nas_server_id:
    description:
    - ID of the NAS server on which filesystem will be hosted.
    type: str

unispherehost:
    description:
    - IP or FQDN of the Unity management server.
    required: true
    type: str

data_reduction:
    description:
    - Boolean variable, specifies whether or not to enable compression. Compression is
      supported only for thin filesystem.
    type: bool

locking_policy:
    choices:
    - ADVISORY
    - MANDATORY
    description:
    - File system locking policies. These policy choices control whether the NFSv4 range
      locks must be honored.
    type: str

smb_properties:
    description:
    - Advance settings for SMB. It contains optional candidate variables.
    suboptions:
      is_smb_notify_on_access_enabled:
        description:
        - Indicates whether notifications of changes to directory file structure are enabled.
        type: bool
      is_smb_notify_on_write_enabled:
        description:
        - Indicates whether file write notifications are enabled on the file system.
        type: bool
      is_smb_op_locks_enabled:
        description:
        - Indicates whether opportunistic file locking is enabled on the file system.
        type: bool
      is_smb_sync_writes_enabled:
        description:
        - Indicates whether the synchronous writes option is enabled on the file system.
        type: bool
      smb_notify_on_change_dir_depth:
        description:
        - Integer variable, determines the lowest directory level to which the enabled
          notifications apply.
        - Minimum value is C(1).
        type: int
    type: dict

tiering_policy:
    choices:
    - AUTOTIER_HIGH
    - AUTOTIER
    - HIGHEST
    - LOWEST
    description:
    - Tiering policy choices for how the storage resource data will be distributed among
      the tiers available in the pool.
    type: str

validate_certs:
    aliases:
    - verifycert
    default: true
    description:
    - Boolean variable to specify whether or not to validate SSL certificate.
    - C(true) - Indicates that the SSL certificate should be verified.
    - C(false) - Indicates that the SSL certificate should not be verified.
    type: bool

filesystem_name:
    description:
    - The name of the filesystem. Mandatory only for the create operation. All the operations
      are supported through I(filesystem_name).
    - It is mutually exclusive with I(filesystem_id).
    type: str

nas_server_name:
    description:
    - Name of the NAS server on which filesystem will be hosted.
    type: str

snap_schedule_id:
    description:
    - This is the id of an existing snapshot schedule which is to be associated with the
      filesystem.
    - This is mutually exclusive with I(snapshot_schedule_name).
    type: str

replication_state:
    choices:
    - enable
    - disable
    description:
    - State of the replication.
    type: str

replication_params:
    description:
    - Settings required for enabling or modifying replication.
    suboptions:
      destination_pool_id:
        description:
        - ID of pool to allocate destination filesystem.
        type: str
      destination_pool_name:
        description:
        - Name of pool to allocate destination filesystem.
        type: str
      new_replication_name:
        description:
        - Replication name to rename the session to.
        type: str
      remote_system:
        description:
        - Details of remote system to which the replication is being configured.
        - The I(remote_system) option should be specified if the I(replication_type) is
          C(remote).
        suboptions:
          remote_system_host:
            description:
            - IP or FQDN for remote Unity unisphere Host.
            required: true
            type: str
          remote_system_password:
            description:
            - Password of remote Unity unisphere Host.
            required: true
            type: str
          remote_system_port:
            default: 443
            description:
            - Port at which remote Unity unisphere is hosted.
            type: int
          remote_system_username:
            description:
            - User name of remote Unity unisphere Host.
            required: true
            type: str
          remote_system_verifycert:
            default: true
            description:
            - Boolean variable to specify whether or not to validate SSL certificate of
              remote Unity unisphere Host.
            - C(true) - Indicates that the SSL certificate should be verified.
            - C(false) - Indicates that the SSL certificate should not be verified.
            type: bool
        type: dict
      replication_mode:
        choices:
        - synchronous
        - asynchronous
        - manual
        description:
        - The replication mode.
        - This is a mandatory field while creating a replication session.
        type: str
      replication_name:
        description:
        - Name of the replication session.
        type: str
      replication_type:
        choices:
        - local
        - remote
        description:
        - Type of replication.
        type: str
      rpo:
        description:
        - Maximum time to wait before the system syncs the source and destination LUNs.
        - The I(rpo) option should be specified if the I(replication_mode) is C(asynchronous).
        - The value should be in range of C(5) to C(1440) for C(asynchronous), C(0) for
          C(synchronous) and C(-1) for C(manual).
        type: int
    type: dict

snap_schedule_name:
    description:
    - This is the name of an existing snapshot schedule which is to be associated with
      the filesystem.
    - This is mutually exclusive with I(snapshot_schedule_id).
    type: str

supported_protocols:
    choices:
    - NFS
    - CIFS
    - MULTIPROTOCOL
    description:
    - Protocols supported by the file system.
    - It will be overridden by NAS server configuration if NAS Server is C(Multiprotocol).
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: true
  type: bool
filesystem_details:
  contains:
    cifs_notify_on_change_dir_depth:
      description: Indicates the lowest directory level to which the enabled notifications
        apply, if any.
      type: int
    description:
      description: Description about the filesystem.
      type: str
    id:
      description: The system generated ID given to the filesystem.
      type: str
    is_cifs_notify_on_access_enabled:
      description: Indicates whether the system generates a notification when a user
        accesses the file system.
      type: bool
    is_cifs_notify_on_write_enabled:
      description: Indicates whether the system generates a notification when the
        file system is written to.
      type: bool
    is_cifs_op_locks_enabled:
      description: Indicates whether opportunistic file locks are enabled for the
        file system.
      type: bool
    is_cifs_sync_writes_enabled:
      description: Indicates whether the CIFS synchronous writes option is enabled
        for the file system.
      type: bool
    is_data_reduction_enabled:
      description: Whether or not compression enabled on this filesystem.
      type: bool
    is_thin_enabled:
      description: Indicates whether thin provisioning is enabled for this filesystem.
      type: bool
    name:
      description: Name of the filesystem.
      type: str
    nas_server:
      contains:
        id:
          description: The system ID given to the NAS Server.
          type: str
        name:
          description: The name of the NAS Server.
          type: str
      description: The NAS Server details on which this filesystem is hosted.
      type: dict
    pool:
      contains:
        id:
          description: The system ID given to the pool.
          type: str
        name:
          description: The name of the storage pool.
          type: str
      description: The pool in which this filesystem is allocated.
      type: dict
    quota_config:
      contains:
        default_hard_limit:
          description: Default hard limit for user quotas and tree quotas.
          type: int
        default_soft_limit:
          description: Default soft limit for user quotas and tree quotas.
          type: int
        grace_period:
          description: Grace period set in quota configuration after soft limit is
            reached.
          type: str
        is_user_quota_enabled:
          description: Indicates whether the user quota is enabled.
          type: bool
        quota_policy:
          description: Quota policy set in quota configuration.
          type: str
      description: Details of quota configuration of the filesystem created.
      type: dict
    replication_sessions:
      contains:
        id:
          description: ID of replication session
          type: str
        name:
          description: Name of replication session
          type: str
        remote_system:
          contains:
            id:
              description: ID of remote system
              type: str
          description: Remote system
          type: dict
      description: List of replication sessions if replication is enabled.
      type: dict
    size_total_with_unit:
      description: Size of the filesystem with actual unit.
      type: str
    snap_schedule_id:
      description: Indicates the id of the snap schedule associated with the filesystem.
      type: str
    snap_schedule_name:
      description: Indicates the name of the snap schedule associated with the filesystem.
      type: str
    snapshots:
      contains:
        id:
          description: The system ID given to the filesystem snapshot.
          type: str
        name:
          description: The name of the filesystem snapshot.
          type: str
      description: The list of snapshots of this filesystem.
      type: list
    tiering_policy:
      description: Tiering policy applied to this filesystem.
      type: str
  description: Details of the filesystem.
  returned: When filesystem exists
  sample:
    access_policy: AccessPolicyEnum.UNIX
    cifs_notify_on_change_dir_depth: 512
    cifs_share: null
    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: null
    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: null
      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
  type: dict