hitachivantara.vspone_block.vsp.hv_iscsi_target_bulk module – Manages iscsi targets in bulk mode on VSP block storage systems.
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_iscsi_target_bulk.
New in hitachivantara.vspone_block 4.7.0
Synopsis
- The hv_iscsi_target module provides the following iscsi target management operations
-
- Create iscsi target
-
- Update host mode and host mode options
-
- Add iqn initiator to iscsi target
-
- Add LDEV to iscsi target
-
- Remove iqn initiator from iscsi target
-
- Remove LDEV from iscsi target
-
- Delete iscsi target
-
- Add CHAP User to iscsi target
-
- Remove CHAP User from iscsi target
- For examples, go to URL https://github.com/hitachi-vantara/vspone-block-ansible/blob/main/playbooks/vsp_direct/iscsi_target_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 / required | Specification for iscsi target operation. |
|
chap_users list / elements=dictionary |
List of CHAP users that you want to add or remove. |
|
host_mode string |
Host mode of host group. Required for the Update iSCSI target host mode and host mode options task. Choices:
|
|
host_mode_options list / elements=integer |
List of host group host mode option numbers. Required for the Update iSCSI target 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 |
|
id integer |
ID of the iSCSI target. If not given, name is required to identify the iscsi target. |
|
iqn_initiators list / elements=dictionary |
List of IQN initiators that you want to add or remove. |
|
iqn string / required |
IQN of the initiator. |
|
nickname string |
Nickname of the initiator. |
|
lun_paths list / elements=dictionary |
List of LUN paths that you want to add or remove. Each LUN path contains LUN number and LDEV ID. |
|
ldev string / required |
LDEV ID. |
|
lun integer |
LUN number. |
|
name string |
Name of the iscsi target. If not given, id is required to identify the iscsi target. |
|
port_ids list / elements=string / required |
Port IDs of the iscsi targets. |
|
should_delete_all_volumes aliases: should_delete_all_ldevs boolean |
If the value is true, destroy the logical devices that are no longer attached to any iSCSI Target. Choices:
|
|
should_release_host_reserve boolean |
If the value is true, release the host reserve. Choices:
|
state string | Set state to present for create and update iscsi target Set state to absent for delete iscsi target 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 multiple iSCSI targets
hitachivantara.vspone_block.vsp.hv_iscsi_target_bulk:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
name: 'rd-server-1234'
port_ids: ['CL1-C', 'CL2-C']
host_mode: "LINUX"
host_mode_options: [54, 63]
iqn_initiators:
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254a
nickname: "nickname_1"
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254b
nickname: "nickname_2"
lun_paths:
- lun: 5
ldev: 5150
- lun: 6
ldev: 5153
chap_users:
- chap_user_name: user1
chap_secret: Secret123456
- name: Update iscsi target host mode and options
hitachivantara.vspone_block.vsp.hv_iscsi_target_bulk:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: updated
spec:
name: 'iscsi-target-server-1'
port_ids: ['CL1-C', 'CL2-C']
host_mode: "LINUX"
host_mode_options: [54, 63, 94]
should_release_host_reserve: true
- name: Add iqn initiators, LUN paths and CHAP users to multiple iscsi targets
hitachivantara.vspone_block.vsp.hv_iscsi_target_bulk:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: added
spec:
name: 'rd-server-0324'
port_ids: ['CL1-C', 'CL2-C']
iqn_initiators:
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254a
nickname: "nickname_1"
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254b
nickname: "nickname_2"
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254c
nickname: "nickname_3"
lun_paths:
- lun: 5
ldev: 5150
- lun: 6
ldev: 5153
- lun: 7
ldev: 5154
chap_users:
- chap_user_name: user1
chap_secret: Secret123456
- chap_user_name: user2
chap_secret: Secret123456
- chap_user_name: user3
chap_secret: Secret123456
register: result
- name: Remove chap user from iscsi target
hitachivantara.vspone_block.vsp.hv_iscsi_target_bulk:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
state: remove_chap_user
name: 'iscsi-target-server-1'
port: 'CL4-C'
chap_users:
- chap_user_name: user2
chap_secret: Secret2
- name: Add iqn initiators to iscsi target
hitachivantara.vspone_block.vsp.hv_iscsi_target_bulk:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
state: add_iscsi_initiator
name: 'iscsi-target-server-1'
port: 'CL4-C'
iqn_initiators:
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254b
- name: Release host reserve status of a iscsi target using lun
hitachivantara.vspone_block.vsp.hv_iscsi_target_bulk:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
id: 20
should_release_host_reserve: true
port: 'CL4-C'
lun: 100
- name: Release host reserve status of a iscsi targets
hitachivantara.vspone_block.vsp.hv_iscsi_target_bulk:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
iscsi_id: 20
port: 'CL4-C'
should_release_host_reserve: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
iscsi_target dictionary | Details of the iSCSI target. Returned: always |
|
auth_param dictionary |
Authentication parameters. Returned: success |
|
authentication_mode string |
Mode of authentication. Returned: success Sample: |
|
is_chap_enabled boolean |
Indicates if CHAP is enabled. Returned: success Sample: |
|
is_chap_required boolean |
Indicates if CHAP is required. Returned: success Sample: |
|
is_mutual_auth boolean |
Indicates if mutual authentication is enabled. Returned: success Sample: |
|
chap_users list / elements=string |
List of CHAP users. Returned: success Sample: |
|
host_mode dictionary |
Host mode details. Returned: success |
|
host_mode string |
Host mode. Returned: success Sample: |
|
host_mode_options list / elements=dictionary |
List of host mode options. Returned: success Sample: |
|
iqn string |
IQN of the iSCSI target. Returned: success Sample: |
|
iqn_initiators list / elements=dictionary |
List of IQN initiators. Returned: success |
|
iqn string |
IQN of the initiator. Returned: success Sample: |
|
nick_name string |
Nickname of the initiator. Returned: success Sample: |
|
iscsi_id integer |
ID of the iSCSI target. Returned: success Sample: |
|
iscsi_name string |
Name of the iSCSI target. Returned: success Sample: |
|
logical_units list / elements=dictionary |
List of logical units. Returned: success Sample: |
|
port_id string |
Port ID. Returned: success Sample: |
|
resource_group_id integer |
Resource group ID. 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_iscsi_target_bulk_module.html