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 |
|---|---|
When creating and expand a storage pool using all hard drives, this parameter is required. Should be set to “true”. Choices:
|
|
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. |
|
When creating and expand a storage pool by disk id, this parameter is required. Should be set to disk id. |
|
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, When creating and expand a storage pool by disk number, this parameter is required. Choices:
|
|
List of controller enclosures name. When creating and expand a storage pool by disk number, this parameter is required. |
|
Parameter required for all query operations. The response will include the storage parameters that match the indicate filter criteria. Choices:
|
|
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. |
|
Storage Pool unique id, Mutually exclusive with “name”, Priority is higher than name. |
|
Storage Pool unique name, Required for create operation. Mutually exclusive with id. |
|
Optional parameters for create operation, Tier 0 protection level. Choices:
|
|
Define whether the Storage Pool should exist or not. Choices:
|
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 |
|---|---|
playbook action lists Returned: always Sample: |
|
Whether or not the resource has changed. Returned: always Sample: |
|
task execute remark Returned: always Sample: |
|
Details of the storage pool. Returned: When storage pool exists Sample: |
|
Health status of the storage pool. Returned: always |
|
The system generated ID given to the storage pool. Returned: always |
|
Logical protection capacity of a LUN, unit:GB. Returned: always |
|
Name of the storage pool. Returned: always |
|
Subscribed capacity reclaimed in a storage pool, unit:GB. Returned: always |
|
Capacity consumed by all LUNs for data protection, unit:GB. Returned: always |
|
Running status of the storage pool. Returned: always |
|
Total subscribed capacity of the storage pool, unit:GB. Returned: always |
|
Ratio of space saved by thin LUNs. Returned: always |
|
Used subscribed capacity of the storage pool, unit:GB. Returned: always |
|
Used capacity, unit:GB. Returned: always |
|
Used capacity ratio, unit:%. Returned: always |
|
Free capacity, unit:GB. Returned: always |
|
Total capacity, unit:GB. Returned: always |