Command Syntax for esxcli iscsi and vicfg-iscsi
In vSphere 5.0, you can manage iSCSI storage by using either esxcli iscsi commands or vicfg-iscsi options. See the vSphere Command-Line Interface Reference. esxcli iscsi Command Syntax and vicfg-iscsi Command Syntax provide an overview.
esxcli iscsi Command Syntax
The esxcli iscsi command includes a number of nested namespaces. The following table illustrates the namespace hierarchy. Commands at each level are included in bold. Many namespaces include both commands and namespaces.
adapter [get|list|set]
chap [set|get]
discovery [rediscover]
sendtarget [add|list|remove]
chap [get|set]
param [get|set]
statictarget [add|list|remove]
chap [get|set]
param [get|set]
firmware [get|set]
param [get|set]
networkportal [add|list|remove]
ipconfig [get|set]
param [get|set]
session [add|list|remove]
ibftboot [get|import]
software [get|set]
Key to esxcli iscsi Short Options
ESXCLI commands for iSCSI management consistently use the same short options. For several options, the associated full option depends on the command.
Short Options for iSCSI ESXCLI Command Options
vicfg-iscsi Command Syntax
vicfg-iscsi supports a comprehensive set of options, listed in Options for vicfg-iscsi.
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>]
[- -name <iscsi_name>]] <adapter_name>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]] <adapter_name>
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>]
[- -name <iscsi_name>]] <adapter_name>
- -add - -ip <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
- -remove - -ip <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
- -list [<adapter_name>]
-N - -network (Independent hardware iSCSI only)
- -list <adapter_name>
-N - -network (Independent hardware iSCSI only)
- -ip <ip_addr> <vmhba>
-N - -network (Independent hardware iSCSI only)
- -subnetmask <subnet_mask> <adapter_name>
-N - -network (Independent hardware iSCSI only)
- -gateway <default_gateway> <adapter_name>
Sets the HBA gateway to default_gateway.
-N - -network (Independent hardware iSCSI only)
- -ip <ip_addr> - -subnetmask <subnet_mask>
- -gateway <default_gateway> <adapter_name>
- -remove - -ip <stor_ip_addr|stor_hostname> [:<portnum>] -name <target_name> <adapter_name>
-n <target_name> <adapter_name>
- -add - -ip <stor_ip_addr|stor_hostname> [:<portnum>]
-name <target_name> <adapter_name>
-W - -parameter
-l [-i <stor_ip_addr|stor_hostname> [:<portnum>]
- -list [- -ip <stor_ip_addr|stor_hostname> [:<portnum>]
[- -name <iscsi_name]] <adapter_name>
-W - -parameter
-l -k [-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>] [- -name <iscsi_name]] <adapter_name>
-W - -parameter
-W - -parameter
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>]
[- -name <iscsi_name>]] <adapter_name>