iSCSI Storage Setup with vicfg-iscsi
You can set up iSCSI storage using the vSphere Client, commands in the esxcli iscsi namespace (see iSCSI Storage Setup with ESXCLI) or the vicfg-iscsi command.
Setting Up Software iSCSI with vicfg-iscsi
Software iSCSI setup requires a number of high-level tasks. For each task, see the discussion of the corresponding command-line option in this chapter or the reference information. Specify one of the options listed in Connection Options in place of <conn_options>.
1
vicfg-iscsi <conn_options> - -adapter - -list
2
vicfg-iscsi <conn_options> - -swiscsi - -enable
3
vicfg-iscsi <conn_options> - -swiscsi - -list
The system prints Software iSCSI is enabled or Software iSCSI is not enabled.
4
vicfg-iscsi <conn_options> -I -n <iscsi_name> <adapter_name>
vicfg-iscsi <conn_options> - -iscsiname - -name <iscsi_name> <adapter_name>
vicfg-iscsi <conn_options> -I -a <alias_name> <adapter_name>
vicfg-iscsi <conn_options> - -iscsiname - -alias <alias_name> <adapter_name>
5
The two types of target differ as follows:
vicfg-iscsi <conn_options> --discovery --add --ip <ip_addr | domain_name> <adapter_name>
vicfg-iscsi <conn_options> --static --add --ip <ip_addr | domain_name>
--name <iscsi_name> <adapter_name>
When you later remove a discovery address, it might still be displayed as the parent of a static target. You can add the discovery address and rescan to display the correct parent for the static targets.
6
vicfg-iscsi <conn_options> -A -c <level> -m <auth_method> -u <auth_u_name> -w <chap_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
vicfg-iscsi <conn_options> - -authentication - -level <level> - -method <auth_method>
- -chap_username <auth_u_name> - -chap_password <chap_password>
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>] [-name <iscsi_name]]
<adapter_name>
The target (-i) and name (-n) option determine what the command applies to.
-i and -n
Neither -i nor -n
7
(Optional) Set the authentication information for mutual CHAP by running vicfg-iscsi -A again with the -b option and a different authentication user name and password.
For <level>, specify chapProhibited or chapRequired.
chapProhibited – The host does not use CHAP authentication. If authentication is enabled, specify chapProhibited to disable it.
chapRequired – The host requires successful CHAP authentication. The connection fails if CHAP negotiation fails. You can set this value for mutual CHAP only if CHAP is set to chapRequired.
For <auth_method>, CHAP is the only valid value.
8
9
After setup is complete, run vicfg-rescan to rescan all storage devices.
Setting Up Dependent Hardware iSCSI with vicfg-iscsi
Dependent hardware iSCSI setup requires a number of high-level tasks. For each task, see the discussion of the corresponding command-line option in this chapter, or the reference information. Specify one of the options listed in Connection Options in place of <conn_options>.
1
vicf-iscsi <conn_options> - -adapter - -list
2
vicfg-iscsi <conn_options> -I -n <iscsi_name> <adapter_name>
vicfg-iscsi <conn_options> - -iscsiname - -name <iscsi_name> <adapter_name>
vicfg-iscsi <conn_options> -I -a <alias_name> <adapter_name>
vicfg-iscsi <conn_options> - -iscsiname - -alias <alias_name> <adapter_name>
3
a
esxcli <conn_options> swiscsi vmknic list -d <vmhba>
b
esxcli <conn_options> swiscsi nic add -n <port_name> -d <vmhba>
c
esxcli <conn_options> swiscsi nic list -d <vmhba>
d
vicfg-rescan <conn_options> <vmhba>
4
The two types of target differ as follows:
vicfg-iscsi <conn_options> --discovery --add --ip <ip_addr | domain_name> <adapter_name>
vicfg-iscsi <conn_options> --static --add --ip <ip_addr | domain_name>
--name <iscsi_name> <adapter_name>
When you later remove a discovery address, it might still be displayed as the parent of a static target. You can add the discovery address and rescan to display the correct parent for the static targets.
5
vicfg-iscsi <conn_options> -A -c <level> -m <auth_method> -u <auth_u_name> -w <chap_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
vicfg-iscsi <conn_options> - -authentication - -level <level> - -method <auth_method>
- -chap_username <auth_u_name> - -chap_password <chap_password>
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>] [-name <iscsi_name]]
<adapter_name>
The target (-i) and name (-n) option determine what the command applies to.
-i and -n
Neither -i nor -n
6
(Optional) Set the authentication information for mutual CHAP by running vicfg-iscsi -A again with the -b option and a different authentication user name and password.
For <level>, specify chapProhibited or chapRequired.
chapProhibited – The host does not use CHAP authentication. If authentication is enabled, specify chapProhibited to disable it.
chapRequired – The host requires successful CHAP authentication. The connection fails if CHAP negotiation fails. You can set this value for mutual CHAP only if CHAP is set to chapRequired.
For <auth_method>, CHAP is the only valid value.
7
8
After setup is complete, run vicfg-rescan to rescan all storage devices.
Setting Up Independent Hardware iSCSI with vicfg-iscsi
With independent hardware-based iSCSI storage, you use a specialized third-party adapter capable of accessing iSCSI storage over TCP/IP. This iSCSI initiator handles all iSCSI and network processing and management for your ESXi system.
You must install and configure the independent hardware iSCSI adapter for your host before you can access the iSCSI storage device. For installation information, see vendor documentation.
Hardware iSCSI setup requires a number of high-level tasks. For each task, see the discussion of the corresponding command-line option in this chapter, the manpage (Linux), or the reference information. Specify one of the options listed in Connection Options in place of <conn_options>.
1
vicf-iscsi <conn_options> - -adapter - -list
2
Configure the hardware initiator (HBA) by running vicfg-iscsi -N with one or more of the following options.
--list – List network properties.
--ip <ip_addr> – Set HBA IPv4 address.
--subnetmask <subnet_mask> – Set HBA network mask.
--gateway <default_gateway> – Set HBA gateway.
--set ARP=true|false – Enable or disable ARP redirect.
You can also set the HBA IPv4 address and network mask and gateway in one command.
vicfg-iscsi <conn_options> --ip <ip_addr> --subnetmask <subnet_mask> --gateway <default_gateway>
3
vicfg-iscsi <conn_options> -I -n <iscsi_name> <adapter_name>
vicfg-iscsi <conn_options> - -iscsiname - -name <iscsi_name> <adapter_name>
vicfg-iscsi <conn_options> -I -a <alias_name> <adapter_name>
vicfg-iscsi <conn_options> - -iscsiname - -alias <alias_name> <adapter_name>
4
The two types of target differ as follows:
vicfg-iscsi <conn_options> --discovery --add --ip <ip_addr> <adapter_name>
vicfg-iscsi <conn_options> --static --add --ip <ip_addr>
--name <iscsi_name> <adapter_name>
When you later remove a discovery address, it might still be displayed as the parent of a static target. You can later add the discovery address and rescan to display the correct parent for the static targets.
5
You can set the information for per adapter, per discovery, and per target CHAP. See Setting iSCSI CHAP and Enabling iSCSI Authentication.
vicfg-iscsi <conn_options> - -authentication - -level <level> - -method <auth_method>
- -chap_username <auth_u_name> - -chap_password <chap_password>
[- -ip <stor_ip_addr|stor_hostname> [:<portnum>] [-name <iscsi_name]]
<adapter_name>
The target (-i) and name (-n) option determine what the command applies to.
-i and -n
Neither -i nor -n
Mutual CHAP is not supported for independent hardware iSCSI storage.
6
7
After setup is complete, call vicfg-rescan to rescan all storage devices.