huawei.enterprise.hw_enterprise_port module – Port 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.

Synopsis

  • Only supports query for fc port and eth 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

custom_vars

dictionary

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.

filter

list / elements=string

Parameter required for all query operations.

The response will include the storage parameters that match the indicate filter criteria.

Choices:

  • "{'fc_port': ['id', 'name', 'location', 'health_status', 'running_status', 'wwn', 'run_speed', 'max_speed', 'fc_run_mode', 'num_of_ini', 'protocol']}"

  • "{'eth_port': ['id', 'name', 'location', 'health_status', 'running_status', 'mac_address', 'ipv4_addr', 'ipv6_addr', 'speed', 'max_speed', 'logic_type', 'num_of_initiator']}"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

Initiator unique id, Mutually exclusive with “name”, Priority is higher than name.

Required for create operation.

logic_type

string

Eth port logic type.

Can be set when multi Query eth port.

Choices:

  • "host port/service port"

  • "management port"

  • "internal port"

  • "maintenance port"

  • "management/service port"

  • "maintenance/service port"

  • "front-end container port"

  • "back-end container port"

password

string / required

The password of the PowerStore host.

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

state

string / required

Define whether the Initiator should exist or not.

Choices:

  • "absent"

  • "present"

storage_port

integer

Port number for the Huawei Enterprise array.

If not passed, it will take 8088 as default.

Default: 8088

type

string / required

Which type port you want to operate.

Choices:

  • "eth_port"

  • "fc_port"

use_log

boolean

Whether to write plugin log to local filesystem.

Choices:

  • false ← (default)

  • true

username

string / required

The username of the PowerStore host.

valid_certs

string

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.

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: Query eth port by id
      register: eth_port_info
      huawei.enterprise.hw_enterprise_port:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "< eth_port_id >"
        type: "eth_port"
        filter:
          - id
          - name
          - location
          - health_status
          - running_status
          - mac_address
          - ipv4_addr
          - ipv6_addr
          - speed
          - max_speed
          - logic_type
          - num_of_initiator
        state: "present"

    - name: Query multi eth port by condition param
      register: all_eth_port
      huawei.enterprise.hw_enterprise_port:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        type: "eth_port"
        logic_type: " < logic_type > "
        filter:
          - id
          - name
          - location
          - health_status
          - running_status
          - mac_address
          - ipv4_addr
          - ipv6_addr
          - speed
          - max_speed
          - logic_type
          - num_of_initiator
        state: "present"

    - name: Query fc port by id
      register: fc_port_info
      huawei.enterprise.hw_enterprise_port:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ fc_port_id }}"
        type: "fc_port"
        filter:
          - id
          - name
          - location
          - health_status
          - running_status
          - wwn
          - run_speed
          - max_speed
          - fc_run_mode
          - num_of_ini
          - protocol
        state: "present"

    - name: query multi fc port
      register: all_fc_port
      huawei.enterprise.hw_enterprise_port:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        type: "fc_port"
        filter:
          - id
          - name
          - location
          - health_status
          - running_status
          - wwn
          - run_speed
          - max_speed
          - fc_run_mode
          - num_of_ini
          - protocol
        state: "present"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

actions

list / elements=string

playbook action lists

Returned: always

Sample: ["query"]

changed

boolean

Whether or not the resource has changed.

Returned: always

Sample: false

port_detail

complex

Details of the port.

Returned: When port exists

Sample: {"fc_run_mode": "Fabric", "health_status": "Health", "id": "1", "location": "CTE0.IOM.H3.P0", "max_speed": "10 Mbit/s", "name": "P0", "num_of_initiator": 3, "protocol": "FC-SCSI", "run_speed": "8 Mbit/s", "running_status": "Online", "type": "fc_port", "wwn": "280018cf24f6b2e0"}

fc_run_mode

string

Operating mode of fc port.

Returned: success

health_status

string

Health status of the port.

Returned: success

id

string

The system generated ID given to the port.

Returned: success

ipv4_addr

string

IPv4 address of the port.

Returned: success

ipv6_addr

string

IPv6 address of the port.

Returned: success

location

string

Location of the port.

Returned: success

logic_type

string

Type of multipath.

Returned: success

mac_address

string

MAC address of eth port.

Returned: success

max_speed

string

Max working rate.

Returned: success

name

string

Name of the port.

Returned: success

num_of_initiator

integer

Initiators number of port.

Returned: success

protocol

string

Protocol type of the fc port.

Returned: success

run_speed

string

Operating speed.

Returned: success

running_status

string

Running status of the port.

Returned: success

speed

string

Port working rate.

Returned: success

remark

string

task execute remark

Returned: always

Sample: "FC port PO query successfully."

Authors

  • Huawei eSDK Ansible Team