hitachivantara.vspone_block.vsp.hv_iscsi_target module – Manages iscsi target 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.
New in hitachivantara.vspone_block 3.0.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.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. Optional for the Create an iSCSI target task. Required for the Add CHAP users to an iSCSI target /Remove a CHAP user from an iSCSI target tasks. |
|
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 |
|
iqn_initiators list / elements=dictionary |
List of IQN initiators that you want to add or remove. Optional for the Create an iSCSI target /Rename or unset nickname of an IQN initiator (existing IQN initiator) tasks. Required for the Add IQN initiators to an iSCSI target /Remove IQN initiators from an iSCSI target tasks. |
|
iqn string / required |
IQN of the initiator. Required for the Create an iSCSI target /Add IQN initiators to an iSCSI target /Remove IQN initiators from an iSCSI target /Rename or unset nickname of an IQN initiator (existing IQN initiator) tasks. |
|
nickname aliases: nick_name string |
Nickname of the initiator. Required for the Create an iSCSI target /Add IQN initiators to an iSCSI target /Rename or unset nickname of an IQN initiator (existing IQN initiator) tasks. |
|
iscsi_id integer |
ID of the iSCSI target. |
|
ldevs list / elements=string |
LDEV ID in decimal or HEX of the LDEV that you want to present or unpresent. Optional for the Create an iSCSI target task. Required for the Attach LDEVs to an iSCSI target /Detach LDEVs from an iSCSI target tasks. |
|
lun integer |
LUN ID to releasing host reservation status. Required for the Release host reserve status of the LU mapped to a specified LU mapped path task. |
|
name string |
Name of the iscsi target.If not given, It will create the name will contain with prefix value “smrha-<10 digit random number>”. Optional for the Create an iSCSI target task. Required for the Update iSCSI target host mode and host mode options /Add CHAP users to an iSCSI target /Remove a CHAP user from an iSCSI target /Add IQN initiators to an iSCSI target /Remove IQN initiators from an iSCSI target /Attach LDEVs to an iSCSI target /Detach LDEVs from an iSCSI target /Delete an iSCSI target /Rename or unset nickname of an IQN initiator (existing IQN initiator) /Release host reserve status of the LU mapped to all LU mapped paths /Release host reserve status of the LU mapped to a specified LU mapped path tasks. |
|
port_id aliases: port string / required |
Port ID of the iscsi target. Required for the Create an iSCSI target /Update iSCSI target host mode and host mode options /Add CHAP users to an iSCSI target /Remove a CHAP user from an iSCSI target /Add IQN initiators to an iSCSI target /Remove IQN initiators from an iSCSI target /Attach LDEVs to an iSCSI target /Detach LDEVs from an iSCSI target /Delete an iSCSI target /Rename or unset nickname of an IQN initiator (existing IQN initiator) /Release host reserve status of the LU mapped to all LU mapped paths /Release host reserve status of the LU mapped to a specified LU mapped path tasks. |
|
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. Required for the Release host reserve status of the LU mapped to all LU mapped paths /Release host reserve status of the LU mapped to a specified LU mapped path tasks. Choices:
|
|
state string |
State of the iscsi target tasks.
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. |
Notes
Note
- The output parameters
subscriber_idandpartner_idwere removed in version 3.4.0. They were also deprecated due to internal API simplification and are no longer supported. - Connection type
gatewaywas removed starting from version 3.4.0. Please use an earlier version if you require this connection type.
Examples
- name: Create iscsi targets
hitachivantara.vspone_block.vsp.hv_iscsi_target:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
name: 'iscsi-target-server-1'
port_id: 'CL4-C'
iqn_initiators:
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254a
nickname: "nickname1"
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254b
nickname: "nickname2"
ldevs: [100, 200]
chap_users:
- chap_user_name: user1
chap_secret: Secret1
- name: Update iscsi target host mode and options
hitachivantara.vspone_block.vsp.hv_iscsi_target:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
name: 'iscsi-target-server-1'
port_id: 'CL4-C'
host_mode: LINUX
host_mode_options: [54, 63]
- name: Add chap users to iscsi target
hitachivantara.vspone_block.vsp.hv_iscsi_target:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
state: add_chap_user
name: 'iscsi-target-server-1'
port_id: 'CL4-C'
chap_users:
- chap_user_name: user1
chap_secret: Secret1
- chap_user_name: user2
chap_secret: Secret2
- name: Remove chap user from iscsi target
hitachivantara.vspone_block.vsp.hv_iscsi_target:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
state: remove_chap_user
name: 'iscsi-target-server-1'
port_id: '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:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
state: add_iscsi_initiator
name: 'iscsi-target-server-1'
port_id: '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:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
iscsi_id: 20
should_release_host_reserve: true
port_id: 'CL4-C'
lun: 100
- name: Release host reserve status of a iscsi targets
hitachivantara.vspone_block.vsp.hv_iscsi_target:
connection_info:
address: storage1.company.com
username: "admin"
password: "password"
state: present
spec:
iscsi_id: 20
port_id: '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 |
Deprecated. Use Returned: success Sample: |
|
nickname 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_module.html