huawei.enterprise.hw_enterprise_mapping module – Mapping 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_mapping.
Synopsis
Supports the provisioning operations on a mapping such as create, modify, delete and get the details of a mapping.
Support mapping between host and 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 |
|---|---|
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. |
|
Parameter required for all query operations. The response will include the storage parameters that match the indicate filter criteria. Choices:
|
|
Mapping host id, Mutually exclusive with host_name, Priority is higher than host_name. Either host_name or host_id must be configured. host_id, lun_id, port_group_id must be set up together. |
|
Start value of the host LUN ID. |
|
Mapping host name, Mutually exclusive with host_id, Priority is higher than host_id. Either host_name or host_id must be configured. host_name, lun_name, port_group_name must be set up together. |
|
IP or FQDN of the huawei enterprise management system. MultiIP config as ip1,ip2 |
|
Mapping lun id, Mutually exclusive with lun_name, Priority is higher than lun_name. Either lun_name or lun_id must be configured. host_id, lun_id, port_group_id must be set up together. |
|
Mapping lun name, Mutually exclusive with lun_id, Priority is higher than lun_id. Either lun_name or lun_id must be configured. host_name, lun_name, port_group_name must be set up together. |
|
The password of the PowerStore host. |
|
Mapping port group id, Mutually exclusive with port_group_name. Priority is higher than port_group_name. host_id, lun_id, port_group_id must be set up together. |
|
Mapping port group name, Mutually exclusive with port_group_id. Priority is higher than port_group_id. host_name, lun_name, port_group_name must be set up together. |
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the mapping 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:System_vStore if not specified. |
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 Mapping for host and lun by id
register: mapping_info
huawei.enterprise.hw_enterprise_mapping:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
host_id: "< host_id >"
lun_id: "< lun_id >"
port_group_id: "< port_group_id >"
host_lun_id: "< host_lun_id >"
state: "present"
- name: Create Mapping for host and lun by name
register: mapping_info
huawei.enterprise.hw_enterprise_mapping:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
host_name: "< host_name >"
lun_name: "< lun_name >"
port_group_name: "< port_group_name >"
host_lun_id: "< host_lun_id >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify Mapping host_lun_id for host and lun
register: mapping_info
huawei.enterprise.hw_enterprise_mapping:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
host_id: "< host_id >"
lun_id: "< lun_id >"
host_lun_id: "< host_lun_id >"
state: "present"
- name: Query Mapping detail by name
register: mapping_info
huawei.enterprise.hw_enterprise_mapping:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
host_name: "< host_name >"
lun_name: "< lun_name >"
filter:
- host_id
- lun_id
- host_name
- lun_name
- host_lun_id
- port_group_id
- port_group_name
- vstore_id
- vstore_name
vstore_id: "< vstore_id >"
state: "present"
- name: Query Mapping detail by id
register: mapping_info
huawei.enterprise.hw_enterprise_mapping:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
host_id: "< host_id >"
lun_id: "< lun_id >"
filter:
- host_id
- lun_id
- host_name
- lun_name
- host_lun_id
- port_group_id
- port_group_name
- vstore_id
- vstore_name
state: "present"
- name: Delete Mapping by name
huawei.enterprise.hw_enterprise_mapping:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
host_name: "< host_name >"
lun_name: "< lun_name >"
vstore_id: "< vstore_id >"
state: "absent"
- name: Delete Mapping by id
huawei.enterprise.hw_enterprise_mapping:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
host_id: "< host_id >"
lun_id: "< lun_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 mapping. Returned: When mapping exists Sample: |
|
The host id of the mapping. Returned: always |
|
Host LUN ID. Returned: always |
|
The host name of the mapping. Returned: always |
|
The LUN id of the mapping. Returned: always |
|
The LUN name of the mapping. Returned: always |
|
The port group id of the mapping. Returned: success |
|
The port group name of the mapping. Returned: success |
|
ID of storage vstore. Returned: always |
|
Name of storage vstore. Returned: always |
|
Task execute remark Returned: always Sample: |