Note
This module is part of the hitachivantara.vspone_block collection (version 3.5.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
The below requirements are needed on the host that executes this module.
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 |
This field is used to pass the value of the lock token 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 if api_token is not provided. |
|
username string |
Username for authentication. This is a required field if api_token is not provided. |
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. Choices:
|
|
host_mode_options list / elements=integer |
List of host group host mode option numbers. 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. |
|
iqn string / required |
IQN of the initiator. |
|
nick_name string |
Nickname of the initiator. |
|
iscsi_id integer |
ID of the iSCSI target. |
|
ldevs list / elements=integer |
LDEV ID in decimal or HEX of the LDEV that you want to present or unpresent. |
|
lun integer |
LUN ID to releasing host reservation status. |
|
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>”. |
|
port string / required |
Port of the iscsi target. |
|
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 |
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. |
Attribute | Support | Description |
|---|---|---|
check_mode | Support: none | Determines if the module should run in check mode. |
Note
subscriber_id and partner_id were removed in version 3.4.0. They were also deprecated due to internal API simplification and are no longer supported.gateway was removed starting from version 3.4.0. Please use an earlier version if you require this connection type.- 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: 'CL4-C'
iqn_initiators:
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254a
nick_name: "nick_name1"
- iqn: iqn.1993-08.org.debian.iscsi:01:107dc7e4254b
nick_name: "nick_name2"
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: '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: '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: '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: '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: '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: 'CL4-C'
should_release_host_reserve: true
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
iscsi_target_info dictionary | Dictionary containing the discovered properties of the iSCSI targets. Returned: always |
|
changed boolean |
Indicates if any changes were made. Returned: success Sample: |
|
failed boolean |
Indicates if the operation failed. Returned: success Sample: |
|
iscsi_target dictionary |
Details of the iSCSI target. Returned: success |
|
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 |
|
raid_option string |
RAID option. Returned: success Sample: |
|
raid_option_number integer |
RAID option number. Returned: success Sample: |
|
iqn string |
IQN of the iSCSI target. Returned: success Sample: |
|
iqn_initiators list / elements=string |
List of IQN initiators. 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 |
|
host_lun_id integer |
Host LUN ID. Returned: success Sample: |
|
logical_unit_id integer |
Logical unit ID. Returned: success Sample: |
|
port_id string |
Port ID. Returned: success Sample: |
|
resource_group_id integer |
Resource group ID. Returned: success Sample: |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/hitachivantara/vspone_block/vsp.hv_iscsi_target_module.html