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 |
|---|---|
Clone Filesystem operation, Required for split, cancel split and suspend split clone filesystem operation. |
|
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 |
|
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. |
|
Whether to delete the associated snapshots in the parent file system. Optional parameters for split clone filesystem operation, Default false. Choices:
|
|
Description of the FileSystem. |
|
Parameter required for all query operations. The response will include the storage parameters that match the indicate filter criteria. Choices:
|
|
IP or FQDN of the huawei enterprise management system. MultiIP config as ip1,ip2 |
|
FileSystem unique id, Mutually exclusive with “name”, Priority is higher than name. |
|
FileSystem unique name, Required for create operation. Mutually exclusive with id. |
|
FileSystem new unique name, Required for modify filesystem name. |
|
Clone FileSystem parent id, Required for create clone filesystem operation. can set when need modify exist filesystem capacity |
|
The password of the PowerStore host. |
|
Percentage of the reserved snapshot space, The value ranges from 0% to 50%. Optional parameters for create and modify operation. |
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Clone Filesystem operation, Optional parameters for split clone filesystem operation. Default medium. Choices:
|
|
Define whether the FileSystem should exist or not. Choices:
|
|
Port number for the Huawei Enterprise array. If not passed, it will take 8088 as default. Default: |
|
capacity unit. It defaults to Choices:
|
|
Whether to write plugin log to local filesystem. Choices:
|
|
The username of the PowerStore host. |
|
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. |
|
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 |
|---|---|
playbook action lists Returned: always Sample: |
|
Whether or not the resource has changed. Returned: always Sample: |
|
Details of the FileSystem. Returned: When FileSystem exists Sample: |
|
Used capacity of the FileSystem. Returned: always |
|
Available file system capacity. Returned: always |
|
total capacity of the FileSystem. Returned: always |
|
The system generated ID given to the FileSystem. Returned: always |
|
Total number of inodes. Returned: always |
|
Number of used inodes. Returned: always |
|
Name of the FileSystem. Returned: always |
|
Storage pool ID. Returned: always |
|
Storage pool name. Returned: always |
|
running status of the FileSystem. Returned: always |
|
Percentage of the reserved snapshot space. Returned: always |
|
Clone filesystem split status. Returned: always |
|
unit of all capacity. Returned: always |
|
id of storage vstore. Returned: always |
|
Name of storage vstore. Returned: always |
|
task execute remark Returned: always Sample: |