huawei.enterprise.hw_enterprise_filesystem module – FileSystem operations for Huawei Enterprise Storage

Note

This module is part of the huawei.enterprise collection (version 2.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install huawei.enterprise. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: huawei.enterprise.hw_enterprise_filesystem.

Synopsis

  • Supports the provisioning operations on a FileSystem such as create, modify, delete and get the details of a FileSystem.

Requirements

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

  • Huawei Dorado v5/v6/v7 and OceanStor v5/v6/v7 Storage

Parameters

Parameter

Comments

action

integer

Clone Filesystem operation, Required for split, cancel split and suspend split clone filesystem operation.

capacity

string

FileSystem total capacity, Optional parameters for create operation. The default value of the thin file system is 32 TB.

can set when need modify exist filesystem capacity

custom_vars

dictionary

Parameters used to extend those not currently supported by the module.

Configuration needs to be based on the REST API documentation for storage.

If necessary, you can contact the plugin technical support for assistance.

delete_parent_snap

list / elements=string

Whether to delete the associated snapshots in the parent file system. Optional parameters for split clone filesystem operation, Default false.

Choices:

  • "true"

  • "false"

description

string

Description of the FileSystem.

filter

list / elements=string

Parameter required for all query operations.

The response will include the storage parameters that match the indicate filter criteria.

Choices:

  • "id"

  • "name"

  • "vstore_name"

  • "vstore_id"

  • "parent_id"

  • "parent_name"

  • "running_status"

  • "capacity"

  • "allocated_capacity"

  • "snapshot_reserve"

  • "inode_total_count"

  • "inode_used_count"

  • "split_status"

  • "unit"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

FileSystem unique id, Mutually exclusive with “name”, Priority is higher than name.

name

string

FileSystem unique name, Required for create operation. Mutually exclusive with id.

new_name

string

FileSystem new unique name, Required for modify filesystem name.

parent_fs_id

integer

Clone FileSystem parent id, Required for create clone filesystem operation.

can set when need modify exist filesystem capacity

password

string / required

The password of the PowerStore host.

snapshot_reserve

string

Percentage of the reserved snapshot space, The value ranges from 0% to 50%. Optional parameters for create and modify operation.

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

split_speed

list / elements=string

Clone Filesystem operation, Optional parameters for split clone filesystem operation. Default medium.

Choices:

  • "low"

  • "medium"

  • "high"

  • "highest"

state

string / required

Define whether the FileSystem should exist or not.

Choices:

  • "absent"

  • "present"

storage_port

integer

Port number for the Huawei Enterprise array.

If not passed, it will take 8088 as default.

Default: 8088

unit

string

capacity unit.

It defaults to "GB" if not specified.

Choices:

  • "B"

  • "KB"

  • "MB"

  • "GB"

  • "TB"

  • "PB"

use_log

boolean

Whether to write plugin log to local filesystem.

Choices:

  • false ← (default)

  • true

username

string / required

The username of the PowerStore host.

valid_certs

string

The path of the SSL certificate variable to specify whether to validate SSL certificate or not.

If don’t set means no need to verify ssl cert.

vstore_id

string

id of storage vstore.

It defaults to 0:SystemVstore if not specified.

Notes

Note

  • The check_mode is not supported.

  • The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.

Examples

---
  tasks:
    - name: Create Filesystem
      register: filesystem_info
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< filesystem_name >"
        parent_id: "< pool_id >"
        capacity: "< new_capacity >"
        unit: "< B | KB | MB | GB | TB | PB >"
        snapshot_reserve: "< new_snapshot_reserve >"
        description: "< description >"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Create Clone Filesystem
      register: clone_filesystem_info
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< filesystem_name >"
        parent_fs_id: "{{ filesystem_info.filesystem_detail.id }}"
        description: "< description >"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Split Clone Filesystem By ID
      register: clone_filesystem_info
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "< clone_filesystem_id >"
        action: "< start | suspend | cancel >"
        split_speed: "< low | medium | high | highest >"
        delete_parent_snap: "{{ true | false }}"
        state: "present"

    - name: Split Clone Filesystem By Name
      register: clone_filesystem_info
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< clone_filesystem_name >"
        action: "< start | suspend | cancel >"
        split_speed: "< low | medium | high | highest >"
        delete_parent_snap: "{{ true | false }}"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Modify Filesystem By Name
      register: filesystem_info
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< filesystem_name >"
        new_name: "< new_fs_name >"
        capacity: "< new_capacity >"
        unit: "< B | KB | MB | GB | TB | PB >"
        snapshot_reserve: "< new_snapshot_reserve >"
        description: "< description >"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Modify Filesystem By ID
      register: filesystem_info
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ filesystem_info.filesystem_detail.id }}"
        new_name: "< new_fs_name >"
        capacity: "< new_capacity >"
        unit: "< B | KB | MB | GB | TB | PB >"
        snapshot_reserve: "< new_snapshot_reserve >"
        description: "< description >"
        state: "present"

    - name: Query Filesystem Detail By Name
      register: filesystem_info
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< filesystem_name >"
        filter:
          - id
          - name
          - vstore_name
          - vstore_id
          - parent_id
          - parent_name
          - running_status
          - snapshot_reserve
          - capacity
          - alloc_capacity
          - available_capacity
          - inode_total_count
          - inode_used_count
          - split_status
          - unit
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Query Filesystem Detail By ID
      register: filesystem_info
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ filesystem_info.filesystem_detail.id }}"
        filter:
          - id
          - name
          - vstore_name
          - vstore_id
          - parent_id
          - parent_name
          - running_status
          - snapshot_reserve
          - capacity
          - alloc_capacity
          - available_capacity
          - inode_total_count
          - inode_used_count
          - split_status
          - unit
        state: "present"

    - name: Query Multi Filesystem
      register: all_filesystem
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        vstore_id: "< vstore_id >"
        filter:
          - id
          - name
          - vstore_name
          - vstore_id
          - parent_id
          - parent_name
          - running_status
          - snapshot_reserve
          - capacity
          - alloc_capacity
          - available_capacity
          - inode_total_count
          - inode_used_count
          - split_status
          - unit
        state: "present"

    - name: Delete Filesystem Detail By Name
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< filesystem_name >"
        vstore_id: "< vstore_id >"
        state: "absent"

    - name: Delete Filesystem Detail By ID
      huawei.enterprise.hw_enterprise_filesystem:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ filesystem_info.filesystem_detail.id }}"
        state: "absent"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

actions

list / elements=string

playbook action lists

Returned: always

Sample: ["create"]

changed

boolean

Whether or not the resource has changed.

Returned: always

Sample: false

filesystem_detail

complex

Details of the FileSystem.

Returned: When FileSystem exists

Sample: {"alloc_capacity": 5, "available_capacity": 5, "capacity": 10, "id": "1", "inode_total_count": 5, "inode_used_count": 3, "name": "sample_filesystem", "parent_id": "0", "parent_name": "pool", "running_status": "online", "snapshot_reserve": "50%", "split_status": "splitting", "unit": "GB", "vstore_id": "0", "vstore_name": "System_vStore"}

alloc_capacity

integer

Used capacity of the FileSystem.

Returned: always

available_capacity

integer

Available file system capacity.

Returned: always

capacity

integer

total capacity of the FileSystem.

Returned: always

id

string

The system generated ID given to the FileSystem.

Returned: always

inode_total_count

string

Total number of inodes.

Returned: always

inode_used_count

string

Number of used inodes.

Returned: always

name

string

Name of the FileSystem.

Returned: always

parent_id

string

Storage pool ID.

Returned: always

parent_name

string

Storage pool name.

Returned: always

running_status

string

running status of the FileSystem.

Returned: always

snapshot_reserve

string

Percentage of the reserved snapshot space.

Returned: always

split_status

string

Clone filesystem split status.

Returned: always

unit

string

unit of all capacity.

Returned: always

vstore_id

string

id of storage vstore.

Returned: always

vstore_name

string

Name of storage vstore.

Returned: always

remark

string

task execute remark

Returned: always

Sample: "Filesystem sample_filesystem create successfully"

Authors

  • Huawei eSDK Ansible Team