Skip to content

Latest commit

 

History

History
426 lines (253 loc) · 10.8 KB

host.rst

File metadata and controls

426 lines (253 loc) · 10.8 KB

host -- Manage host on PowerStore storage system

Managing host on PowerStore storage system includes create host with a set of initiators, add/remove initiators from host, rename host and delete host.

The below requirements are needed on the host that executes this module.

  • A Dell PowerStore storage system version 3.0.0.0 or later.
  • Ansible-core 2.14 or later.
  • PyPowerStore 3.2.0.
  • Python 3.9, 3.10 or 3.11.
host_name (optional, str, None)

The host name. This value must contain 128 or fewer printable Unicode characters.

Creation of an empty host is not allowed.

Required when creating a host.

Use either host_id or host_name for modify and delete tasks.

host_id (optional, str, None)

The 36 character long host id automatically generated when a host is created.

Use either host_id or host_name for modify and delete tasks.

The host_id cannot be used while creating host, as it is generated by the array after creation of host.

os_type (optional, str, None)

Operating system of the host.

Required when creating a host.

OS type cannot be modified for a given host.

initiators (optional, list, None)

List of Initiator WWN or IQN or NQN to be added or removed from the host.

Subordinate initiators in a host can only be of one type, either FC or iSCSI.

Required when creating a host.

It is mutually exclusive with detailed_initiators.

detailed_initiators (optional, list, None)

Initiator properties.

It is mutually exclusive with initiators.

port_name (True, str, None)

Name of port type.

The port_name is mandatory key.

port_type (optional, str, None)
Protocol type of the host initiator.
chap_single_username (optional, str, None)

Username for single CHAP authentication.

CHAP username is required when the cluster CHAP mode is mutual authentication.

Minimum length is 1 and maximum length is 64 characters.

chap_single_password (optional, str, None)

Password for single CHAP authentication.

CHAP password is required when the cluster CHAP mode is mutual authentication.

Minimum length is 12 and maximum length is 64 characters.

chap_mutual_username (optional, str, None)

Username for mutual CHAP authentication.

CHAP username is required when the cluster CHAP mode is mutual authentication.

Minimum length is 1 and maximum length is 64 characters.

chap_mutual_password (optional, str, None)

Password for mutual CHAP authentication.

CHAP password is required when the cluster CHAP mode is mutual authentication.

Minimum length is 12 and maximum length is 64 characters.

state (True, str, None)

Define whether the host should exist or not.

Value present - indicates that the host should exist in system.

Value absent - indicates that the host should not exist in system.

initiator_state (optional, str, None)

Define whether the initiators should be present or absent in host.

Value present-in-host - indicates that the initiators should exist on host.

Value absent-in-host - indicates that the initiators should not exist on host.

Required when creating a host with initiators or adding/removing initiators to/from existing host.

new_name (optional, str, None)

The new name of host for renaming function. This value must contain 128 or fewer printable Unicode characters.

Cannot be specified when creating a host.

host_connectivity (optional, str, None)

Connectivity type for host.

If any of metro connectivity options specified, a metro host must exists in both cluster provide connectivity to a metro volume from both cluster.

array_ip (True, str, None)
IP or FQDN of the PowerStore management system.
validate_certs (optional, bool, True)

Boolean variable to specify whether to validate SSL certificate or not.

true - indicates that the SSL certificate should be verified. Set the environment variable REQUESTS_CA_BUNDLE to the path of the SSL certificate.

false - indicates that the SSL certificate should not be verified.

user (True, str, None)
The username of the PowerStore host.
password (True, str, None)
The password of the PowerStore host.
timeout (optional, int, 120)

Time after which the connection will get terminated.

It is to be mentioned in seconds.

port (optional, int, None)

Port number for the PowerStore array.

If not passed, it will take 443 as default.

Note

  • Only completely and correctly configured iSCSI initiators can be associated with a host.
  • The parameters initiators and detailed_initiators are mutually exclusive.
  • For mutual CHAP authentication, single CHAP credentials are mandatory.
  • Support of NVMe type of initiators is for PowerStore 2.0 and beyond.
  • The host_connectivity is supported only in PowerStore 3.0.0.0 and above.
  • The check_mode is not supported.
  • The modules present in this collection named as 'dellemc.powerstore' are built to support the Dell PowerStore storage platform.
- name: Create host with FC initiator
  dellemc.powerstore.host:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    host_name: "ansible-test-host-1"
    os_type: 'Windows'
    host_connectivity: "Metro_Optimize_Local"
    initiators:
      - 21:00:00:24:ff:31:e9:fc
    state: 'present'
    initiator_state: 'present-in-host'

- name: Create host with iSCSI initiator and its details
  dellemc.powerstore.host:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    host_name: "ansible-test-host-2"
    os_type: 'Windows'
    detailed_initiators:
      - port_name: 'iqn.1998-01.com.vmware:lgc198248-5b06fb37'
        port_type: 'iSCSI'
        chap_single_username: 'chapuserSingle'
        chap_single_password: 'chappasswd12345'
      - port_name: 'iqn.1998-01.com.vmware:imn198248-5b06fb37'
        port_type: 'iSCSI'
        chap_mutual_username: 'chapuserMutual'
        chap_mutual_password: 'chappasswd12345'
    state: 'present'
    initiator_state: 'present-in-host'

- name: Get host details by id
  dellemc.powerstore.host:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    host_id: "5c1e869b-ed8a-4845-abae-b102bc249d41"
    state: 'present'

- name: Add initiators to host by name
  dellemc.powerstore.host:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    host_name: "ansible-test-host-1"
    initiators:
      - 21:00:00:24:ff:31:e9:ee
    initiator_state: 'present-in-host'
    state: 'present'

- name: Add initiators to host by id
  dellemc.powerstore.host:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    host_id: "5c1e869b-ed8a-4845-abae-b102bc249d41"
    detailed_initiators:
      - port_name: 'iqn.1998-01.com.vmware:imn198248-5b06fb37'
        port_type: 'iSCSI'
        chap_mutual_username: 'chapuserMutual'
        chap_mutual_password: 'chappasswd12345'
    initiator_state: 'present-in-host'
    state: 'present'

- name: Remove initiators from by id
  dellemc.powerstore.host:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    host_id: "8c1e869b-fe8a-4845-hiae-h802bc249d41"
    initiators:
      - 21:00:00:24:ff:31:e9:ee
    initiator_state: 'absent-in-host'
    state: 'present'

- name: Modify host by name
  dellemc.powerstore.host:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    host_name: "ansible-test-host-1"
    new_name: "ansible-test-host-1-new"
    host_connectivity: "Metro_Optimize_Remote"
    state: 'present'

- name: Delete host
  dellemc.powerstore.host:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    host_name: "ansible-test-host-1-new"
    state: 'absent'
changed (always, bool, false)
Whether or not the resource has changed.
host_details (When host exists, complex, {'description': None, 'host_group_id': None, 'host_initiators': [{'active_sessions': [], 'chap_mutual_username': '', 'chap_single_username': '', 'port_name': 'iqn.1998-01.com.vmware:losat106-0eab2afe', 'port_type': 'iSCSI'}], 'id': '4d56e60-fc10-4f51-a698-84a664562f0d', 'mapped_hosts': [], 'name': 'sample_host', 'os_type': 'ESXi', 'host_connectivity': 'Local_Only', 'os_type_l10n': 'ESXi'})

Details of the host.

id (, str, )
The system generated ID given to the host.
name (, str, )
Name of the host.
description (, str, )
Description about the host.
host_group_id (, str, )
The host group ID of host.
os_type (, str, )
The os type of the host.
host_initiators (, complex, )

The initiator details of this host.

port_name (, str, )
Name of the port.
port_type (, str, )
The type of the port.
chap_single_username (, str, )
Username for single CHAP authentication.
chap_mutual_username (, str, )
Username for mutual CHAP authentication.
active_sessions (, list, )
List of active login sessions between an initiator and a target port.
type (, str, )
Type of the host.
mapped_hosts (, complex, )

This is the inverse of the resource type host_volume_mapping association.

id (, str, )
Unique identifier of a mapping between a host and a volume.
logical_unit_number (, int, )
Logical unit number for the host volume access.
host_group (, dict, )

Details about a host group to which host is mapped.

id (, str, )
ID of the host group.
name (, str, )
Name of the host group.
volume (, dict, )

Details about a volume which has mapping with the host.

id (, str, )
ID of the volume.
name (, str, )
Name of the volume.
host_connectivity (, str, )
Connectivity type for host. It was added in 3.0.0.0.

Authors