dellemc.powerstore.host (3.2.0) — module

Manage host on PowerStore storage system

| "added in version" 1.0.0 of dellemc.powerstore"

Authors: Manisha Agrawal (@agrawm3) <ansible.team@dell.com>

Install collection

Install with ansible-galaxy collection install dellemc.powerstore:==3.2.0


Add to requirements.yml

  collections:
    - name: dellemc.powerstore
      version: 3.2.0

Description

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


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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'

Inputs

    
port:
    description:
    - Port number for the PowerStore array.
    - If not passed, it will take 443 as default.
    type: int

user:
    description:
    - The username of the PowerStore host.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    description:
    - Define whether the host should exist or not.
    - Value C(present) - indicates that the host should exist in system.
    - Value C(absent) - indicates that the host should not exist in system.
    required: true
    type: str

host_id:
    description:
    - The 36 character long host id automatically generated when a host is created.
    - Use either I(host_id) or I(host_name) for modify and delete tasks.
    - The I(host_id) cannot be used while creating host, as it is generated by the array
      after creation of host.
    type: str

os_type:
    choices:
    - Windows
    - Linux
    - ESXi
    - AIX
    - HP-UX
    - Solaris
    description:
    - Operating system of the host.
    - Required when creating a host.
    - OS type cannot be modified for a given host.
    type: str

timeout:
    default: 120
    description:
    - Time after which the connection will get terminated.
    - It is to be mentioned in seconds.
    type: int

array_ip:
    description:
    - IP or FQDN of the PowerStore management system.
    required: true
    type: str

new_name:
    description:
    - 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.
    type: str

password:
    description:
    - The password of the PowerStore host.
    required: true
    type: str

host_name:
    description:
    - 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 I(host_id) or I(host_name) for modify and delete tasks.
    type: str

initiators:
    description:
    - 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 I(detailed_initiators).
    elements: str
    type: list

validate_certs:
    aliases:
    - verifycert
    default: true
    description:
    - Boolean variable to specify whether to validate SSL certificate or not.
    - C(true) - indicates that the SSL certificate should be verified. Set the environment
      variable REQUESTS_CA_BUNDLE to the path of the SSL certificate.
    - C(false) - indicates that the SSL certificate should not be verified.
    type: bool

initiator_state:
    choices:
    - present-in-host
    - absent-in-host
    description:
    - Define whether the initiators should be present or absent in host.
    - Value C(present-in-host) - indicates that the initiators should exist on host.
    - Value C(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.
    type: str

host_connectivity:
    choices:
    - Local_Only
    - Metro_Optimize_Both
    - Metro_Optimize_Local
    - Metro_Optimize_Remote
    description:
    - 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.
    type: str

detailed_initiators:
    description:
    - Initiator properties.
    - It is mutually exclusive with I(initiators).
    elements: dict
    suboptions:
      chap_mutual_password:
        description:
        - 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.
        type: str
      chap_mutual_username:
        description:
        - 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.
        type: str
      chap_single_password:
        description:
        - 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.
        type: str
      chap_single_username:
        description:
        - 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.
        type: str
      port_name:
        description:
        - Name of port type.
        - The I(port_name) is mandatory key.
        required: true
        type: str
      port_type:
        choices:
        - iSCSI
        - FC
        - NVMe
        description:
        - Protocol type of the host initiator.
        type: str
    type: list

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'false'
  type: bool
host_details:
  contains:
    description:
      description: Description about the host.
      type: str
    host_connectivity:
      description: Connectivity type for host. It was added in 3.0.0.0.
      type: str
    host_group_id:
      description: The host group ID of host.
      type: str
    host_initiators:
      contains:
        active_sessions:
          description: List of active login sessions between an initiator and a target
            port.
          type: list
        chap_mutual_username:
          description: Username for mutual CHAP authentication.
          type: str
        chap_single_username:
          description: Username for single CHAP authentication.
          type: str
        port_name:
          description: Name of the port.
          type: str
        port_type:
          description: The type of the port.
          type: str
      description: The initiator details of this host.
      type: complex
    id:
      description: The system generated ID given to the host.
      type: str
    mapped_hosts:
      contains:
        host_group:
          contains:
            id:
              description: ID of the host group.
              type: str
            name:
              description: Name of the host group.
              type: str
          description: Details about a host group to which host is mapped.
          type: dict
        id:
          description: Unique identifier of a mapping between a host and a volume.
          type: str
        logical_unit_number:
          description: Logical unit number for the host volume access.
          type: int
        volume:
          contains:
            id:
              description: ID of the volume.
              type: str
            name:
              description: Name of the volume.
              type: str
          description: Details about a volume which has mapping with the host.
          type: dict
      description: This is the inverse of the resource type I(host_volume_mapping)
        association.
      type: complex
    name:
      description: Name of the host.
      type: str
    os_type:
      description: The os type of the host.
      type: str
    type:
      description: Type of the host.
      type: str
  description: Details of the host.
  returned: When host exists
  sample:
    description: null
    host_connectivity: Local_Only
    host_group_id: null
    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
    os_type_l10n: ESXi
  type: complex