huawei.enterprise.hw_enterprise_quota module – Quota 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_quota.
Synopsis
Supports the provisioning operations on a Quota such as create, modify, delete and get the details of a Quota.
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 |
|---|---|
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. |
|
Hard quota of the file quantity. The maximum value is 2 billion. |
|
Soft quota of the file quantity. An alarm is reported when the soft quota is exceeded. The maximum value is 2 billion. |
|
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 |
|
Quota unique id. |
|
ID of the parent filesystem or dtree object, Required for create and modify operation. |
|
Type of the parent filesystem or dtree, Required for create and modify operation. Choices:
|
|
The password of the PowerStore host. |
|
Type of the quota, Required for create operation. Choices:
|
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Space hard quota. The maximum value is 16 PB. The value is an integer multiple of 1,048,576 bytes (1 MB). |
|
Space soft quota. An alarm is reported when the soft quota is exceeded. The maximum value is 16 PB. The value is an integer multiple of 1,048,576 bytes (1 MB). |
|
Space quota unit. It defaults to Choices:
|
|
Define whether the Quota should exist or not. Choices:
|
|
Port number for the Huawei Enterprise array. If not passed, it will take 8088 as default. Default: |
|
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.
One of space_soft_quota, space_hard_quota, file_soft_quota, file_hard_quota must be set.
The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.
Examples
tasks:
- name: Create Quota
register: create_quota_info
huawei.enterprise.hw_enterprise_quota:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
parent_type: "< filesystem | dtree >"
parent_id: "< parent_id >"
quota_type: "directory"
space_soft_quota: "< space_soft_quota >"
space_hard_quota: "< space_hard_quota >"
file_soft_quota: "< file_soft_quota >"
file_hard_quota: "< file_hard_quota >"
vstore_id: "< vstore_id >"
space_unit: "< B | KB | MB | GB | TB >"
state: "present"
- name: Modify Quota By ID
register: modify_quota_info
huawei.enterprise.hw_enterprise_quota:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ create_quota_info.quota_detail.id }}"
space_soft_quota: "< space_soft_quota >"
space_hard_quota: "< space_hard_quota >"
file_soft_quota: "< file_soft_quota >"
file_hard_quota: "< file_hard_quota >"
space_unit: "< B | KB | MB | GB | TB >"
state: "present"
- name: Query Quota Detail By ID
register: query_quota_info
huawei.enterprise.hw_enterprise_quota:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ create_quota_info.quota_detail.id }}"
filter:
- id
- parent_type
- parent_id
- vstore_id
- vstore_name
- space_soft_quota
- space_hard_quota
- file_soft_quota
- file_hard_quota
- space_used
- file_used
- space_unit
state: "present"
- name: Delete Quota Detail
huawei.enterprise.hw_enterprise_quota:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ quota_info.quota_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 Quota. Returned: When Quota exists Sample: |
|
Hard quota of the file quantity. Returned: always |
|
Soft quota of the file quantity. Returned: always |
|
Number of used files. Returned: always |
|
The system generated ID given to the Quota. Returned: always |
|
ID of a file system or dtree. Returned: always |
|
Type number of the parent object. Returned: always |
|
Space hard quota. Returned: always |
|
Space soft quota. Returned: always |
|
Space quota unit. Returned: always |
|
Used space. Returned: always |
|
id of storage vstore. Returned: always |
|
Name of storage vstore. Returned: always |
|
task execute remark Returned: always Sample: |