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.
-A - -authentication
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
- -level <level>
- -method <auth_method> - -mutual
- -mchap_username <ma_username>
- -mchap_password <ma_password>
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>]
[- -name <iscsi_name>]] <adapter_name>
Enables mutual authentication. You must enable authentication before you can enable mutual authentication.
-A - -authentication
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]] <adapter_name>
- -level <level>
- -method <auth_method>
- -chap_password <auth_u_name>
- -chap_username <chap_password>
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>]
[- -name <iscsi_name>]] <adapter_name>
-A - -authentication
- -list <adapter_name>
-D - -discovery
- -add - -ip <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
-D - -discovery
- -list <adapter_name>
-D - -discovery
- -remove - -ip <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
--list [<adapter_name>]
-L - -lun
- -list <adapter_name>
-L - -lun
- -list - -target_id <target_id> <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>
Sets the IP address, subnet mask, and default gateway in one command.
-p - -pnp (Independent hardware iSCSI only)
- -list <adapter_name>
-p - -pnp (Independent hardware iSCSI only)
- -mtu <mtu-size> <adapter_name>
-I - -iscsiname
- -alias <alias_name> <adapter_name>
-I - -iscsiname
- -name <iscsi_name> <adapter_name>
-I - -iscsiname
- -list <adapter_name>
--pnp - -mtu <mtu-size> <adapter_name>
-S - -static
- -list <adapter_name>
-S - -static
- -remove - -ip <stor_ip_addr|stor_hostname> [:<portnum>] -name <target_name> <adapter_name>
-S - -static
-n <target_name> <adapter_name>
- -add - -ip <stor_ip_addr|stor_hostname> [:<portnum>]
-name <target_name> <adapter_name>
-P - -phba
- -list <adapter_name>
Lists external, vendor-specific properties of an iSCSI adapter.
-T - -target
- -list <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>
- -list - -detail
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>] [- -name <iscsi_name]] <adapter_name>
-W - -parameter
- -parameter - -set <name>=<value>
- -ip <stor_ip_addr|stor_hostname> [:port_num>]
[- -name <iscsi_name>]] <adapter_name>
-W - -parameter
-W - o <param_name>
-parameter - -reset <param_name>
-ip <stor_ip_addr|stor_hostname> [:port_num>] [-name <iscsi_name>]] <adapter_name>
Returns parameters in discovery target or send target to default inheritance behavior.
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
- -method <auth_method>
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>]
[- -name <iscsi_name>]] <adapter_name>
Resets target level authentication properties to be inherited from adapter level. Used with the --authentication option.