6.5

Table Of Contents
5 (Optional) Set the authentication information for CHAP.
You can set per-target CHAP for static targets, per-adapter CHAP, or apply the command to the
discovery address.
Option Command
Adapter-level CHAP
esxcli iscsi adapter auth chap set --direction=uni --
chap_username=<name> --chap_password=<pwd> --
level=[prohibited, discouraged, preferred, required] --
secret=<string> --adapter=<vmhba>
Discovery-level CHAP
esxcli iscsi adapter discovery sendtarget auth chap set --
direction=uni --chap_username=<name> --chap_password=<pwd>
--level=[prohibited, discouraged, preferred, required] --
secret=<string> --adapter=<vmhba> --
address<sendtarget_address>
Target-level CHAP
esxcli iscsi adapter target portal auth chap set --
direction=uni --chap_username=<name> --chap_password=<pwd>
--level=[prohibited, discouraged, preferred, required] --
secret=<string> --adapter=<vmhba> --name<iscsi_iqn_name>
The following example sets adapter-level CHAP.
esxcli <conn_options> iscsi adapter auth chap set --direction=uni --chap_username=<name> --
chap_password=<pwd> --level=preferred --secret=uni_secret --adapter=vmhba33
N Mutual CHAP is not supported for independent hardware iSCSI storage.
6 (Optional) Set iSCSI parameters.
Option Command
Adapter-level CHAP
esxcli iscsi adapter param set --adapter=<vmhba> --
key=<key> --value=<value>
Discovery-level CHAP
esxcli iscsi adapter discovery sendtarget param set --
adapter=<vmhba> --key=<key> --value=<value> --
address=<sendtarget_address>
Target-level CHAP
esxcli iscsi adapter target portal param set --
adapter=<vmhba> --key=<key> --value=<value> --
address=<address> --name=<iqn.name>
7 After setup is complete, run esxcli storage core adapter rescan --adapter=<iscsi_adapter> to
rescan all storage devices.
8 After setup is complete, perform rediscovery and rescan all storage devices.
The following example performs the rediscovery and rescan operations.
esxcli <conn_options> iscsi adapter discovery rediscover
esxcli <conn_options> storage core adapter rescan --adapter=vmhba36
iSCSI Storage Setup with vicfg-iscsi
You can set up iSCSI storage by using the vicfg-iscsi command.
You can also set up iSCSI storage by using the vSphere Web Client or commands in the esxcli iscsi
namespace. See “iSCSI Storage Setup with ESXCLI,” on page 78.
vSphere Command-Line Interface Concepts and Examples
84 VMware, Inc.