dellemc.powerstore.hostgroup (3.2.0) — module

Manage host group 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 group on PowerStore storage system includes create host group with a set of hosts, add/remove hosts from host group, rename host group, and delete host group.

Deletion of a host group results in deletion of the containing hosts as well. Remove hosts from the host group first to retain them.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create host group with hosts
  dellemc.powerstore.hostgroup:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    hostgroup_name: "{{hostgroup_name}}"
    hosts:
      - host1
      - c17fc987-bf82-480c-af31-9307b89923c3
    state: 'present'
    host_state: 'present-in-group'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get host group details using ID
  dellemc.powerstore.hostgroup:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    hostgroup_id: "{{host group_id}}"
    state: 'present'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add hosts to host group
  dellemc.powerstore.hostgroup:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    hostgroup_name: "{{hostgroup_name}}"
    hosts:
      - host3
    host_state: 'present-in-group'
    state: 'present'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove hosts from host group
  dellemc.powerstore.hostgroup:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    hostgroup_name: "{{hostgroup_name}}"
    hosts:
      - host3
    host_state: 'absent-in-group'
    state: 'present'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify host group
  dellemc.powerstore.hostgroup:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    hostgroup_name: "{{hostgroup_name}}"
    host_connectivity: "Metro_Optimize_Both"
    new_name: "{{new_hostgroup_name}}"
    state: 'present'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete host group
  dellemc.powerstore.hostgroup:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    hostgroup_name: "{{hostgroup_name}}"
    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

hosts:
    description:
    - List of hosts to be added or removed from the host group.
    - Subordinate hosts in a host group can only be of one type, either FC or iSCSI.
    - Required when creating a host group.
    - To represent host, both name or ID can be used interchangeably. The module will
      detect both.
    elements: str
    type: list

state:
    choices:
    - absent
    - present
    description:
    - Define whether the host group should exist or not.
    - Value C(present) - indicates that the host group should exist on the system.
    - Value C(absent) - indicates that the host group should not exist on the system.
    - Deletion of a host group results in deletion of the containing hosts as well. Remove
      hosts from the host group first to retain them.
    required: true
    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 for host group renaming function. This value must contain 128 or fewer
      printable Unicode characters.
    type: str

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

host_state:
    choices:
    - present-in-group
    - absent-in-group
    description:
    - Define whether the hosts should be present or absent in host group.
    - Value C(present-in-group) - indicates that the hosts should exist on the host group.
    - Value C(absent-in-group) - indicates that the hosts should not exist on the host
      group.
    - Required when creating a host group with hosts or adding/removing hosts from existing
      host group.
    type: str

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

hostgroup_name:
    description:
    - The host group name. This value must contain 128 or fewer printable Unicode characters.
    - Creation of an empty host group is not allowed.
    - Required when creating a host group.
    - Use either I(hostgroup_id) or I(hostgroup_name) for modify and delete tasks.
    type: str

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

host_connectivity:
    choices:
    - Local_Only
    - Metro_Optimize_Both
    - Metro_Optimize_Local
    - Metro_Optimize_Remote
    description:
    - Connectivity type for host group.
    - If any of metro connectivity options specified, a metro host group must exists in
      both cluster provide connectivity to a metro volume from both cluster.
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'false'
  type: bool
hostgroup_details:
  contains:
    description:
      description: Description about the host group.
      type: str
    host_connectivity:
      description: Connectivity type for host group. It was added in 3.0.0.0.
      type: str
    hosts:
      contains:
        id:
          description: The ID of the host.
          type: str
        name:
          description: The name of the host.
          type: str
      description: The hosts details which are part of this host group.
      type: complex
    id:
      description: The system generated ID given to the host group.
      type: str
    name:
      description: Name of the host group.
      type: str
  description: Details of the host group.
  returned: When host group exists
  sample:
    description: null
    host_connectivity: Local_Only
    hosts:
    - id: 1ff90201-a576-482c-b7fe-0d4dc901da67
      name: sample_host
    id: 80fc96fa-227e-4796-84b8-c6452c5b8f64
    name: sample_host_group
  type: complex