storage_iscsi_add_target
Add an iSCSI dynamic discovery target to an ESXi host's software adapter, then rescan HBAs and VMFS volumes to discover new LUNs. Preview the impact before applying changes.
Instructions
[WRITE] Add an iSCSI send (dynamic discovery) target to an ESXi host's software iSCSI adapter, then automatically rescan all HBAs and VMFS volumes to discover new LUNs.
Without confirm=True this only previews: it returns blast_radius (the adapter, the send targets configured now, and the adapters the rescan touches) and changes nothing. Show it to the user. Do not set confirm=True on your own because the user asked earlier — they have not seen the preview yet. Refused when software iSCSI is not enabled (run storage_iscsi_enable first) or the host's storage view cannot be read. A duplicate address:port returns action "noop". No separate storage_rescan call is needed afterwards. Returns a dict.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | iSCSI TCP port, 1-65535 (default 3260). | |
| target | No | Optional vCenter/ESXi target name from config. | |
| address | Yes | iSCSI portal IP address (IPv4/IPv6 literal; hostnames are rejected with a validation error). | |
| confirm | No | False (default) returns the blast radius and changes nothing. True applies it. | |
| dry_run | No | Deprecated alias for confirm; removed in the next minor release. dry_run=False acts, dry_run=True previews. | |
| host_name | Yes | ESXi host name as shown in vCenter inventory. |