huawei.enterprise.hw_enterprise_lun module – LUN 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_lun.
Synopsis
Supports the provisioning operations on a LUN such as create, modify, delete and get the details of a LUN.
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 |
|---|---|
Only can set for Oceanstor V5 storage.V6 or later. It defaults to Choices:
|
|
lun total capacity, Required for create operation. can set when need modify exist lun capacity. capacity should be greater or equal to 512 KB. |
|
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. |
|
Description of the LUN. |
|
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 |
|
LUN unique id, Mutually exclusive with name, Priority is higher than name. |
|
LUN unique name, Required for create operation. Mutually exclusive with id. |
|
LUN new unique name, Required for modify lun name. |
|
StoragePool ID, Required for create operation. |
|
The password of the PowerStore host. |
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the LUN 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. For V5 storage, don’t need to be configured in non-multi-tenant scenarios. |
|
id of lun workload Type. Only support when create lun, can not be modify. |
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 LUN
register: lun_info
huawei.enterprise.hw_enterprise_lun:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< lun_name >"
parent_id: "< storage_pool_id >"
capacity: < capacity >
unit: "< B | KB | MB | GB | TB | PB >"
description: "< description >"
alloc_type: "< thin | thick >"
workload_type_id: "< work_load_type_id >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify LUN By Name
register: lun_info
huawei.enterprise.hw_enterprise_lun:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< lun_name >"
new_name: "< lun_new_name >"
capacity: < capacity >
unit: "< B | KB | MB | GB | TB | PB >"
description: "< new description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify LUN By ID
register: lun_info
huawei.enterprise.hw_enterprise_lun:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ lun_info.lun_detail.id }}"
new_name: "< lun_new_name >"
capacity: < capacity >
unit: "< B | KB | MB | GB | TB | PB >"
description: "< new description >"
state: "present"
- name: Query LUN Detail By Name
register: lun_info
huawei.enterprise.hw_enterprise_lun:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< lun_name >"
filter:
- id
- name
- vstore_name
- vstore_id
- parent_id
- parent_name
- running_status
- capacity
- alloc_capacity
- alloc_type
- workload_type_id
- wwn
- unit
vstore_id: "< vstore_id >"
state: "present"
- name: Query LUN Detail By ID
register: lun_info
huawei.enterprise.hw_enterprise_lun:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ lun_info.lun_detail.id }}"
filter:
- id
- name
- vstore_name
- vstore_id
- parent_id
- parent_name
- running_status
- capacity
- alloc_capacity
- alloc_type
- workload_type_id
- wwn
- unit
state: "present"
- name: Query Multi LUN
register: all_lun
huawei.enterprise.hw_enterprise_lun:
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
- capacity
- alloc_capacity
- alloc_type
- workload_type_id
- wwn
- unit
state: "present"
- name: Delete LUN Detail By Name
huawei.enterprise.hw_enterprise_lun:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< lun_name >"
vstore_id: "< vstore_id >"
state: "absent"
- name: Delete LUN Detail By ID
huawei.enterprise.hw_enterprise_lun:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ lun_info.lun_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 LUN. Returned: When lun exists Sample: |
|
total capacity of the LUN. Returned: success |
|
The system generated ID given to the LUN. Returned: success |
|
Name of the LUN. Returned: success |
|
running status of the LUN. Returned: success |
|
unit of all capacity. Returned: success |
|
Used capacity of the LUN. Returned: success |
|
id of storage vstore. Returned: success |
|
Name of storage vstore. Returned: success |
|
WWN of the LUN. Returned: success |
|
task execute remark Returned: always Sample: |