6.0

Table Of Contents
vSphere Command-Line Interface Concepts and Examples
84 VMware, Inc.
To specify port binding
1FindoutwhichuplinksareavailableforusewithiSCSIadapters.
esxcli <conn_options> iscsi physicalnetworkportal list --adapter=<adapter_name>
2 ConnectthesoftwareiSCSIordependenthardwareiSCSIinitiatortotheiSCSIVMkernelportsby
runningthefollowingcommandforeachport.
esxcli <conn_options> iscsi networkportal nic add --adapter=<adapter_name> --nic=<bound_nic>
3VerifythattheportswereaddedtotheiSCSIinitiatorbyrunningthefollowingcommand:
esxcli <conn_options> iscsi networkportal list --adapter=<adapter_name>
4 (Optional)IfthereareactiveiSCSIsessionsbetweenyourhostandtargets,discontinuethem.See
“RemovingiSCSISessions”onpage 85.
5RescantheiSCSIinitiator.
esxcli <conn_options> storage core adapter rescan --adapter <iscsi adapter>
6TodisconnecttheiSCSIinitiatorfromtheports,runthefollowingcommand.
esxcli <conn_options> iscsi networkportal remove --adapter=<adapter_name> --nic=<bound_nic>
Managing iSCSI Sessions
Tocommunicatewitheachother,iSCSIinitiatorsandtargetsestablishiSCSIsessions.Youcanuseesxcli
iscsi sessiontolistandmanageiSCSIsessionsforsoftwareiSCSIanddependenthardwareiSCSI.
Introduction to iSCSI Session Management
Bydefault,softwareiSCSIanddependenthardwareiSCSIinitiatorsstartoneiSCSIsessionbetweeneach
initiatorportandeachtargetport.IfyouriSCSIinitiatorortargethasmorethanoneport,yourhostcan
establishmultiplesessions.Thedefaultnumberofsessionsforeachtargetequalsthenumberofports
onthe
iSCSIadaptertimesthenumberoftargetports.Youcandisplayallcurrentsessionstoanalyzeanddebug
them.Youmightaddsessionstothedefaultforseveralreasons.
Cloningsessions.SomeiSCSIarrayssupportmultiplesessionsbetweentheiSCSIadapterandtarget
ports.Ifyoucloneanexistingsessionononeofthesearrays,thearraypresentsmoredatapathsforyour
adapter.Duplicatesessionsdonotpersistacrossreboot.Additionalsessionstothetargetmighthave
performancebenefits,
buttheresultofcloningdependsentirelyonthearray.Youmustlogoutfroman
iSCSIsessionifyouwanttocloneasession.Youcanusetheesxcli iscsi session addcommandto
cloneasession.
EnablingHeaderandDataDigest.IfyouareloggedintoasessionandwanttoenabletheHeaderand
DataDigestparameters,youmustsettheparameter,removethesession,andaddthesessionbackforthe
parameterchangetotakeeffect.YoumustlogoutfromaniSCSIsession
ifyouwanttocloneasession.
Establishingtargetspecificsessions.Youcanestablishasessiontoaspecifictargetport.Thiscanbe
usefulifyourhostconnectstoasingleportstoragesystemthat,bydefault,presentsonlyonetargetport
toyourinitiator,butcanredirectadditionalsessionstoadifferenttargetport.Establishinga
newsession
betweenyouriSCSIinitiatorandanothertargetportcreatesanadditionalpathtothestoragesystem.
Thefollowingexamplescenariousestheavailablecommands.Runesxcli iscsi session --helpandeach
commandwith--helpforreferenceinformation.Theexampleusesaconfigurationfiletologintothehost.
Specifyoneof
theoptionslistedin“ConnectionOptionsforvCLIHostManagementCommands”onpage 18
inplaceof<conn_options>.
CAUTIONSomestoragesystemsdonotsupportmultiplesessionsfromthesameinitiatornameorendpoint.
AttemptstocreatemultiplesessionstosuchtargetscanresultinunpredictablebehaviorofyouriSCSI
environment.