dellemc / dellemc.powermax / 3.0.0 / module / hostgroup Manage a host group (cascaded initiator group) on a PowerMax/VMAX storage system | "added in version" 1.0.0 of dellemc.powermax" Authors: Vasudevu Lakhinana (@unknown) <ansible.team@dell.com>, Manisha Agrawal (@agrawm3) <ansible.team@dell.com>dellemc.powermax.hostgroup (3.0.0) — module
Install with ansible-galaxy collection install dellemc.powermax:==3.0.0
collections: - name: dellemc.powermax version: 3.0.0
Managing a host group on a PowerMax storage system includes creating a host group with a set of hosts, adding or removing hosts to or from a host group, renaming a host group, modifying host flags of a host group, and deleting a host group.
- name: Create host group with 'default' host_type dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_HG_1" host_type: "default" hosts: - ansible_test_1 host_state: 'present-in-group' state: 'present'
- name: Create host group with 'hpux' host_type dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_HG_2" host_type: "hpux" hosts: - ansible_test_2 host_state: 'present-in-group' state: 'present'
- name: Create host group with host_flags dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_HG_3" hosts: - ansible_test_3 state: 'present' host_state: 'present-in-group' host_flags: spc2_protocol_version: true consistent_lun: true volume_set_addressing: 'unset' disable_q_reset_on_ua: false openvms: 'unset'
- name: Get host group details dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_HG_1" state: 'present'
- name: Adding host to host group dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_HG_1" hosts: - Ansible_Testing_host2 state: 'present' host_state: 'present-in-group'
- name: Removing host from host group dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_HG_1" hosts: - Ansible_Testing_host2 state: 'present' host_state: 'absent-in-group'
- name: Modify host group using host_type dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_HG_1" host_type: "hpux" state: 'present'
- name: Modify host group using host_flags dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_HG_1" host_flags: spc2_protocol_version: unset disable_q_reset_on_ua: false openvms: false avoid_reset_broadcast: true state: 'present'
- name: Rename host group dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_HG_1" new_name: "ansible_test_hostgroup_1" state: 'present'
- name: Delete host group dellemc.powermax.hostgroup: unispherehost: "{{unispherehost}}" universion: "{{universion}}" verifycert: "{{verifycert}}" user: "{{user}}" password: "{{password}}" serial_no: "{{serial_no}}" hostgroup_name: "ansible_test_hostgroup_1" state: 'absent'
user: description: - The username of the Unisphere host. required: true type: str hosts: description: - List of host names to be added to the host group or removed from the host group. - Creation of an empty host group is allowed. elements: str type: list state: choices: - absent - present description: - Define whether the host group should be present or absent on the system. - present - indicates that the host group should be present on the system. - absent - indicates that the host group should be absent on the system. 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 new_name: description: - The new name for the host group for the renaming function. No Special Character support except for _. Case sensitive for REST Calls. type: str password: description: - The password of the Unisphere host. required: true type: str host_type: choices: - default - hpux description: - Describing the OS type (default or hpux). required: false type: str serial_no: description: - The serial number of the PowerMax/VMAX array. It is a required parameter for all array-specific operations except for getting a list of arrays in the Gatherfacts module. required: true type: str host_flags: description: - input as an yaml dictionary. - List of all host_flags - - 1. volume_set_addressing. - 2. disable_q_reset_on_ua. - 3. environ_set. - 4. avoid_reset_broadcast. - 5. openvms. - 6. scsi_3. - 7. spc2_protocol_version. - 8. scsi_support1. - 9. consistent_lun. - Possible values are true, false, unset(default state). required: false type: dict host_state: choices: - present-in-group - absent-in-group description: - Define whether the host should be present or absent in the host group. - present-in-group - indicates that the hosts should exist in the host group. - absent-in-group - indicates that the hosts should not exist in the host group. type: str universion: choices: - 91 - 92 - 100 - 101 description: - Unisphere version, currently '91', '92', '100' and '101' versions are supported. required: false type: int verifycert: description: - Specifies system whether to validate SSL certificate or not, Values can be True or False or a custom file path for SSL certificate with .pem extension or .cer with base 64 encoding. required: true type: str unispherehost: description: - IP or FQDN of the Unisphere host required: true type: str hostgroup_name: description: - The name of the host group. No Special Character support except for _. Case sensitive for REST Calls. required: true type: str
changed: description: Whether or not the resource has changed. returned: always type: bool hostgroup_details: contains: consistent_lun: description: Flag for consistent LUN in the host group. type: bool disabled_flags: description: List of any disabled port flags overridden by the initiator. type: list enabled_flags: description: List of any enabled port flags overridden by the initiator. type: list host: contains: hostId: description: Unique identifier for the host. type: str initiator: description: List of initiators present in the host. type: list description: List of hosts present in the host group. type: list hostGroupId: description: Host group ID. type: str maskingview: description: Masking view in which host group is present. type: list num_of_hosts: description: Number of hosts in the host group. type: int num_of_initiators: description: Number of initiators in the host group. type: int num_of_masking_views: description: Number of masking views associated with the host group. type: int port_flags_override: description: Whether any of the initiator's port flags are overridden. type: bool type: description: Type of initiator of the hosts of the host group. type: str description: Details of the host group. returned: When host group exist. type: complex