huawei.enterprise.hw_enterprise_port_group module – Port 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_port_group.
Synopsis
Supports the provisioning operations on a port group such as create, modify, delete and get the details of a port group.
Supports query all port group.
Supports add and remove port.
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 port group. Required when create port group. |
|
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 |
|
Port group unique id, Mutually exclusive with “name”, Priority is higher than name. |
|
Port group unique name, Required for create operation. Mutually exclusive with id. |
|
Port group new unique name, Required for modify port group source name. |
|
Required when need add or remove port. Choices:
|
|
The password of the PowerStore host. |
|
Id of eh_port of fc_port, Required when need add or remove port. |
|
Type of port added to port group. Choices:
|
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the port 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 port group.
The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.
Examples
---
tasks:
- name: Create Port Group
register: port_group_info
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< port_group_name >"
description: "< port_group_description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify Port Group Common Param By Name
register: port_group_info
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< port_group_name >"
new_name: "< new_port_group_name >"
description: "< port_group_description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify Port Group Common Param By ID
register: port_group_info
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ port_group_info.port_group_detail.id }}"
new_name: "< new_port_group_name >"
description: "< port_group_description >"
state: "present"
- name: Associate Port To Port Group By ID
register: port_group_info
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ port_group_info.port_group_detail.id }}"
port_type: "< fc_port | eth_port >"
port_id: "< port_id >"
operation: "associate"
state: "present"
- name: Associate Port To Port Group By Name
register: port_group_info
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< port_group_name >"
port_type: "< fc_port | eth_port >"
port_id: "< port_id >"
operation: "associate"
vstore_id: "< vstore_id >"
state: "present"
- name: Disassociate Port To Port Group By ID
register: port_group_info
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ port_group_info.port_group_detail.id }}"
port_type: "< fc_port | eth_port >"
port_id: "< port_id >"
operation: "disassociate"
state: "present"
- name: Disassociate Port To Port Group By Name
register: port_group_info
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< port_group_name >"
port_type: "< fc_port | eth_port >"
port_id: "< port_id >"
operation: "disassociate"
vstore_id: "< vstore_id >"
state: "present"
- name: Query Port Group By ID
register: port_group_info
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ port_group_info.port_group_detail.id }}"
filter:
- id
- name
- vstore_name
- vstore_id
- is_add_to_mapping_view
- port_num
state: "present"
- name: Query Port Group By Name
register: port_group_info
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< port_group_name >"
filter:
- id
- name
- vstore_name
- vstore_id
- is_add_to_mapping_view
- port_num
vstore_id: "< vstore_id >"
state: "present"
- name: Query Multi Port Group By Condition Param
register: all_port_group
huawei.enterprise.hw_enterprise_port_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
- is_add_to_mapping_view
- port_num
state: "present"
- name: Delete Port Group By Name
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< port_group_name >"
vstore_id: "< vstore_id >"
state: "absent"
- name: Delete Port Group By ID
huawei.enterprise.hw_enterprise_port_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ port_group_info.port_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 port group. Returned: When port group exists Sample: |
|
The system generated ID given to the port group. Returned: always |
|
Is port group add to mapping view or not. Returned: always |
|
Name of the port group. Returned: always |
|
Number of port in port group. Returned: always |
|
ID of storage vstore. Returned: always |
|
Name of storage vstore. Returned: always |
|
Task execute remark Returned: always Sample: |