huawei.enterprise.hw_enterprise_host_group module – Host Group 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_host_group.
Synopsis
Supports the provisioning operations on a Host group such as create, modify, associate, disassociate, delete and get the details of a host group.
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. |
|
Description of the host group. Required when create host group. |
|
Parameter required for all query operations. The response will include the storage parameters that match the indicate filter criteria. Choices:
|
|
Id of host, Required when associate or disassociate host. Mutually exclusive with “name”, Priority is higher than host_name. |
|
Id of host, Required when associate or disassociate host. Mutually exclusive with “id”, Priority is higher than host_id. |
|
IP or FQDN of the huawei enterprise management system. MultiIP config as ip1,ip2 |
|
Host group unique id, Mutually exclusive with “name”, Priority is higher than name. |
|
Host group unique name, Required for create operation. Mutually exclusive with id. |
|
Host group new unique name, Required for modify host group source name. |
|
Required when need associate or disassociate object. Choices:
|
|
The password of the PowerStore host. |
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the host group 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:SystemVstore if not specified. |
Notes
Note
The check_mode is not supported.
description must be set when create host group.
The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.
Examples
---
tasks:
- name: Create Host group
register: host_group_info
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< host_group_name >"
description: "< host_group_description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify Host group by name
register: host_group_info
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< host_group_name >"
new_name: "< new_name >"
description: "< host_group_description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify Host group by id
register: host_group_info
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ host_group_info.host_group_detail.id }}"
new_name: "< new_name >"
description: "< host_group_description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Associate host to Host group by id
register: host_group_info
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ host_group_info.host_group_detail.id }}"
host_id: "< host_id >"
host_name: "< host_name >"
vstore_id: "< vstore_id >"
operation: "associate"
state: "present"
- name: Associate host to Host group by name
register: host_group_info
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< host_group_name >"
host_id: "< host_id >"
host_name: "< host_name >"
operation: "associate"
vstore_id: "< vstore_id >"
state: "present"
- name: Disassociate host to Host group by id
register: host_group_info
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ host_group_info.host_group_detail.id }}"
host_id: "< host_id >"
host_name: "< host_name >"
vstore_id: "< vstore_id >"
operation: "disassociate"
state: "present"
- name: Disassociate host to Host group by name
register: host_group_info
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< host_group_name >"
host_id: "< host_id >"
host_name: "< host_name >"
operation: "disassociate"
vstore_id: "< vstore_id >"
state: "present"
- name: Query Host group by id
register: host_group_info
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "< host_group_id >"
filter:
- id
- name
- vstore_name
- vstore_id
- capacity
- used_capacity
- protection_capacity
- host_number
- mapping_lun_number
- is_add_mapping_view
state: "present"
- name: Query Host group by name
register: host_group_info
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< host_group_name >"
vstore_id: "< vstore_id >"
filter:
- id
- name
- vstore_name
- vstore_id
- capacity
- used_capacity
- protection_capacity
- host_number
- mapping_lun_number
- is_add_mapping_view
state: "present"
- name: query multi Host group
register: all_host_group
huawei.enterprise.hw_enterprise_host_group:
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
- capacity
- used_capacity
- protection_capacity
- host_number
- mapping_lun_number
- is_add_mapping_view
state: "present"
- name: Delete Host group by name
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< host_group_name >"
vstore_id: "< vstore_id >"
state: "absent"
- name: Delete Host group by id
huawei.enterprise.hw_enterprise_host_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ host_group_info.host_group_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 host group. Returned: When host group exists Sample: |
|
Total capacity of host group. Returned: always |
|
Number of host in host group. Returned: always |
|
The system generated ID given to the host group. Returned: always |
|
Is host group add to mapping view or not. Returned: always |
|
Name of the host group. Returned: always |
|
Data protection capacity of host group. Returned: always |
|
Used capacity of host group. Returned: always |
|
ID of storage vstore. Returned: always |
|
Name of storage vstore. Returned: always |
|
Task execute remark Returned: always Sample: |