storage_iscsi_remove_target
Remove an iSCSI target from an ESXi host's software iSCSI adapter, then rescan HBAs and VMFS volumes. LUNs served only by this target become inaccessible. Verify no datastores depend on it.
Instructions
[WRITE] Remove an iSCSI send target from an ESXi host's software iSCSI adapter, then rescan all HBAs and VMFS volumes.
Destructive: LUNs served only by this target become inaccessible after the rescan — first verify the target exists (storage_iscsi_status) and that no datastores depend on it (list_all_datastores). Errors if the address:port pair is not configured or software iSCSI is disabled. Reversible only by re-adding via storage_iscsi_add_target. Audit-logged to ~/.vmware/audit.db. Returns a confirmation string.
Args: host_name: ESXi host name as shown in vCenter inventory. address: Configured iSCSI portal IP (IPv4/IPv6 literal; hostnames rejected). Must match the existing entry exactly. port: Configured iSCSI TCP port, 1-65535 (default 3260). dry_run: If true, return a preview of the change without executing it. target: Optional vCenter/ESXi target name from config; omit for the default target.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | ||
| target | No | ||
| address | Yes | ||
| dry_run | No | ||
| host_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |