hitachivantara.vspone_block.vsp.hv_iscsi_target module – Manages iscsi target on Hitachi VSP storage systems.
Note
This module is part of the hitachivantara.vspone_block collection (version 3.4.0).
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.8
Parameters
Parameter |
Comments |
---|---|
Information required to establish a connection to the storage system. |
|
IP address or hostname of the storage system. |
|
This field is used to pass the value of the lock token to operate on locked resources. |
|
Type of connection to the storage system. Choices:
|
|
Password for authentication. This is a required field. |
|
Username for authentication. This is a required field. |
|
Specification for iscsi target operation. |
|
List of CHAP users that you want to add or remove. |
|
Host mode of host group. Choices:
|
|
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 |
|
List of IQN initiators that you want to add or remove. |
|
LDEV ID in decimal or HEX of the LDEV that you want to present or unpresent. |
|
Name of the iscsi target.If not given, It will create the name will contain with prefix value “smrha-<10 digit random number>”. |
|
Port of the iscsi target. |
|
If the value is true, destroy the logical devices that are no longer attached to any iSCSI Target. Choices:
|
|
State of the iscsi target tasks.
Choices:
|
|
Set state to present for create and update iscsi target Set state to absent for delete iscsi target Choices:
|
|
Information about the storage system. This field is an optional field. |
|
The serial number of the storage system. |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: none |
Determines if the module should run in check mode. |
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: 'CL4-C'
iqn_initiators:
- iqn.1993-08.org.debian.iscsi:01:107dc7e4254a
- iqn.1993-08.org.debian.iscsi:01:107dc7e4254b
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.1993-08.org.debian.iscsi:01:107dc7e4254b
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Dictionary containing the discovered properties of the iSCSI targets. Returned: always |
|
Indicates if any changes were made. Returned: success Sample: |
|
Indicates if the operation failed. Returned: success Sample: |
|
Details of the iSCSI target. Returned: success |
|
Authentication parameters. Returned: success |
|
Mode of authentication. Returned: success Sample: |
|
Indicates if CHAP is enabled. Returned: success Sample: |
|
Indicates if CHAP is required. Returned: success Sample: |
|
Indicates if mutual authentication is enabled. Returned: success Sample: |
|
List of CHAP users. Returned: success Sample: |
|
Host mode details. Returned: success |
|
Host mode. Returned: success Sample: |
|
List of host mode options. Returned: success |
|
RAID option. Returned: success Sample: |
|
RAID option number. Returned: success Sample: |
|
IQN of the iSCSI target. Returned: success Sample: |
|
List of IQN initiators. Returned: success Sample: |
|
ID of the iSCSI target. Returned: success Sample: |
|
Name of the iSCSI target. Returned: success Sample: |
|
List of logical units. Returned: success |
|
Host LUN ID. Returned: success Sample: |
|
Logical unit ID. Returned: success Sample: |
|
Port ID. Returned: success Sample: |
|
Resource group ID. Returned: success Sample: |