huawei.enterprise.hw_enterprise_initiator module – Initiator(iSCSI AND FC) 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_initiator.

Synopsis

  • Supports the provisioning operations on a initiator such as create, modify, delete and get the details of a initiator.

  • Supports query all initiators on storage.

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.

failover_mode

string

Initiator switchover mode.

Needs to be delivered only when third-party multipathing software is enabled.

v5 Storage does not support early-version ALUA

Choices:

  • "early-version ALUA"

  • "common ALUA"

  • "ALUA not used"

  • "special ALUA"

filter

list / elements=string

Parameter required for all query operations.

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

Choices:

  • "id"

  • "name"

  • "vstore_name"

  • "vstore_id"

  • "parent_id"

  • "parent_name"

  • "running_status"

  • "capacity"

  • "allocated_capacity"

  • "wwn"

  • "unit"

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.

multipath_type

string

Multipathing type.

It defaults to "default" if not specified.

Choices:

  • "default"

  • "third-party"

name

string

Initiator alias name. Mutually exclusive with id.

new_name

string

Initiator new alias name. Configure when need modify initiator name.

operation

string / required

Associate or disassociate operate for host.

Choices:

  • "associate"

  • "disassociate"

parent_id

string

Host ID, Required for create operation or associate initiator to host.

password

string / required

The password of the PowerStore host.

path_type

string

Initiator path type.

Needs to be delivered only when third-party multipathing software is enabled.

Choices:

  • "preferred path"

  • "non-preferred path"

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

special_mode_type

string

Special mode type of the initiator.

Required when failover_mode is special ALUA

Needs to be delivered only when third-party multipathing software is enabled.

Choices:

  • "mode 0"

  • "mode 1"

  • "mode 2"

  • "mode 3"

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 initiator you want to operate.

Choices:

  • "iSCSI"

  • "FC"

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.

vstore_id

string

id of storage vstore.

It defaults to 0:SystemVstore if not specified.

Notes

Note

  • The check_mode is not supported.

  • Initiator must be disassociate from host when need delete.

  • FC initiator name is a hexadecimal value that contains 16 characters comprised of uppercase letters A to F, lowercase letters a to f, or digits 0 to 9, but cannot all be 0, F, or f.

  • The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.

Examples

---
  tasks:
    - name: Create Initiator
      register: ini_info
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "< iqn-id >"
        type: "{{ ini_type }}"
        name: "< ini_name >"
        multipath_type: "< default | third-party >"
        path_type: "< preferred path | non-preferred path >"
        failover_mode: "< early-version ALUA >"
        special_mode_type: "< mode 0 >"
        parent_id: "< host_id >"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Modify Initiator Common Param By ID
      register: ini_info
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "< iqn-id >"
        type: "{{ ini_type }}"
        new_name: "< ini_new_name >"
        multipath_type: "< default | third-party >"
        path_type: "< preferred path | non-preferred path >"
        failover_mode: "< early-version ALUA >"
        special_mode_type: "< mode 0 >"
        state: "present"

    - name: Modify Initiator Common Param By Name
      register: ini_info
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< ini_name >"
        type: "{{ ini_type }}"
        new_name: "< ini_new_name >"
        multipath_type: "< default | third-party >"
        path_type: "< preferred path | non-preferred path >"
        failover_mode: "< early-version ALUA >"
        special_mode_type: "< mode 0 >"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Associate Initiator To Host By ID
      register: ini_info
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "< iqn-id >"
        type: "{{ ini_type }}"
        operation: "associate"
        parent_id: "< host_id >"
        state: "present"

    - name: Associate Initiator To Host By Name
      register: ini_info
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< initiator_name >"
        type: "{{ ini_type }}"
        operation: "associate"
        parent_id: "< host_id >"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Disassociate Initiator To Host By ID
      register: ini_info
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "< iqn-id >"
        type: "{{ ini_type }}"
        operation: "disassociate"
        state: "present"

    - name: Disassociate Initiator To Host By Name
      register: ini_info
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< initiator_name >"
        type: "{{ ini_type }}"
        operation: "disassociate"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Query Initiator Detail By ID
      register: ini_info
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "< iqn-id >"
        type: "{{ ini_type }}"
        filter:
          - id
          - name
          - type
          - vstore_name
          - vstore_id
          - parent_id
          - parent_name
          - host_ip
          - running_status
          - multipath_type
          - path_type
          - special_mode_type
          - failover_mode
        state: "present"

    - name: Query Multi Initiator
      register: all_initiator
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        type: "{{ ini_type }}"
        vstore_id: "< vstore_id >"
        filter:
          - id
          - name
          - type
          - vstore_name
          - vstore_id
          - parent_id
          - parent_name
          - host_ip
          - running_status
          - multipath_type
          - path_type
          - special_mode_type
          - failover_mode
        state: "present"

    - name: Delete Initiator By Name
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< initiator_name >"
        type: "{{ ini_type }}"
        vstore_id: "< vstore_id >"
        state: "absent"

    - name: Delete Initiator By ID
      huawei.enterprise.hw_enterprise_initiator:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "< iqn-xx >"
        type: "{{ ini_type }}"
        state: "absent"

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: ["create"]

changed

boolean

Whether or not the resource has changed.

Returned: always

Sample: false

ini_detail

complex

Details of the initiator.

Returned: When initiator exists else return {}

Sample: {"failover_mode": "special ALUA", "host_ip": "127.0.0.1", "id": "iqn-xx", "is_free": "true", "multipath_type": "third-party", "name": "initiator_01", "parent_id": "1", "parent_name": "host_01", "path_type": "non-preferred path", "running_status": "online", "special_mode_type": "mode 0", "type": "iSCSI", "vstore_id": "0", "vstore_name": "System_vStore"}

failover_mode

string

Switchover mode of initiator.

Returned: success

host_ip

string

IP address of initiator associated host.

Returned: success

id

string

The system generated ID given to the Initiator.

Returned: success

is_free

string

Is initiator associate to host.

Returned: success

multipath_type

string

Type of multipath.

Returned: success

name

string

Name of the Initiator.

Returned: success

parent_id

string

ID of initiator associated host.

Returned: success

parent_name

string

Name of initiator associated host.

Returned: success

path_type

string

Path type of initiator.

Returned: success

running_status

string

running status of the Initiator.

Returned: success

special_mode_type

string

Special mode type of an initiator.

Returned: success

type

string

Type of the Initiator, FC or iSCSI.

Returned: success

vstore_id

string

ID of storage vstore.

Returned: success

vstore_name

string

Name of storage vstore.

Returned: success

remark

string

task execute remark

Returned: always

Sample: "Initiator iqn-xx create successfully"

Authors

  • Huawei eSDK Ansible Team