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

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.8

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

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:

  • "direct" ← (default)

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.

Choices:

  • "LINUX"

  • "VMWARE"

  • "HP"

  • "OPEN_VMS"

  • "TRU64"

  • "SOLARIS"

  • "NETWARE"

  • "WINDOWS"

  • "HI_UX"

  • "AIX"

  • "VMWARE_EXTENSION"

  • "WINDOWS_EXTENSION"

  • "UVM"

  • "HP_XP"

  • "DYNIX"

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=string

List of IQN initiators that you want to add or remove.

ldevs

list / elements=integer

LDEV ID in decimal or HEX of the LDEV that you want to present or unpresent.

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:

  • false

  • true

state

string

State of the iscsi target tasks.

present - Update iscsi target by override host mode and host mode option and append other parameters mentioned in spec.

absent - Update iscsi target by remove all parameters mentioned in spec.

add_iscsi_initiator - Update iscsi target by append all iqn initiators mentioned in spec.

remove_iscsi_initiator - Update iscsi target by remove all iqn initiators mentioned in spec.

attach_ldev - Update iscsi target by append all ldevs mentioned in spec.

detach_ldev - Update iscsi target by remove all ldevs mentioned in spec.

add_chap_user - Update iscsi target by append all chap users mentioned in spec.

remove_chap_user - Update iscsi target by remove all chap users mentioned in spec.

Choices:

  • "present" ← (default)

  • "absent"

  • "add_iscsi_initiator"

  • "remove_iscsi_initiator"

  • "attach_ldev"

  • "detach_ldev"

  • "add_chap_user"

  • "remove_chap_user"

state

string

Set state to present for create and update iscsi target

Set state to absent for delete iscsi target

Choices:

  • "present" ← (default)

  • "absent"

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 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

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: true

failed

boolean

Indicates if the operation failed.

Returned: success

Sample: false

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: "BOTH"

is_chap_enabled

boolean

Indicates if CHAP is enabled.

Returned: success

Sample: true

is_chap_required

boolean

Indicates if CHAP is required.

Returned: success

Sample: false

is_mutual_auth

boolean

Indicates if mutual authentication is enabled.

Returned: success

Sample: false

chap_users

list / elements=string

List of CHAP users.

Returned: success

Sample: ["chapuser1"]

host_mode

dictionary

Host mode details.

Returned: success

host_mode

string

Host mode.

Returned: success

Sample: "VMWARE"

host_mode_options

list / elements=dictionary

List of host mode options.

Returned: success

raid_option

string

RAID option.

Returned: success

Sample: "EXTENDED_COPY"

raid_option_number

integer

RAID option number.

Returned: success

Sample: 54

iqn

string

IQN of the iSCSI target.

Returned: success

Sample: "iqn.rest.example.of.iqn.host"

iqn_initiators

list / elements=string

List of IQN initiators.

Returned: success

Sample: ["iqn.2014-04.jp.co.hitachi:xxx.h70.i.62510.1a.ff"]

iscsi_id

integer

ID of the iSCSI target.

Returned: success

Sample: 1

iscsi_name

string

Name of the iSCSI target.

Returned: success

Sample: "iscsi-name"

logical_units

list / elements=dictionary

List of logical units.

Returned: success

host_lun_id

integer

Host LUN ID.

Returned: success

Sample: 0

logical_unit_id

integer

Logical unit ID.

Returned: success

Sample: 1

port_id

string

Port ID.

Returned: success

Sample: "CL4-C"

resource_group_id

integer

Resource group ID.

Returned: success

Sample: 0

Authors

  • Hitachi Vantara LTD (@hitachi-vantara)