huawei.enterprise.hw_enterprise_storage_pool module – Storage Pool 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.

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

Synopsis

  • Supports the provisioning operations on a storage pool such as create, expand, delete and get the details of a storage pool.

Parameters

Parameter

Comments

all

boolean

When creating and expand a storage pool using all hard drives, this parameter is required.

Should be set to “true”.

Choices:

  • false

  • true

disk_capacity

list / elements=string

When creating and expand a storage pool by disk number, this parameter is required. Ensure that the values of the following parameters are in one-to-one correspondence, [“disk_number_list”, “disk_capacity”, “frame_id_list”]

Indicates the disk capacity.

disk_ids

list / elements=string

When creating and expand a storage pool by disk id, this parameter is required.

Should be set to disk id.

disk_number_list

list / elements=string

When creating and expand a storage pool by disk number, this parameter is required. ensure that the values of the following parameters are in one-to-one correspondence, [“disk_number_list”, “disk_capacity”, “frame_id_list”]

Indicates the disk quantity list.

disk_type

string

Disk type, When creating and expand a storage pool by disk number, this parameter is required.

Choices:

  • "SSD"

  • "SSD SED"

  • "NVMe SSD"

  • "NVMe SSD SED"

enclosure_list

list / elements=string

List of controller enclosures name.

When creating and expand a storage pool by disk number, this parameter is required.

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"

  • "health_status"

  • "running_status"

  • "user_total_capacity"

  • "user_free_capacity"

  • "user_consumed_capacity"

  • "user_consumed_capacity_percentage"

  • "replication_capacity"

  • "thin_provision_save_percentage"

  • "subscribed_capacity"

  • "used_subscribed_capacity"

  • "lun_protection_capacity"

  • "reclaim_subscribed_capacity"

frame_id_list

list / elements=string

When creating and expand a storage pool by disk number, which is delivered only for enclosure redundancy. Ensure that the values of the following parameters are in one-to-one correspondence, [“disk_number_list”, “disk_capacity”, “frame_id_list”]

Indicates the list of enclosure ids.

id

string

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

name

string

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

raid_level

string

Optional parameters for create operation, Tier 0 protection level.

Choices:

  • "raid10"

  • "raid5"

  • "raid0"

  • "raid1"

  • "raid6"

  • "raid50"

  • "raid3"

  • "raid_tp"

state

string / required

Define whether the Storage Pool should exist or not.

Choices:

  • "absent"

  • "present"

Notes

Note

  • The check_mode is not supported.

Examples

---
  tasks:
    - name: Create StoragePool By All Disks
      register: create_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< storagepool_name >"
        all: True
        raid_level: "< raid10 | raid5 | raid0 | raid1 | raid6 | raid50 | raid3 | raid_tp >"
        state: "present"

    - name: Create StoragePool By Disks Id
      register: create_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< storagepool_name >"
        disk_ids:
          - "< disk_id1 >"
          - "< disk_id2 >"
          - "< disk_id3 >"
        raid_level: "< raid10 | raid5 | raid0 | raid1 | raid6 | raid50 | raid3 | raid_tp >"
        state: "present"

    - name: Create StoragePool By Disks Numbers
      register: create_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< storagepool_name >"
        disk_number_list:
          - "< disk_number1 >"
          - "< disk_number2 >"
          - "< disk_number3 >"
        disk_capacity:
          - "< disk_capacity1 >"
          - "< disk_capacity2 >"
          - "< disk_capacity3 >"
        frame_id_list:
          - "< frame_id1 >"
          - "< frame_id2 >"
          - "< frame_id3 >"
        disk_type: "< SSD | SSD SED | NVMe SSD | NVMe SSD SED >"
        enclosure_list:
          - "< enclosure_name1 >"
          - "< enclosure_name2 >"
        raid_level: "< raid10 | raid5 | raid0 | raid1 | raid6 | raid50 | raid3 | raid_tp >"
        state: "present"

    - name: Expand StoragePool By Id With All Disks
      register: expand_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_storagepool_info_by_name.storage_pool_detail.id }}"
        all: True
        raid_level: "< raid10 | raid5 | raid0 | raid1 | raid6 | raid50 | raid3 | raid_tp >"
        state: "present"

    - name: Expand StoragePool By Id With Disks Id
      register: expand_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_storagepool_info_by_name.storage_pool_detail.id }}"
        disk_ids:
          - "< disk_id1 >"
          - "< disk_id2 >"
          - "< disk_id3 >"
        state: "present"

    - name: Expand StoragePool By Id With Disks Numbers
      register: expand_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_storagepool_info_by_name.storage_pool_detail.id }}"
        disk_number_list:
          - "< disk_number1 >"
          - "< disk_number2 >"
          - "< disk_number3 >"
        disk_capacity:
          - "< disk_capacity1 >"
          - "< disk_capacity2 >"
          - "< disk_capacity3 >"
        frame_id_list:
          - "< frame_id1 >"
          - "< frame_id2 >"
          - "< frame_id3 >"
        disk_type: "< SSD | SSD SED | NVMe SSD | NVMe SSD SED >"
        enclosure_list:
          - "< enclosure_name1 >"
          - "< enclosure_name2 >"
        state: "present"

    - name: Expand StoragePool By Name With All Disks
      register: expand_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< storagepool_name >"
        all: True
        state: "present"

    - name: Expand StoragePool By Name With Disks Id
      register: expand_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< storagepool_name >"
        disk_ids:
          - "< disk_id1 >"
          - "< disk_id2 >"
          - "< disk_id3 >"
        state: "present"

    - name: Expand StoragePool By Name With Disks Numbers
      register: expand_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< storagepool_name >"
        disk_number_list:
          - "< disk_number1 >"
          - "< disk_number2 >"
          - "< disk_number3 >"
        disk_capacity:
          - "< disk_capacity1 >"
          - "< disk_capacity2 >"
          - "< disk_capacity3 >"
        frame_id_list:
          - "< frame_id1 >"
          - "< frame_id2 >"
          - "< frame_id3 >"
        disk_type: "< SSD | SSD SED | NVMe SSD | NVMe SSD SED >"
        enclosure_list:
          - "< enclosure_name1 >"
          - "< enclosure_name2 >"
        state: "present"

    - name: Query StoragePool Detail By Name
      register: query_storagepool_info_by_name
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< storagepool_name >"
        filter:
          - id
          - name
          - health_status
          - running_status
          - user_total_capacity
          - user_free_capacity
          - user_consumed_capacity
          - user_consumed_capacity_percentage
          - replication_capacity
          - thin_provision_save_percentage
          - subscribed_capacity
          - used_subscribed_capacity
          - lun_protection_capacity
          - reclaim_subscribed_capacity
        state: "present"

    - name: Query StoragePool Detail By Id
      register: query_storagepool_info_disk_ids
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_storagepool_info_by_name.storage_pool_detail.id }}"
        filter:
          - id
          - name
          - health_status
          - running_status
          - user_total_capacity
          - user_free_capacity
          - user_consumed_capacity
          - user_consumed_capacity_percentage
          - replication_capacity
          - thin_provision_save_percentage
          - subscribed_capacity
          - used_subscribed_capacity
          - lun_protection_capacity
          - reclaim_subscribed_capacity
        state: "present"

    - name: Query All StoragePool Detail
      register: query_all_storagepool_info
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        filter:
          - id
          - name
          - health_status
          - running_status
          - user_total_capacity
          - user_free_capacity
          - user_consumed_capacity
          - user_consumed_capacity_percentage
          - replication_capacity
          - thin_provision_save_percentage
          - subscribed_capacity
          - used_subscribed_capacity
          - lun_protection_capacity
          - reclaim_subscribed_capacity
        state: "present"

    - name: Delete StoragePool Detail By Name
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< storagepool_name >"
        state: "absent"

    - name: Delete StoragePool Detail By Id
      huawei.enterprise.hw_enterprise_storage_pool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_storagepool_info_by_name.storage_pool_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

remark

string

task execute remark

Returned: always

Sample: "Storage pool sample_storage_pool create successfully"

storage_pool_detail

complex

Details of the storage pool.

Returned: When storage pool exists

Sample: {"health_status": "Normal", "id": "1", "lun_protection_capacity": 3052, "name": "sample_storage_pool", "reclaim_subscribed_capacity": 1024, "replication_capacity": 1024, "running_status": "Online", "subscribed_capacity": 2048, "thin_provision_save_percentage": 30, "used_subscribed_capacity": 1024, "user_consumed_capacity": 2048, "user_consumed_capacity_percentage": 10, "user_free_capacity": 2048, "user_total_capacity": 1024}

health_status

string

Health status of the storage pool.

Returned: always

id

string

The system generated ID given to the storage pool.

Returned: always

lun_protection_capacity

string

Logical protection capacity of a LUN, unit:GB.

Returned: always

name

string

Name of the storage pool.

Returned: always

reclaim_subscribed_capacity

string

Subscribed capacity reclaimed in a storage pool, unit:GB.

Returned: always

replication_capacity

string

Capacity consumed by all LUNs for data protection, unit:GB.

Returned: always

running_status

string

Running status of the storage pool.

Returned: always

subscribed_capacity

string

Total subscribed capacity of the storage pool, unit:GB.

Returned: always

thin_provision_save_percentage

string

Ratio of space saved by thin LUNs.

Returned: always

used_subscribed_capacity

string

Used subscribed capacity of the storage pool, unit:GB.

Returned: always

user_consumed_capacity

string

Used capacity, unit:GB.

Returned: always

user_consumed_capacity_percentage

string

Used capacity ratio, unit:%.

Returned: always

user_free_capacity

string

Free capacity, unit:GB.

Returned: always

user_total_capacity

string

Total capacity, unit:GB.

Returned: always

Authors

  • Huawei eSDK Ansible Team