6.0

Table Of Contents
vSphere Command-Line Interface Concepts and Examples
68 VMware, Inc.
iSCSI Storage Setup with ESXCLI
YoucansetupiSCSIstorageusingvSphereWebClient,commandsintheesxcli iscsinamespace,or
vicfg-iscsicommands(see“iSCSIStorageSetupwithvicfgiscsi”onpage 73).
Setting Up Software iSCSI with ESXCLI
SoftwareiSCSIsetuprequiresseveraltasks.Foreachtask,seethediscussionofthecorrespondingcommand
inthischapterorthereferenceinformationavailablefromesxcli iscsi --helpandtheVMware
DocumentationCenter.Specifyoneoftheoptionslistedin“ConnectionOptionsforvCLIHostManagement
Commands”onpage 18inplaceof<conn_options>
1EnablesoftwareiSCSI.
esxcli <conn_options> iscsi software set --enabled=true
2Checkwhetheranetworkportal,thatis,aboundport,existsforiSCSItraffic.
esxcli <conn_options> iscsi adapter list
3Ifnoadapterexists,addone.SoftwareiSCSIdoesnotrequireportbinding,butrequiresthatatleastone
VMkernelNICisavailableandcanbeusedasaniSCSINIC.Youcannametheadapterasyouaddit.
esxcli <conn_options> iscsi networkportal add -n <portal_name> -A <vmhba>
4 (Optional)Checkthestatus.
esxcli <conn_options> iscsi software get
ThesystemprintstrueifsoftwareiSCSIisenabled,orfalseifitisnotenabled.
5 (Optional)SettheiSCSInameandalias.
esxcli <conn_options> iscsi adapter set --adapter=<iscsi adapter> --name=<name>
esxcli <conn_options> iscsi adapter set --adapter=<iscsi adapter> --alias=<alias>
6Addadynamicdiscoveryaddressorastaticdiscoveryaddress.
Thetwotypesoftargetdifferasfollows:
Withdynamicdiscovery,allstoragetargetsassociatedwithahostnameorIPaddressarediscovered.
Yourunthefollowingcommand.
esxcli <conn_options> iscsi adapter discovery sendtarget add --address=<ip/dns[:port]>
--adapter=<adapter_name>
Withstaticdiscovery,youmustspecifythehostnameorIPaddressandtheiSCSInameofthestorage
target.Yourunthefollowingcommand.
esxcli <conn_options> iscsi adapter discovery statictarget add --address=<ip/dns[:port]>
--adapter=<adapter_name> --name=<target_name>
Whenyoulaterremoveadiscoveryaddress,itmightstillbedisplayedastheparentofastatictarget.You
canaddthediscoveryaddressandrescantodisplaythecorrectparentforthestatictargets.
7 (Optional)SettheauthenticationinformationforCHAP(see“SettingiSCSICHAP”onpage 62and
“Enabling
iSCSIAuthentication”onpage 82).YoucansetpertargetCHAPforstatictargets,peradapter
CHAP,orapplythecommandtothediscoveryaddress.