hitachivantara.vspone_block.vsp.hv_hg_bulk module – Manages host groups in bulk on VSP block storage system with parallel processing.
Note
This module is part of the hitachivantara.vspone_block collection (version 4.8.1).
You might already have this collection installed if you are using the ansible package. 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 hitachivantara.vspone_block. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: hitachivantara.vspone_block.vsp.hv_hg_bulk.
New in hitachivantara.vspone_block 4.7.0
Synopsis
- This module provides bulk host group management operations with multithreading support for parallel processing across multiple ports.
- Operations on multiple ports are executed concurrently using a thread pool (up to 10 concurrent threads) for improved performance.
- Supported operations include
-
- create host group on multiple ports in parallel.
-
- delete host group from multiple ports in parallel.
-
- add logical unit to host group across multiple ports.
-
- remove logical unit from host group across multiple ports.
-
- add host WWN to host group across multiple ports.
-
- remove host WWN from host group across multiple ports.
-
- set host mode across multiple ports.
-
- add host mode option to host group across multiple ports.
-
- remove host mode option from host group across multiple ports.
- Thread-safe result aggregation ensures accurate reporting of changes, comments, and errors from all parallel operations. https://github.com/hitachi-vantara/vspone-block-ansible/blob/main/playbooks/vsp_direct/hostgroup_bulk.yml
Requirements
The below requirements are needed on the host that executes this module.
- python >= 3.9
Parameters
Parameter | Comments |
|---|---|
connection_info dictionary / required | Information required to establish a connection to the storage system. |
|
address string / required |
IP address or hostname of the storage system. |
|
api_token string |
Token used to operate on locked resources. |
|
connection_type string |
Type of connection to the storage system. Choices:
|
|
password string |
Password for authentication. This is a required field. |
|
username string |
Username for authentication. This is a required field. |
spec dictionary | Specification for hostgroup operation. |
|
asymmetric_access_priority string |
Asymmetric access priority level for ALUA host group. Required for the Asymmetric access priority level for ALUA host group task. Choices:
|
|
host_group_number integer |
The host group number. Required for the Asymmetric access priority level for ALUA host group /Release the host reservation status by specifying a host group /Release the host reservation status by specifying the LU path tasks. |
|
host_mode string |
Host mode of host group. Optional for the Create a host group task. Required for the Update host mode and host mode options task. Choices:
|
|
host_mode_options list / elements=integer |
List of host group host mode option numbers. Optional for the Create a host group task. Required for the Update host mode and host mode options task. 0 # RESERVED 2 # VERITAS_DB_EDITION_ADV_CLUSTER 6 # TPRLO 7 # AUTO_LUN_RECOGNITION 12 # NO_DISPLAY_FOR_GHOST_LUN 13 # SIM_REPORT_AT_LINK_FAILURE 14 # HP_TRUECLUSTER_WITH_TRUECOPY 15 # RAID_HACMP 22 # VERITAS_CLUSTER_SERVER 23 # REC_COMMAND_SUPPORT 25 # SUPPORT_SPC_3_PERSISTENT_RESERVATION 33 # SET_REPORT_DEVICE_ID_ENABLE 39 # CHANGE_NEXUS_SPECIFIED_IN_SCSI_TARGET_RESET 40 # VVOL_EXPANSION 41 # PRIORITIZED_DEVICE_RECOGNITION 42 # PREVENT_OHUB_PCI_RETRY 43 # QUEUE_FULL_RESPONSE 48 # HAM_SVOL_READ 49 # BB_CREDIT_SETUP_1 50 # BB_CREDIT_SETUP_2 51 # ROUND_TRIP_SETUP 52 # HAM_AND_CLUSTER_SW_FOR_SCSI_2 54 # EXTENDED_COPY 57 # HAM_RESPONSE_CHANGE 60 # LUN0_CHANGE_GUARD 61 # EXPANDED_PERSISTENT_RESERVE_KEY 63 # VSTORAGE_APIS_ON_T10_STANDARDS 65 # ROUND_TRIP_EXTENDED_SETUP 67 # CHANGE_OF_ED_TOV_VALUE 68 # PAGE_RECLAMATION_LINUX 69 # ONLINE_LUSE_EXPANSION 71 # CHANGE_UNIT_ATTENTION_FOR_BLOCKED_POOL_VOLS 72 # AIX_GPFS 73 # WS2012 78 # NON_PREFERRED_PATH 91 # DISABLE_IO_WAIT_FOR_OPEN_STACK 95 # CHANGE_SCSI_LU_RESET_NEXUS_VSP_HUS_VM 96 # CHANGE_SCSI_LU_RESET_NEXUS 97 # PROPRIETARY_ANCHOR_COMMAND_SUPPORT 100 # HITACHI_HBA_EMULATION_CONNECTION_OPTION 102 # GAD_STANDARD_INQURY_EXPANSION_HCS 105 # TASK_SET_FULL_RESPONSE_FOR_IO_OVERLOAD 110 # ODX Support for WS2012 113 # iSCSI CHAP Authentication Log 114 # Auto Asynchronous Reclamation on ESXi 6.5+ 122 # TASK_SET_FULL_RESPONSE_AFTER_QOS_UPPER_LIMIT 124 # GUARANTEED_RESPONSE_DURING_CONTROLLER_FAILURE 131 # WCE_BIT_OFF_MODE |
|
lun_paths list / elements=dictionary |
List of LUN path entries to be modified. Each entry describes an LDEV mapping and path metadata. |
|
ldev string / required |
Logical device ID. |
|
lun string |
LUN number. |
|
name string |
Name of the host group. If not given, it will create the name with prefix “smrha-” and add 10 digit random number at the end, for example “smrha-0806262996”. |
|
port_ids aliases: ports list / elements=string |
List of port IDs associated with the host group. |
|
should_delete_all_volumes boolean |
If the value is true, destroy the logical devices that are no longer attached to any host group or iSCSI target. Choices:
|
|
wwns list / elements=dictionary |
List of host WWN to add or remove. Required for the Create a host group/Add WWNs to a host group /Remove WWNs from a host group tasks. |
|
nickname aliases: nick_name string |
Nickname of the host. Optional for the Create a host group/Add WWNs to a host group /Remove WWNs from a host group tasks. Required for the Change or unset nick name of a WWN task. |
|
wwn string / required |
WWN of the host. Required for the Create a host group/Add WWNs to a host group /Remove WWNs from a host group/Change or unset nick name of a WWN tasks. |
state string | Set state to Set state to Choices:
|
storage_system_info dictionary | Information about the storage system. This field is an optional field. |
|
serial string |
The serial number of the storage system. |
Attributes
Attribute | Support | Description |
|---|---|---|
check_mode | Support: none | Determines if the module should run in check mode. |
Examples
- name: Create host group on multiple ports in parallel
hitachivantara.vspone_block.vsp.hv_hg_bulk:
state: present
connection_info:
address: storage1.company.com
username: "dummy_user"
password: "dummy_password"
spec:
name: 'bulk_hg_test'
port_ids: ['CL1-A', 'CL1-B', 'CL2-A', 'CL2-B']
host_mode: 'VMWARE_EXTENSION'
host_mode_options: [40, 63]
wwns:
- wwn: '100000109B583B2D'
nickname: 'server1_hba1'
- wwn: '100000109B583B2C'
nickname: 'server1_hba2'
lun_paths:
- ldev: '1024'
lun: '0'
- ldev: '1025'
lun: '1'
- name: Delete host group from multiple ports in parallel
hitachivantara.vspone_block.vsp.hv_hg_bulk:
state: absent
connection_info:
address: storage1.company.com
username: "dummy_user"
password: "dummy_password"
spec:
name: 'bulk_hg_test'
port_ids: ['CL1-A', 'CL1-B', 'CL2-A', 'CL2-B']
should_delete_all_volumes: true
- name: Add WWNs to host groups across multiple ports in parallel
hitachivantara.vspone_block.vsp.hv_hg_bulk:
state: added
connection_info:
address: storage1.company.com
username: "dummy_user"
password: "dummy_password"
spec:
name: 'existing_hg'
port_ids: ['CL1-A', 'CL1-B', 'CL2-A']
wwns:
- wwn: '200000109B3C0FD3'
nickname: 'new_server_hba1'
- wwn: '200000109B3C0FD4'
nickname: 'new_server_hba2'
- name: Remove WWNs from host groups across multiple ports in parallel
hitachivantara.vspone_block.vsp.hv_hg_bulk:
state: removed
connection_info:
address: storage1.company.com
username: "dummy_user"
password: "dummy_password"
spec:
name: 'existing_hg'
port_ids: ['CL1-A', 'CL1-B', 'CL2-A']
wwns:
- wwn: '200000109B3C0FD3'
- wwn: '200000109B3C0FD4'
- name: Update host mode on multiple ports in parallel
hitachivantara.vspone_block.vsp.hv_hg_bulk:
state: updated
connection_info:
address: storage1.company.com
username: "dummy_user"
password: "dummy_password"
spec:
name: 'existing_hg'
port_ids: ['CL1-A', 'CL1-B', 'CL2-A', 'CL2-B']
host_mode: 'LINUX'
host_mode_options: [54, 63, 68]
- name: Add LUN paths to host groups across multiple ports in parallel
hitachivantara.vspone_block.vsp.hv_hg_bulk:
state: added
connection_info:
address: storage1.company.com
username: "dummy_user"
password: "dummy_password"
spec:
name: 'existing_hg'
port_ids: ['CL1-A', 'CL1-B']
lun_paths:
- ldev: '2048'
lun: '10'
- ldev: '2049'
lun: '11'
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
host_groups list / elements=dictionary | Detailed information about the host group on the storage system. Returned: always |
|
host_group_id integer |
ID of the host group (internal identifier used by the storage system). Returned: success Sample: |
|
host_group_name string |
Human readable name of the host group. Returned: success Sample: |
|
host_mode string |
Configured host mode for the host group (OS type or special mode). Returned: success Sample: |
|
host_mode_options list / elements=integer |
List of host mode option identifiers currently set for the host group. Returned: success Sample: |
|
lun_paths list / elements=dictionary |
List of LUN path entries associated with this host group. Each entry describes an LDEV mapping and path metadata. Returned: success |
|
asymmetric_access_state string |
Asymmetric access state for the path (for ALUA-capable devices). Returned: success Sample: |
|
host_group_number integer |
Numeric host group identifier as exposed via the path. Returned: success Sample: |
|
host_mode string |
Host mode string reported for the path (may include extra qualifiers). Returned: success Sample: |
|
host_mode_options list / elements=integer |
Host mode option identifiers reported for the path. Returned: success Sample: |
|
is_alua_enabled boolean |
Whether ALUA is enabled for the path. Returned: success Sample: |
|
is_command_device boolean |
Whether the LDEV is marked as a command device. Returned: success Sample: |
|
ldev_id integer |
Logical device ID (decimal). Returned: success Sample: |
|
ldev_id_hex string |
Logical device ID formatted in hex (colon separated). Returned: success Sample: |
|
lu_host_reserve dictionary |
Host reservation information for the LU path, presented as booleans for reservation types and keys. Returned: success |
|
aca_reserve boolean |
Whether ACA (Auto Contingent Allegiance) reserve is set. Returned: success Sample: |
|
mainframe boolean |
Whether mainframe-style reserve is set. Returned: success Sample: |
|
open_system boolean |
Whether open system (standard SCSI-based) reserve is set. Returned: success Sample: |
|
persistent boolean |
Whether persistent reservation is active. Returned: success Sample: |
|
pgr_key boolean |
Presence of a persistent group reservation key. Returned: success Sample: |
|
lun integer |
LUN number assigned to this path. Returned: success Sample: |
|
lun_id string |
Identifier string for the LU path, typically combining port, hostgroup number and LUN. Returned: success Sample: |
|
port_id string |
Port identifier associated with this path entry. Returned: success Sample: |
|
port_id string |
Default or requested port associated with the host group operations (e.g., CLx-A). Returned: success Sample: |
|
resource_group_id integer |
Resource group ID associated with the host group (if applicable). Returned: success Sample: |
|
wwns list / elements=dictionary |
List of WWN entries (host HBA identifiers) that belong to the host group. Returned: success Sample: |
|
nick_name string |
Deprecated. Use Returned: success Sample: |
|
nickname string |
Optional human readable nickname assigned to the WWN. Returned: success Sample: |
|
wwn string |
World Wide Name string for the host HBA. Returned: success Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/hitachivantara/vspone_block/vsp.hv_hg_bulk_module.html