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

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.

file_hard_quota

integer

Hard quota of the file quantity.

The maximum value is 2 billion.

file_soft_quota

integer

Soft quota of the file quantity. An alarm is reported when the soft quota is exceeded.

The maximum value is 2 billion.

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"

  • "parent_type"

  • "vstore_name"

  • "vstore_id"

  • "parent_id"

  • "space_soft_quota"

  • "space_hard_quota"

  • "file_soft_quota"

  • "file_hard_quota"

  • "space_used"

  • "file_used"

  • "space_unit"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

Quota unique id.

parent_id

string

ID of the parent filesystem or dtree object, Required for create and modify operation.

parent_type

string

Type of the parent filesystem or dtree, Required for create and modify operation.

Choices:

  • "filesystem"

  • "dtree"

password

string / required

The password of the PowerStore host.

quota_type

string

Type of the quota, Required for create operation.

Choices:

  • "directory"

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

space_hard_quota

integer

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

integer

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_unit

string

Space quota unit.

It defaults to "GB" if not specified.

Choices:

  • "B"

  • "KB"

  • "MB"

  • "GB"

  • "TB"

state

string / required

Define whether the Quota 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

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.

  • 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

actions

list / elements=string

playbook action lists

Returned: always

Sample: ["create"]

changed

boolean

Whether or not the resource has changed.

Returned: always

Sample: false

quota_detail

complex

Details of the Quota.

Returned: When Quota exists

Sample: {"file_hard_quota": "200", "file_soft_quota": "100", "file_used": 100, "id": "1", "parent_id": "0", "parent_type": "filesystem", "space_hard_quota": "1024", "space_soft_quota": "1024", "space_unit": "GB", "space_used": 1024, "vstore_id": "0", "vstore_name": "System_vStore"}

file_hard_quota

integer

Hard quota of the file quantity.

Returned: always

file_soft_quota

integer

Soft quota of the file quantity.

Returned: always

file_used

integer

Number of used files.

Returned: always

id

string

The system generated ID given to the Quota.

Returned: always

parent_id

string

ID of a file system or dtree.

Returned: always

parent_type

string

Type number of the parent object.

Returned: always

space_hard_quota

integer

Space hard quota.

Returned: always

space_soft_quota

integer

Space soft quota.

Returned: always

space_unit

string

Space quota unit.

Returned: always

space_used

integer

Used space.

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: "Quota sample_quota create successfully"

Authors

  • Huawei eSDK Ansible Team