Vmware Command Line Management In VSphere 5.0 For Service Console Users ESXI 6.0 V Sphere 5 And 6 Vcenter Server 60 En
User Manual: vmware ESXI - 6.0 - Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users Free User Guide for VMware ESXI Software, Manual
Open the PDF directly: View PDF
.
Page Count: 30
- Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users

Technical Note
VMware, Inc. 1
Command-Line Management in vSphere 5 and
vSphere 6 for Service Console Users
ESXi 6.0
StartingwithvSphere5.0,theserviceconsole(alsocalledconsoleOSorCOS)withitsassociatedLinux
installationisnolongeravailable.IfyouarecurrentlyusingESXserviceconsolecommands,scripts,agents,or
logs,thistechnicalnotehelpsyoutransitiontoanoff‐hostimplementationortousetheESXiShellinspecial
cases.
ThefocusofthisdocumentisonESXCLIcommandsandvicfg-commands.CommandsinthedCLI
commandset,availableinvSphere6.0andlater,areinitiallyformanagingvCenterservicesandnotforhost
management.Thesecommandsarenotdiscussedinthisdocument.
“Introduction”onpage 1
“TransitioningServiceConsoleCommands”onpage 2
“ESXiShellAccess”onpage 5
“ReplacingAgents”onpage 10
“LogginginvSphere5andLater”onpage 10
“RetrievingNetworkingInformation”onpage 13
“A d d i n g Third‐PartyExtensionstoHosts”onpage 13
“ReferencetoReplacementsforServiceConsoleCommands”onpage 13
Introduction
InvSphere5.xandvSphere6.x,VMwareoffersthefollowingtools,CLIs,andAPIsthatreplaceESX4.xservice
consolecomponents.
IMPORTANTChangesmadetothehostusingtheDCUI,thevSphereClient,ESXCLI,orotheradministrative
toolsarecommittedtopermanentstorageeveryhourorupongracefulshutdown.Changesmightbelostifthe
hostfailsbeforetheyarecommitted.
CLI or Tool Description Availability
vCLI IncludesESXCLIcommands,vicfg-
commands,andafewothercommandsfor
managingvSphere.
InstallavCLIpackageonaWindowsorLinux
systemorruncommandsfromvMA.
PowerCLI PowerCLIcmdletsformanagingESXihostsand
virtualmachines.
InstallMicrosoftPowerShellonaWindows
system,andinstallvSpherePowerCLItorun
bothPowerShellandPowerCLIcmdletfromthe
PowerCLIprompt.

VMware, Inc. 2
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Transitioning Service Console Commands
Ifyouarecurrentlymanagingyourenvironmentwithserviceconsolecommands,youcanperformthesame
managementtasksinvSphere5.0andvSphere5.1inoneofthefollowingways.
UseoneofthevSphereClientinterfaces.
InstallvCLIorPowerCLIonamanagementserver,writescriptswiththosecommands,andrunthescripts
againsttargethosts.See“RunningvCLIorPowerCLICommandsfromRemoteHosts”onpage 3.
Forcertaintroubleshootingandadvancedmanagementcommands,usecommandsfromtheESXCLI
commandsetdirectlytheESXiShell.See“UsingtheESXiShell”onpage 5.
Figure 1illustratesthedifferencesbetweenCLIsinESXi4.1andESXi5.0andlater.
InESX4.1,afairlylargesetofserviceconsolecommandsisavailable.AsmallsetofESXCLIcommands
isavailableinboththeserviceconsoleandaspartofthevCLIpackage.ThevCLIpackageincludes,in
additiontoESXCLIcommands,asetofvicfg-commandsandothercommandsforhostmanagement.
ESXi5.0andlaterdoesnotincludeaserviceconsole.IntheESXiShell,youcanrunamuchexpandedset
ofESXCLIcommandsandasmallsetofothercommands.ThesameESXCLIcommands,aswellasafew
othercommands,areincludedinthevCLIpackageforoff‐hostmanagement.
vMA ALinuxvirtualappliancethatincludesthe
vSphereSDKforPerlandthevCLIpackage.
Alsosupportsthevi‐fastpassauthentication
component.
DeployvMAonanESXisystemandrun
commandsagainstauthenticatedtargetservers
fromvMA.
ESXiShell
commands
Setoftroubleshootingcommandstousewhen
vCLIcannotaccessyourESXisystem.Includes
ESXCLIcommandsandesxcfg-commands
(deprecated).
TheESXiShellisdisabledbydefault.Youcan
enabletheShellforlocalorremoteaccess.
CLI or Tool Description Availability
ESX 4.x Service Console vSphere 5.0 and vSphere 5.1 See
Serviceconsolecommands Off‐hostmanagementwithvCLI.
InstallonWindowsorLinuxorusevMA.
“TransitioningServiceConsole
Commands”onpage 2.“Referenceto
ReplacementsforServiceConsole
Commands”onpage 13listsvCLIor
ESXCLIreplacementsforserviceconsole
commandsandpointstomigrationlists
inthistechnicalnote.
Serviceconsolecommands Off‐hostmanagementwithVMware
PowerCLIcmdletsfromaWindowssystem.
GettingStartedwithvSphere
Command‐LineInterfaces
vSphereCommand‐LineInterfaceSolutions
andExamples
Serviceconsolecommands On‐hostmanagementintheESXiShellis
possibleifsystemfailuresorotherissues
preventyoufromusingoff‐hostmanagement
commands.
ESXiShellisdisabledbydefault
See“ESXiShellLocalAccess”onpage 5
and“RemoteAccesstoESXiShellUsing
SSH”onpage 7.
Agents IfyourunagentsintheESX4.xservice
console,youcanreplacethemwith
infrastructureservicesinmanycases.
Runningthird‐partyagentsintheESXiShell
isnotsupported.
“ReplacingAgents”onpage 10.
Linuxnetworking
commands.
NotavailableintheESXiShell.UseESXCLI
commandsinstead.
See“RetrievingNetworking
Information”onpage 13.
Serviceconsolelogs Fine‐grainedcontroloversystemlogsis
available.Youcansendlogstothelocal
systemortoaremotehost.
“LogginginvSphere5andLater”on
page 10

VMware, Inc. 3
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Figure 1. Command-Line Interfaces in ESX 4.1 and ESXi 5.0 and later
Using vSphere Client Interfaces
MosttasksyouperformintheESXServiceConsolecanbeperformedbyoneofthegraphicaluserinterfaces
toESXiorvCenterServersystems.Theinterfacesallowyoutomanageyourinfrastructure,andtoperform
operationsonmultiplehostsatthesametime.
InstallthevSphereClientontheWindowssystemofyourchoiceandconnecttoanESXiorvCenterServer
system.Performmanagementoperationsusingtheclient.
UsethevSphereWebClientfromoneofthesupportedbrowsers.ThevSphereWebClientisanew
interfaceandsupportsprimarilyoperationsonvirtualmachines.
vSphere5documentationexplainshowtoperformtasksbyusingoneoftheclientUIs.Onlinehelpisavailable
frombothclientUIs.
Running vCLI or PowerCLI Commands from Remote Hosts
IfyouhavescriptsthatuseESX4.xserviceconsolecommandsorruncommandsintheESX4.xserviceconsole
directly,runningvCLIcommandsorPowerCLIcmdletsfromthehostonwhichyouinstalledthosepackages
givesthebestresults.Runningoff‐hostishighlyrecommendedbecauseitfacilitatesscripting.
YoucanusevCLIevenifhostsareinlockdownmodebytargetingthevCenterServersystemandspecifying
thetargetESXihostwiththe--vihostparameter,forexample:
esxcli --server <my_vc> --vihost <my_esxi> [<authentication>] storage nfs list
Ifyoudonotspecifyadditionalauthenticationparameters,thevCLIinfrastructurepromptsforausername
andpasswordforthevCenterServersystemspecifiedby--server.
vCLI Command Set
ThevCLIcommandsetincludescommonsystemadministrationcommandswhichyoucanrunagainstESXi
systemsfromanymachinewithnetworkaccesstothosesystems.YoucanalsorunmostvCLIcommands
againstavCenterServersystemandtargetanyESXisystemthatvCenterServersystemmanages.
InstallthevCLIcommandsetonasupportedversionsofWindowsorLinux.Theuserrunningacommand
againstaservermustbeauthenticatedforthatserver.ThevCLIpackageincludesseveralcommandsets.
ESXCLIESXCLI
vCLI
ESXCLI ESXCLI
vicfg-and other
commands
vicfg-and other commands
Service console commands
esxcfg-
(deprecated)
POSIX
(subset)
ESX 4.1
ESXi 5
Commands running on host
vCLI
Commands running on host

VMware, Inc. 4
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
ThefollowingdocumentationhelpsyouworkwithvCLIcommands.
GettingStartedwithvSphereCommand‐LineInterfacesgivesoverviewsofavailablecommandsandincludes
instructionsforinstallingvCLIonWidowsorLinuxanddetailedinformationaboutconnectionoptions.
vSphereCommand‐LineInterfaceConceptsandExamplespresentsusageexamplesformanycommands,such
assettingupsoftwareandhardwareiSCSI,addingvirtualswitches,settingupActiveDirectory
authentication,andsoon.Thedocumentincludesthesameexamplewiththevicfg-commandandthe
ESXCLIcommandwheresupported.
vSphereCommand‐LineInterfaceReferenceisareferencetobothvicfg-commandsandESXCLIcommands.
Thevicfg-commandhelpisgeneratedfromthePODavailableforeachcommand,runpod2htmlfor
anyvicfg-commandtogenerateindividualHTMLfilesinteractively.TheESXCLIreferenceinformation
isgeneratedfromtheESXCLIhelp.
Running ESXCLI Commands Against ESXi 4.x Hosts
WhenyourunanESXCLIvCLIcommand,youmustknowthecommandssupportedonthetargethost
specifiedwith--serverorasavMAtarget.
IfyouruncommandsagainstESXi4.xhosts,ESXCLI4.xcommandsaresupported.
IfyouruncommandsagainstESXi5.0hosts,ESXCLI5.0commandsandmostESXCLI5.1commandsare
supported.CommandsthatarenewinESXCLI5.1arenotsupported.
IfyouruncommandsagainstESX5.1hosts,ESXCLI5.0commandsandallESXCLI5.1commandsare
supported.
VMwarepartnersmightdevelopcustomESXCLIcommandsthatyoucanrunonhostswherethepartnerVIB
hasbeeninstalled.
Runesxcli --server <target> --helpforalistofnamespacessupportedonthetarget.Youcandrill
downintothenamespacesforadditionalhelp.
PowerCLI Cmdlet Set
VMwareoffersacomprehensivesetofPowerCLIcmdlets.YoucaninstallthePowerCLIpackageona
WindowssystemonwhichMicrosoftPowerShellisinstalledandusePowerCLIcmdletstomanagehostsand
virtualmachines.PowerCLIcmdletsandvCLIcommandsoverlapinfunctionality.ThePowerCLIfocusison
virtualmachinemanagement.ThevCLIfocusisonhostmanagement.
SeethevSpherePowerCLIdocumentationset,availableintheVMwareAdministrationAutomationProducts
sectionofhttp://www.vmware.com/support/pubs.
Command Set Description
ESXCLIvCLI
commands
ExtensiblecommandframeworkformanagingmanyaspectsofvSphere.
Runesxcli --helptoseealltop-levelnamespaces.Youcanrun--helpatanylevelofthe
hierarchy.
TheesxclicommandsetintheESXiShellandtheesxclivCLIcommandsetsupportthesame
functionality.WhenrunningvCLIcommands,youmustspecifythetargetserverand
authenticationoptions.
vicfg- (esxcfg-)
vCLIcommands
SetofcommandsformanagingmanyaspectsofvSphere.Foreachvicfg-vCLIcommand,the
packageincludesanesxcfg-vCLIcommandthatisequivalentofthevicfg-vCLIcommand.
Important:esxcfg-vCLIcommandsarenotalwaysequivalenttocorrespondingesxcfg-
serviceconsoleorESXiShellcommands.
vicfg-commandswillbedeprecatedinfuturereleases.Useesxclicommandsinsteadwhere
possible.
Management
commands
Asmallsetofmanagementcommandsisavailable.Commandsincludevifsforfilemigration,
vmware-cmdformanagingvirtualmachines,andvmkfstoolsforVMFSfilemanagement.
IMPORTANTESXCLIonESX4.xhostsdoesnotsupporttargetingavCenterServersystem.Youcantherefore
notruncommandswith--serverpointingtoavCenterServersystemevenifyouinstallvCLI5.0orvCLI5.1.

VMware, Inc. 5
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Using the ESXi Shell
EachESXihostincludesanESXiShell,whichisdisabledbydefault.Administratorscanusethatshellto
performtroubleshootingandadvancedtaskssuchastestingscriptsinnonproductionenvironments.
Youcanaccesstheshellasfollows:
Enablelocalaccessandusethelocalshellonthephysicalconsoleorusingaserialport.See“ESXiShell
LocalAccess”onpage 5.
EnableSSHaccessandusetheshelloveramanagementnetworkwithSSH.See“ESXiShellAccess”on
page 5.
TheESXiShellincludesthefollowingcommandsets.
ESXi Shell Access
AnESXisystemincludesadirectconsolethatallowsyoutostartandstopthesystemandtoperformalimited
setofmaintenanceandtroubleshootingtasks.ThedirectconsoleincludestheESXiShell.TheESXiShell
includesasetoffullysupportedESXCLIcommandsandasetofcommandsfortroubleshootingand
remediation.YoumustenableaccesstotheESXiShellfromthedirectconsoleofeachsystem.Youcanenable
accesstothelocalESXiShelloraccesstotheESXiShellwithSSH.
ESXi Shell Local Access
TheESXiShellisdisabledbydefault.YoucanenabletheESXiShellfortroubleshootingfromthedirectconsole.
AllESXCLIcommandsthatareavailableintheESXiShellarealsoincludedinthevCLIpackage.Installthe
vCLIpackageordeploythevMAvirtualappliance,andruncommandsagainstyourESXihosts,insteadof
runningcommandsintheESXiShellitself.SeeGettingStartedwithvSphereCommand‐LineInterfaces.
IMPORTANTESXiShellisintendedforexperiencedCLIusers.Minorerrorsintheshellcanresultinserious
problems.InsteadofrunningcommandsdirectlyintheESXiShell,usevCLIcommandsorPowerCLIcmdlets.
Command Set Description
ESXCLIcommands ExtensiblecommandframeworkformanagingmanyaspectsofvSphere.
Runesxcli --helptoseealltop-levelnamespaces.Youcanrun--helpatanylevelofthe
hierarchy.
TheesxclicommandsetintheESXiShellandtheesxclivCLIcommandsetsupportthesame
functionality.WhenrunningvCLIcommands,youmustspecifythetargetserverand
authenticationoptions.
esxcfg-commands
(deprecated)
SetofcommandsformanagingmanyaspectsofvSphere.Mostesxcfg-commandsavailable
intheESX4.xserviceconsoleareavailableintheESXiShellbutaredeprecatedinESXi5.0and
willberemovedinafuturerelease.
UseESXCLIcommandsinsteadofesxcfg-commands.IfnoESXCLIcommandexists,usethe
vicfg-commandsinthevCLIcommandset.
Othercommands AsmallsetofPOSIX-stylecommandsisincludedintheshell(see“ShellCommands”on
page 9).ThesecommandsarenotsupportedbyVMwarebutareincludedforusein
troubleshootingsituations.UsethevSphereClientorVMwarecommandsinsteadwhere
possible.
localclicommands SetoftroubleshootingcommandsforusewithVMwareTechnicalSupport.localcli
commandsequivalenttoESXCLIcommandsbutbypassthehostdaemon(hostd).
Warning:localclicommandsareonlyforsituationswhenhostdisunavailableandcannot
berestarted.Afteryourunalocalclicommand,youmustrestarthostd.Usinglocalcli
commandsinothersituationsisnotsupported.Aninconsistentsystemstateandpotential
failurecanresult.
NOTEForsecurityreasons,youshouldenableESXiShellonlywhenrequired.
VMware, Inc. 6
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Enabling the ESXi Shell
YoucanenabletheESXiShellfromthedirectconsoleandfromthevSphereClient.EnablingtheESXiShell
meansmakingitaccessibleasalocalconsoleavailabledirectlyoroveranout-of-bandnetwork.
To enable the ESXi Shell from the Direct Console
1AccessthedirectconsoleoftheESXihost,pressF2,andprovidecredentialswhenprompted.
2Scroll
toTroubleshootingOptions,andpressEnter.
3 SelectEnableESXiShellandpressEnter.
Ontheleft,EnableESXiShellchangestoDisableESXiShell.Ontheright,ESXiShellisDisabled
changestoESXiShellisEnabled.
4 (Optional)Configurethetime-outfortheESXiShell
a SelectModifyESXiShelltimeoutandpressEnter.
bEnterthetime-outvalueinminutesandpressEnter.
5PressEscuntilyoureturntothemaindirectconsolescreen.
YoucanenabletheESXiShellfromthevSphereClient.
To enable the local or remote ESXi Shell from the vSphere Client
1 Selectthehost,clicktheConfigurationtab,andclickSecurityProfileintheSoftwarepanel.
2IntheServicessection,clickProperties.
3 SelectESXiShellandclickOptions.
4 ChangetheESXiShelloptions.
Totemporarilystartorstoptheservice,clicktheStartorStopbutton.
Toenableaccesspermanently,clickStartandstopwithhost.Thechangewilltakeeffectthenexttime
yourebootthehost.
5ClickOK.
AfteryouhaveenabledtheESXiShell,youcanuseitfromthatmonitororthroughanout-of-bandnetwork
connection.
To enable to local or remote ESXi Shell from the vSphere Web Client
1 Selectthehost,clicktheManagetab,andclickSettings.
2UnderSystem,selectSecurityProfile.
3IntheServicespanel,clickEdit.
4 Selectaservicefromthelist.
ESXiShell
SSH
DirectConsoleUI
5ClickServiceDetailsandselectthestartuppolicyStartandstopmanually.
WhenyouselectStartandstopmanually,theservicedoesnotstartwhenyourebootthehost.Ifyouwant
theservicetostartwhenyourebootthehost,selectStartandstopwithhost.
6 SelectStarttoenabletheservice.
7ClickOK.
AfteryouhaveenabledtheESXiShell,youcanuseitfromthatmonitororthroughanout-of-bandnetwork
connection.
VMware, Inc. 7
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Setting Timeouts for the ESXi Shell
TheESXiShellsupportsavailabilitytimeoutandidletimeouts.Bydefault,eachtimeoutisdisabled.
Availabilitytimeout.TheamountoftimethatcanelapsebeforeyoumustloginaftertheESXiShellis
enabled.Afterthetimeoutperiod,theserviceisdisabledandusersarenotallowedtologin.
Idletimeout.Theamountoftimethatcanelapsebeforetheuserisloggedoutofanidleinteractive
sessions.ChangestotheidletimeoutapplythenexttimeauserlogsintotheESXiShellanddonotaffect
existingsessions.
To set ESXi Shell timeouts from the Direct Console
1FromtheTroubleshootingModeOptionsmenu,selectModifyESXiShellandSSHtimeoutsandpress
Enter.
2EntertheavailabilitytimeoutandpressEnter.
3EntertheidletimeoutandpressEnter.
4PressEscuntilyoureturntothemainmenuoftheDirectConsoleInterface.
To set ESXi Shell timeouts from the vSphere Web Client
1 Selectthehostintheinventory,clicktheManagetab,andclickSettings.
2UnderSystem,selectAdvancedSystemSettings.
3Intheleftpanel,clickUserVars.
4 SelectUserVars.ESXiShellTimeOutandclicktheEditicon
5Entertheavailabilitytimeoutinminutes.
YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect.
6 SelectUserVars.ESXiShellInteractiveTimeOutandclicktheEditicon
7Entertheavailabilitytimeoutinminutes.
YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect.
8ClickOK.
Accessing the ESXi Shell with the Direct Console
AfteryouenableESXiShellaccess,youcanaccessthelocalshell.
To access the local ESXi Shell
1Atthemaindirectconsolescreen,pressAlt-F1toopenavirtualconsolewindowtothehost.
2Providecredentialswhenprompted.
Whenyoutypethepassword,charactersarenotdisplayedontheconsole.
3Tologout,typeexitintheshell.
4Toreturntothedirectconsole,pressAlt-F2.
Remote Access to ESXi Shell Using SSH
IfSecureShellisenabledfortheESXiShell,youcanrunshellcommandsbyusingaSecureShellclientsuch
asSSHorPuTTY.
Enabling SSH for the ESXi Shell
Bydefault,youcannotaccesstheESXiShellusingaSecureShellclient.YoucanenableSSHaccessfromthe
directconsole.

VMware, Inc. 8
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
To enable SSH access in the direct console
1AtthedirectconsoleoftheESXihost,pressF2andprovidecredentialswhenprompted.
2ScrolltoTroubleshootingOptions,andpressEnter.
3 SelectEnableSSHandpressEnteronce.
Ontheleft,EnableSSHchangestoDisableSSH.Ontheright,SSHisDisabledchangestoSSHis
Enabled.
4Press
Escuntilyoureturntothemaindirectconsolescreen.
YoucanenableremotecommandexecutionfromthevSphereClient.
To enable SSH from the vSphere Client
1 SelectthehostandclicktheConfigurationtab.
2ClickSecurityProfileintheSoftwarepanel.
3IntheServicessection,clickProperties.
4 SelectSSHandclickOptions.
5 ChangetheSSHoptions.
Totemporarilystartorstoptheservice,clicktheStartorStopbutton.
ToenableSSHpermanently,clickStartandstopwithhost.Thechangetakeseffectthenexttimeyou
rebootthehost.
6ClickOK.
AfteryouhaveenabledSSH,youcanuseanSSHclienttologintotheESXiShellandrunESXiShell
commands.
Accessing the ESXi Shell with SSH
IfSSHisenabledonyourESXihost,youcanuseanSSHclienttoruncommandsonthatshell.
To access the ESXi Shell with SSH
1OpenanSSHclient.
2SpecifytheIPaddressordomainnameoftheESXihost.
PrecisedirectionsvarydependingontheSSHclientyouuse.Seevendordocumentationandsupport.
3Providecredentialswhenprompted.
ESXi Shell Commands
TheESXiShellincludesseveralsetsofcommands.
Table 1. ESXi Shell Commands
Command Set Description
ESXCLIcommands AlargesetofnewESXCLIcommandssupportsmanyadministrativetasks.Thecommandsare
fullysupportedandtestedbyVMwareandincludecommand-linehelp.SeeGettingStartedwith
vSphereCommand‐LineInterfaces.
esxcfg-commands Theesxcfg- commandsavailableintheserviceconsolearedeprecated.Thecommandswill
beremovedfromtheESXiShellinafuturerelease.See“ReferencetoReplacementsforService
ConsoleCommands”onpage 13.

VMware, Inc. 9
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
ESXCLI Commands
TheESXiShellinESXi5includesalargesetofnewESXCLInamespacesandcommands.ThecompleteESXCLI
commandsetisalsopartofthevCLIpackage.TheESXCLIcommandsyntaxinESXi5ismoreflexiblethan
thesyntaxinESXi4andsupportsmultiplenamespaces.
esxcli [dispatch_option] <namespace> [namespace, ...] <cmd> [cmd_options]
Eachcommandcanuseanarbitrarynumberofnamespaces,anddifferentcommandshaveadifferentnumber
ofelements.Allcommandshavealsobeenreviewedforconsistencyandmostcommandshavebeenrenamed.
Forexample:
Eachgetcommandreturnssinglevalues.
esxcli hardware memory get
Thelistcommandsareusedformultiplereturnvalues.
esxcli hardware cpu list
Manycommandshaveoptions.Useanequalsignoraspacebetweentheoptionandtheoptionvalue.
esxcli storage nfs add --host=<host_name> --share=<share_name> --volume=<volume_name>
esxcli storage nfs add --host <host_name> --share <share_name> --volume <volume_name>
Shell Commands
IncontrasttoVMwareESX,VMwareESXidoesnotincludeaconsoleOSwithalargesetofshellcommands
andothersoftware.However,asmallsetofshellcommandsisavailableintheESXiShell.
Youcanseealistofcommandsin/usr/bin.Whenyoulistthecommandswithls -al,noticethatseveralof
theutilitiesareredirectedtocommandsappropriateinthevSphereenvironment.Thefollowingcommands
producedifferentresultsthantypicalshellcommands.
Severalcommandsareredirectedtovmkvsitools.
Pingcommandsareredirectedtovmkping.
SomeadditionalcommandsareavailableintheESXiShellforcertaintroubleshootingtasks.Usethese
commandswheninstructedbyaVMwareKnowledgeBasearticleorVMwareTechnicalSupportstaff.
Usermanagementcommandsaredeprecated.
Goto/usr/binandrunls -atoseeacompletelist.
POSIX-like
commands
See“ShellCommands”onpage 9.
localclicommands SetoftroubleshootingcommandsforusewithVMwareTechnicalSupport.localcli
commandsareequivalenttoESXCLIcommandsbutbypassthehostdaemon(hostd).
Warning:localclicommandsareonlyforsituationswhenhostdisunavailableandcannot
berestarted.Afteryourunalocalclicommand,youmustrestarthostd.Usinglocalcli
commandsinothersituationsisnotsupported.Aninconsistentsystemstateandpotential
failurecanresult.
IMPORTANTForacompletelistofESXCLIcommands,seethevSphereCommand‐LineInterfaceReference.The
vSphereCommand‐LineInterfaceConceptsandExamplesdocumentillustrateshowtoperformcommontaskswith
ESXCLIorvicfg-commands.
IMPORTANTThecommandsarenottestedorsupportedbyVMware.UseVMwarecommandssuchas
ESXCLI,vicfg-commands,andsoon,instead.
IMPORTANTvmkvsitoolsisintendedforusewithVMwareTechnicalSupport.Donotuse
vmkvsitoolstomanageyoursystem.
Table 1. ESXi Shell Commands (Continued)
Command Set Description

VMware, Inc. 10
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Replacing Agents
WithESX4.x,managementagentsandhardwaremonitoringandmanagementagentsrunintheservice
console.WithESXi5,agentsareimplementedinotherways.
Managementagents.VMwarepartnerscreatemanagementagentsbyusingoneofthevSphereAPIs.
Hardwareagents.DevelopersuseCIM(CommonInformationModel)agents.CIMisastandards-based
approachtomonitoringhardwareresources.CIMoutputisreadablebythird-partymanagementtools.
TheVMkernelcanincludebothVMwareCIMprovidersandPartnerCIMproviders.UseavSphereClient
loggedintoavCenterServersystemtoviewhardwareinformationincludingalarms.UsethevSphere
ClientextensionframeworkorthevSphereCIMSDKforcustomization.
Infrastructureserviceagents.AdministratorscanuseagentsavailableintheESXiShell.Agentsinclude
hostd(hostdaemon),vpxa,NTP,syslog,SNMP,andsoon.UsethevSphereSDK,vCLIcommands,or
ESXCLIcommandstomanagetheagents.
Logging in vSphere 5 and Later
LogginginvSphere5hasbeensignificantlyenhanced.Younowhavefine-grainedcontroloversystemlogs,
thelocationwherelogsaresent,and,foreachlog,defaultsizeandrotationpolicy.Youcansetuploggingwith
thevSphereClientorwiththeesxcli system syslogcommand.Youcanalsosetuploggingbehaviorfora
hostbyusingtheHostProfilesinterfaceinthevSphereClientandcanthenimportthathostprofileintoother
hosts.
Remote Logging Setup in ESXi
YoucanmovemostESXilogginginformationoffthehost.Collectingdatatoacentrallocationisespecially
usefulforhostsprovisionedwithAutoDeploy.Youcanperformthesetasks:
SetupNTPontheESXihostsyouaremonitoringandonthesystemsthathosttheloggingservicesorstore
thelogs.YoucanusethevSphereClientorthevicfg-ntpvCLIcommandtosetupNTP.
Configuresyslogtosavelogstoaremotehost.Youcansendlogstoaspecificdirectory,andconfigure
subloggers.See“UsingESXCLIforSyslogConfiguration”onpage 10.
vCenterServerandESXihaveSNMPagents.YoucansetupthevCenterServerSNMPagentwiththe
vSphereClient.YoucansetuptheESXiSNMPagentwiththevSphereClientortheesxcli system snmp
commands.SeevSphereCommand‐LineInterfaceSolutionsandExamples.
ListenforCIMindications.
Using ESXCLI for Syslog Configuration
Theesxcli system syslogcommandallowsyoutoconfiguretheloggingbehaviorofyourESXisystem.
YoucanperformthesamecustomizationswiththevSphereclient,asdiscussedinthevCenterServerandHost
Managementdocumentation.Thecommandhasthefollowingoptions:
Table 2. Infrastructure Services for Production Environments
Function ESX ESXi Management
Timesynchronization NTPagentinservice
console
Built-inNTPservice vicfg-ntpcommand
Centralizedlogcollection Syslogagentinservice
console
Built-inSyslogservice esxcli system syslog
commands
vSphereClient
SNMPmonitoring SNMPagentinservice
console
Built-inSNMPserviceesxcli system snmp
command
Localaccess
authentication
ActiveDirectory(AD)
agentinserviceconsole
BuiltinActiveDirectory
service
Built-inActiveDirectory
service
vSphereClient
vicfg-authconfigvCLI
command.

VMware, Inc. 11
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
esxcli system syslog Examples
Thefollowingworkflowillustrateshowyoumightuseesxcli system syslogforlogconfiguration.
1Showconfigurationoptions.
esxcli system syslog config get
Default Rotation Size: 1024
Default Rotations: 8
Log Output: /scratch/log
Logto Unique Subdirectory: false
Remote Host: <none>
2Setalllogstokeeptwentyversions,thenstartoverwritingtheoldestlog.
esxcli system syslog config set --default-rotate=20
3SettherotationpolicyforVMkernellogsto10rotations,rotatingat2MB.
esxcli system syslog config logger --id=vmkernel --size=2048 --rotate=10
4Sendlogstoremotehostmyhost.mycompany.com.ThelogswillusethedefaultUDPport,514.
esxcli system syslog config set --loghost='myhost.mycompany.com'
5Sendlogs/scratch/mylogsontheremotehostmyhost.mycompany.comusingTCP/IPport1514.
esxcli system syslog config set --loghost='tcp://myhost.mycompany.com:1514'
--logdir='/scratch/mylogs'
6Sendalogmessageintoalllogssimultaneously.
esxcli system syslog mark --message="this is a message!"
7Reloadthesyslogdaemonandapplyconfigurationchanges.
esxcli system syslog reload
Viewing Logs in the ESXi Shell
IntheESX4.xshell,thelocationforlogsis/var/log.IntheESXiShell,youcanalsofindallcurrentlogsinthe
/var/logdirectory.Someofthelogsaresymboliclinkstothe/var/run/logdirectory.
Table 3. esxcli syslog Options
Option Description
mark Markalllogswiththespecifiedstring.
reload Reloadtheconfigurationandupdateanyconfigurationvaluesthathavechanged.
config get Retrievethecurrentconfiguration.
config set Settheconfiguration.Useoneofthefollowingoptions.
--logdir=<path>–Savelogstoagivenpath.
--loghost=<host>–Sendlogstoagivenhost(seediscussiononloghostformat
below)
--logdir-unique=<true|false>–Specifywhetherthelogshouldgotoaunique
subdirectoryofthedirectoryspecifiedinlogdir.
--default-rotate=<int>–Defaultnumberoflogrotationstokeep
--default-size=<int>–Sizebeforerotatinglogs,inkilobytes.
config logger list Showcurrentlyconfiguredsub-loggers.
config logger set Setconfigurationoptionsforaspecificsublogger.Useoneofthefollowingoptions:
--id=<str>–IDoftheloggertoconfigure(required)
--reset=<str>–Resetvaluestodefault
--rotate=<long>–Numberofrotatedlogstokeepforaspecificlogger(requires
--id)
--size=<long>–Setsizeoflogsbeforerotationforaspecificlogger,inkilobytes
(requires--id)

VMware, Inc. 12
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Mostlogsareattoplevelandnotinsideadirectoryunder/var/run/log.Availablelogsdependonwhich
pluginsareinstalledandwhatotherchangesmighthavebeenmadetothesystem.Thefollowingtablelists
somefrequentlyusedlogsintheESXiShell.
Core Dump Setup for ESXi
Acoredumpcanbeusedtodeterminethereasonforsystemfailure.WithESX,thecoredumpwasplacedon
thelocaldiskinmanycases.WithESXi,youhavetwooptionsformanagingcoredumps.
CreateadiagnosticpartitiononSANstorage.Eachhostmusthaveadiagnosticpartitionof100MB.If
multiplehostsshareaSAN,configureadiagnosticpartitionwith100MBforeachhost.
InstallandconfigureESXiDumpCollector.NewinESXi,theDumpCollectorserviceallowsyoutosend
coredumpstoanetworkserver.ESXiDumpCollectorisespeciallyusefulfordeterminingreasonsfor
failureofESXihostsprovisionedwithAutoDeploy.
Youcanuseesxcli system coredumptoconfigurearemoteorlocalcoredumppartition.Youcanalsouse
theNetworkConfigurationhostprofiletosetuphoststouseESXiDumpCollector.Foreithercase,youcan
applythehostprofileofahostthatusesESXiDumpCollectortootherhosts.
To use ESXi Dump Collector
1InstalltheESXiDumpCollectorserviceonthevCenterServersystemoraWindowsorLinuxsystemof
yourchoice.
ESXiDumpCollectorisoneoftheservicesyoucaninstallusingthevCenterServersysteminstallation
package.SeevSphereInstallationandSetup.
IfyouusethevCenterServeronLinuxappliance,ESXiDumpCollectorispreinstalled.
2SetupESXisystemsthatshoulduseESXiDumpCollectorwithcommandsintheesxcli system
coredumpnamespace.
Twonamespacesaresupportedinsidethisnamespace.
esxcli system coredump partition
get:Retrieveoneofthedumppartitionvalues.
list:ListallpartitionsonthesystemthathaveapartitiontypematchingtheVMwareCore
partitiontype.
set:Setthecoredumppartitionforthissystem.
esxcli system coredump network
get:GetthecurrentlyconfigureparametersforESXiDumpCollector(networkcoredump),if
enabled.
set:Settheparametersusedfornetworkcoredump.
ThefollowingexamplesetsupthenetworkandenablesESXiDumpCollectorwiththeESXCLIvCLI
command.
esxcli --server MyESXiHost system coredump network set --interface-name vmk0 --server-ipv4 10XX...
--port 6500
esxcli --server MyESXiHost system coredump network get --enable true --type network
ESX 4.x shell ESXi 5.x shell Description
/var/log/vmware/hostd.log /var/log/hostd.log Logforthehostdaemon.
/var/log/vmkwarning /var/log/vmkwarning.log
/var/log/vmksummary /var/log/vmksummary.log
/var/log/messages /var/log/vmkernel.log VMkernelwarningsandVMkernel
events.
/var/log/vmware/vpx/vpxa.log /var/log/vpxa.log vCenterServeragentlog.

VMware, Inc. 13
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
YouarepromptedforausernameandpasswordfortheESXihost.
Retrieving Networking Information
LinuxcommandsforretrievingnetworkinginformationarenotincludedintheESXiShell.Youcaninstead
useESXCLIcommands.
OnESXi5,ifconfiginformationistheinformationfortheVMkernelNICthatattachestotheManagement
Networkportgroup.YoucanretrievethatinformationbyusingESXCLIcommands.
esxcli network ip interface list
esxcli network ip interface ipv4 get -i vmk<X>
esxcli network ip interface ipv6 get -n vmk<X>
esxcli network ip interface ipv6 address list
YoucanretrieveinformationaboutDNSwiththeesxcli network ip dnscommandinthefollowingtwo
namespaces:
esxcli network ip dns search
esxcli network ip dns server
ForinformationcorrespondingtotheLinuxnetstatcommand,usethefollowingESXCLIcommand.
esxcli network ip connection list
Adding Third-Party Extensions to Hosts
TheprocessofaddingpatchesissimplifiedinESXi5.Allpatchesandthird-partyextensionscanbemade
availableasVIBpackages.WhenaVMwarepartnerreleasesathird-partyextensionasaVIBpackage,the
partnercanmakethepackageavailableasaZIPdepot(offlinedepot).
1 DownloadtheZIPdepottoyourESXisystembutdonotunpackit.
2Runesxcli software vibtoaddthepackagetoyoursystem.
3 RebootyourESXisystem
Rebootisalwaysrecommended.Somepatchesdonotrequirereboot.
TheVIBsystemrefreshesthehostdaemonafteryourebootyoursystem.IftheVIBrequiresanexceptionto
thefirewallrules,rebootingalsoupdatesthefirewallruleset.
Youcaninsteaduseafirewallconfigurationfiletospecifyportrulesforhostservicesyouwanttoenablefor
theextension.
vSphereSecuritydocumentationdiscusseshowtoadd,apply,andrefreshafirewallrulesetandliststheesxcli
network firewallcommands.TheESXi5ruleset.xmlformatisthesameasinESX/ESXi4.x,buthastwo
additionaltags,enabledandrequired.ThefirewallonESXi5.0andonESXi5.1stillsupportstheoldformat.
vSphereUpgradedocumentationdiscussesusingesxcli software sourcesandesxcli software vibto
exploreandinstallpatchesandextensions.
Insomesituations,youmightusevSphereUpdateManagerinsteadoftheesxclicommandtoinstall
third-partyextensions.Theextensionvendorprovidesinformationontheinstallorupgradeprocess.
Reference to Replacements for Service Console Commands
Table 4listscommonESX/ESXi4.xserviceconsolecommandsandcorrespondingESXi5shellcommands.
ThelinksintheCommandcolumnofthetablepointtomoredetailedinformationforeachcommand,with
correspondingESXCLIcommandsforeachoptionwhereavailable.ClickthelinkintheMoreInformation
columnforatablewithdetailedinformationaboutthatcommand.
IMPORTANTThisdocumentdoesnotpresentacompletelistofESXCLIcommands.Thefocusisonreplacing
existingserviceconsolecommands.SeethevSphereCommand‐LineInterfaceReferenceforacompletelistof
commands.

VMware, Inc. 14
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Table 4. Replacements for Service Console Commands
Service Console
Command ESXi 5 Replacement More Information
Deprecated
ESXi Shell
esxcli SyntaxformostESXCLIcommandshaschanged.“ESXCLICommand
Syntax”onpage 15
No
esxcfg-advcfg esxcli system settings advanced “esxcfg-advcfg”onpage 17 Yes
esxcfg-dumppart esxcli system coredump “esxcfg-dumppart”on
page 18
Yes
esxcfg-firewall InESX4.x,protectstheserviceconsole.InESXi5.x,
esxcfg-firewallisnotnecessarybecausenoservice
consoleexists.
Theesxcli network firewallcommandisavailablefor
ESXifirewallmanagement.
vSphereSecurity
documentation.
N.A.
esxcfg-info ProvidesaviewoftheinternalstateoftheVMkerneland
serviceconsolecomponents.Someofthefunctionalityis
coveredbycertainESXCLIcommands.
“esxcfg-info”onpage 19 No
esxcfg-ipsec esxcli network ip ipsec “esxcfg-ipsec”onpage 20 No
esxcfg-swiscsi
esxcfg-hwiscsi
esxcli iscsi “esxcfg-swiscsiand
esxcfg-hwiscsi”onpage 21
Yes
esxcfg-module esxcli system module “esxcfg-module”on
page 23
Yes
esxcfg-mpath esxcli storage core pathcommands.“esxcfg-mpath”onpage 23 Yes
esxcfg-nas esxcli storage nfs “esxcfg-nas”onpage 24 Yes
esxcfg-nics esxcli network nic “esxcfg-nics”onpage 24 Yes
esxcfg-rescan esxcli storage corecommands. “esxcfg-rescan”onpage 25 Yes
esxcfg-route esxcli network ip routecommands “esxcfg-route”onpage 22 Yes
esxcfg-scsidevs Useesxcli storage coreandesxcli storage core
filesystemcommands.
“esxcfg-scsidevs”on
page 22
Yes
esxcfg-vmknic esxcli network ip interfacecoversmostoptionsand
includesanumberofoptionsnotavailableinthe
esxcfg-vmkniccommand.
“esxcfg-vmknic”on
page 25
Yes
esxcfg-volume esxcli storage filesystem “esxcfg-volume”on
page 26
Yes
esxcfg-vswif Usedtoconfigureserviceconsolenetworkingin4.xsystems.
NotneededandnotavailableintheESXi5.xESXiShell.
Yes
esxcfg-vswitch esxcli network vswitch standardforstandardswitches.
esxcli network vswitch dvsfordistributedswitches.
“esxcfg-vswitch”on
page 27
Yes
esxtop SupportedintheESXi5.xESXiShell.Ifyoudonothave
accesstotheESXiShell,usetheresxtopremotevCLI
commandfromasupportedLinuxsystemorfromvMA.
“esxtop”onpage 29 No
esxupdate esxclisoftware vib
Note:Bothesxupdateandvihostupdatearenotsupported
againstESXi5.0andESXi5.1hosts.
“esxupdate”onpage 29 Yes
vmkfstools ThevmkfstoolscommandisavailableintheESXi5.xESXi
Shell.ThevmkfstoolsvCLIcommandoptionsdifferslightly
fromtheshellcommandoptions.
“vmkfstools”onpage 29 No
vmkping Useesxcli network diag ping.vSphereCommand‐Line
InterfaceReference.
Yes

VMware, Inc. 15
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
ESXCLI Command Syntax
InESXi4.x,allESXCLIcommandsmustfollowthesamesyntax.
esxcli <conn_options> <namespace> <app> <cmd> [cmd_options]
InESXi5.0andESXi5.1,theESXCLIcommandsyntaxismoreflexible.Eachcommandcanuseanarbitrary
numberofnamespaces.Differentcommandshaveadifferentnumberofelements.
esxcli <conn_options> <namespace> [namespace, ...] <cmd> [cmd_options]
Updates to ESXCLI 4.x Commands
Thefollowingtablelistsequivalentcommandsforesxclicorestoragecommands.
vmware-cmd NotavailableinESXiShell.AvailableinvCLI.Inmanycases,
VMwarePowerCLIcmdletsperformthesametasksas
vmware-cmd.
Usevmware-cmd--help
forinformation.
Yes
vm-support Createsatararchivecontainingdebugginginformationfor
theserver.
ThiscommandisintendedforusewithVMwareSupport.No
equivalentvCLIcommandexists.
Usevm-support --help
formoreinformation.
No
Table 4. Replacements for Service Console Commands (Continued)
Service Console
Command ESXi 5 Replacement More Information
Deprecated
ESXi Shell
IMPORTANTYoumustupdateallESXCLIcommandsexplicitly;noscriptsareavailableforthetask.Starting
withvSphere5.0,mostmanagementcommandswillbeESXCLIcommands.
Table 5. esxcli 4.x corestorage namespace
ESXCLI in ESXi 4.x ESXCLI in ESXi 5.x
corestorage claiming reclaim --<option>
corestorage claiming unclaim --<option>
storage core claiming reclaim --<option>
storage core claiming unclaim --<option>
corestorage claimrule add --<options>
corestorage claimrule convert --commit
corestorage claimrule delete --<option>
corestorage claimrule list --claimrule
corestorage claimrule load --claimrule-class
corestorage claimrule move --<option>
corestorage claimrule run --<option>
storage core claimrule add --<options>
Severalnewoptionsforthiscommandareavailable.Seethe
vSphereCommand‐LineInterfaceReference,orrunthe
commandwith--help.
storage core claimrule convert --commit
storage core claimrule remove --<option>
storage core claimrule list --claimrule-class
storage core claimrule load --claimrule-class
storage core claimrule move --<option>
storage core claimrule run --<option>
corestorage device list --device storage core device stats get
storage core device list --device
Otherlistcommandsareincludedinthisnamespace.
corestorage plugin list --plugin-class storage core plugin list --plugin-class

VMware, Inc. 16
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Thefollowingtablelistsequivalentcommandsforesxcli storage nmpcommands.
Theesxcli networkcommandsincludedinESXCLI4.1havebeenrenamed.Manyadditionalnetworking
commandsareavailableinESXCLI5.x
Theesxcli swiscsinamespacesupportsafewmanagementcommandsforsoftwareiSCSIinESXi4.1.The
commandshavebeenrenamed.ESXCLIequivalentshavealsobeenaddedfortheesxcfg-swiscsiand
esxcfg-hwiscsicommands.
Table 6. esxcli nmp namespace
esxcli storage nmp commands in ESXi 4.x esxcli storage nmp commands in ESXi 5.x
nmp device list --list
nmp device list --device
nmp device setpolicy <option>
nmp path list [--device|--path]
nmp fixed getpreferred <option>
nmp psp list
nmp psp getconfig [--device|--path]
nmp psp setconfig
[--config|--device|--path]
nmp roundrobin getconfig <option>
nmp roundrobin setconfig <option>
nmp satp list
nmp satp listrules
nmp satp addrule <option>
nmp satp deleterule <option>
nmp satp getconfig --device
nmp satp getconfig --path
nmp satp setconfig --config --device
nmp satp setconfig --config --path
nmp satp setdefaultpsp [--boot | --psp |
--satp]
nmp device list
nmp device list --device
nmp device set <option>
nmp psp generic deviceconfig get --device
nmp psp fixed deviceconfig set <option>
nmp psp generic deviceconfig get [--device]
nmp psp generic deviceconfig set
[--config|--path]
nmp psp roundrobin deviceconfig get <option>
nmp psp roundrobin deviceconfig set <option>
nmp satp list
nmp satp rule list
nmp satp rule add <option>
nmp satp rule remove <option>
nmp satp generic deviceconfig get --device
nmp satp generic pathconfig get --path
nmp psp generic deviceconfig set
nmp psp generic pathconfig set
nmp satp set [--boot | --psp | --satp]
Table 7. esxcli network namespace
esxcli 4.x esxcli 5.x Comment
network neighbors list network ip neighbor list ListARPtableentries.
network connection list network ip connection list ListactiveTCP/IPconnections.
Table 8. esxcli swiscsi namespace
ESXCLI 4.x esxcli 5.x Comment
swiscsi nic [--add |
--list | --remove]
iscsi networkportal [add | list
| remove]
PerformoperationsontheiSCSInetwork
portal(iSCSIVMkernelNIC).
swiscsi vmknic --list iscsi logicalnetworkportal list PerformoperationsontheiSCSIlogical
networkportal.

VMware, Inc. 17
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
The4.1esxcli vmsnamespaceallowsyoutolistvirtualmachinesandforciblystopthem.Thenamespacehas
beenrenamed.
esxcfg-advcfg
Insteadofesxcfc-advcfg,useesxcli system settings advanced.Thefollowingcommandsare
supported.
swiscsi vmnic --list iscsi physicalnetworkportal
list
PerformoperationsontheiSCSIphysical
networkportal(uplink).
swiscsi session [--add |
--list | --remove]
iscsi session [add | list |
remove]
PerformoperationsoniSCSIsessions.
Note:Theaddandremovecommandsare
intendedonlyforusebyVMware
partners.
Usetheiscsi session connection
namespacetoperformoperationsonthe
iSCSIconnection.
esxcli 4.x esxcli 5.x Comment
vms vm kill vm process kill Forciblykillvirtualmachinesthatarenotrespondingtonormalstop
operations.Requiresthetypeofkilloperation(soft,hard,force)
andtheworldIDofthevirtualmachinetokill.
vms vm list vm process list DisplaytheworldIDofvirtualmachinesonthehost.
Table 9. esxcfg-advcfg Replacement Commands
esxcfg-advcfg option ESXCLI Command Description
-g|--get system settings advanced list
-o=option
GetthevalueoftheVMkerneladvanced
configurationoption.Us--optionto
retrieveinformationforasingleoption,or
--treetolimitthelisttoaspecificsubtree.
-s|--set <value> system settings advanced set SetthevalueoftheVMkerneladvanced
configurationoption.
-d|--default system settings advanced set
-d|--default
ResetaVMkerneladvancedconfiguration
optiontodefault.
-l|--list system settings advanced list ListallVMkerneladvancedconfiguration
options.
-q|--quiet Nolongersupported
-k|--set-kernel system settings kernel set SetaVMkernelloadtimeoptionvaluefor
thenextboot.
-j|--get-kernel system settings kernel list GetaVMkernelloadtimeoptionvaluefor
thenextboot.
-c|--get-config Notsupported
-m|--set-message system welcomemsg set Setthewelcomemessageforthedirect
console.Youcanretrievethemessagewith
system welcomemsg get.
-u|--uuid system uuid get EnsuretheVMkernelsystemUUIDisset
andprintit.
-G|--get-user-var system settings advanced list | grep
<var>
Getthevalueofauser-specifiedgeneric
value.
-S|--set-user-var system settings advanced set Setthevalueofauser-specifiedgeneric
value.
Table 8. esxcli swiscsi namespace (Continued)
ESXCLI 4.x esxcli 5.x Comment

VMware, Inc. 18
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
esxcfg-dumppart
WhenusingtheESXiShell,youcanconfigureyoursystemtosavecoredumpstoalocalpartitionortousethe
ESXiDumpCollectorandsavecoredumpstoaprespecifiedlocalorremotepartition.
Useesxcli coredump partitioncommandstoconfigurealocaldumppartition.
InstallESXiDumpCollectortosupportsendingcoredumpstoaremotehostandrunesxcli coredump
networkcommandstoconfiguretheremotedumppartition.
Thefollowingtableliststheesxcfg-dumppartcommandoptionsandcorrespondingESXCLIcommands.
-D|--del-user-var Addingordeletinguservariablesisnolonger
supported.
-U|--user-var --option=<str> Nameoftheuservariabletouseforwhen
retrievingandsettinguservariables.
-A|--add-option
<name>
Nolongersupported.
ThisoptionwasusedtoaddCIMoptions.Use
theCIMSDKinstead.
-T|--add-type Addingordeletinguservariablesisnolonger
supported.
-E|--add-desc Addingordeletinguservariablesisnolonger
supported.
-F|--add-default Addingordeletinguservariablesisnolonger
supported.
-N|--add-min Addingordeletinguservariablesisnolonger
supported.
-M|--add-max Addingordeletinguservariablesisnolonger
supported.
-H|--add-hidden
<val>
Addingordeletinguservariablesisnolonger
supported.
-L|--del-option
<name>
Nolongersupported.
ThisoptionwasusedtoaddCIMoptions.Use
theCIMSDKinstead.
-V|--has-option
<name>
Useesxcli system settings advanced
listtolistalloptionsinstead.
TheESXCLIcommandliststhevalueofthe
VMkerneladvancedconfigurationoptions.
Theoutputincludesthecurrentsettingfor
eachoption.
-r|--restore Nolongeravailable.Internaluseonlyin
previousversions.
IMPORTANTYoucannolongeruseesxcfg-dumpparttoenablecoredumps.UseESXCLIinstead.
Table 9. esxcfg-advcfg Replacement Commands (Continued)
esxcfg-advcfg option ESXCLI Command Description

VMware, Inc. 19
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
-
esxcfg-info
NocomprehensivesetofequivalentESXCLIcommandscorrespondingtoesxcfg-infoisavailableyet.The
followingcommandsareofferingsomeoftheesxcfg-infocapability.
Table 10. esxcfg-dumppart Replacement Commands
esxcfg-dumppart Option ESXCLI Command Description
-l | --list system coredump partition list ListallpartitionsontheESXisystem
thathavetheappropriatepartition
typetoactasadiagnosticpartition.
Important:Executionmighttake
severalminutesandslowdownyour
ESXihostbecausethecommandscans
allLUNsonthesystem.
-t | --get-active system coredump partition get Displaytheactivediagnosticpartition
forthissystem.RunningtheESXCLI
commandreturnstheactive
configuredpartition.
Ifanactivepartitionexists,the
commandreturnsthenaanumberof
theLUNandthecorresponding
partition,intheformat naa.xx...:p.
-c | --get-config system coredump partition get Gettheconfigureddiagnosticpartition
forthesystem.
-S | --smart-activate system coredump partition set
--smart --enable= true
Runthesmartactivatealgorithmto
activatetheconfigureddump
partition,orifnopartitionis
configured,selectthebestpossible
candidatebasedonthemediaofthe
availabledumppartitions.
-a | --activate system coredump partition set
--enable=true
Makethespecifiedpartitionthe
currentdiagnosticpartition.
-d | --deactivate system coredump partition set
--enable=false
Deactivatetheactivediagnostic
partitionordeactivateESXiDump
Collector.
CAUTION:Ifyourunthiscommand,
yoursystemcannotwriteerrorstoa
fileuntilanotherpartitionisactivated.
Youloseanyerrorrecordiferrors
occur.
-s <naa.xx:1> | --set
<naa.xxxxxxxx:1>
system coredump partition set
--partition xxx.xxx
Setandactivatethediagnostic
partition.Specifythepartitionusing
naa.xxx:1oreui.xxxsyntax.
-C | --copy [-n |
--newonly] [-z |
--zdumpname] [-o |
--slot]
NocorrespondingESXCLIcommand.
-L --log NocorrespondingESXCLIcommand.
Table 11. ESXCLI Information Retrieval Commands
Command Description
hardware bootdevice list Listthebootdeviceorderforthishost,ifavailable.
hardware clock get Displaythecurrenthardwareclocktime.
hardware cpu cpuid get GetinformationfromtheCPUIDinstructiononeach
CPUonthishost.
harware cpu cpuid get --cpu=<n> GetinformationfromtheCPUIDinstructiononCPU
number<n>.

VMware, Inc. 20
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
esxcfg-ipsec
InvSphere5.1,youcanusecommandsintheesxcli network ip ipsecnamespaceinplaceofthe
esxcfg-ipseccommand.
hardware cpu global get ListinformationandconfigurationglobaltoallCPUs.
hardware cpu list ListallCPUsonthishost.
hardware memory get Getinformationaboutmemory.
hardware pci list ListallthePCIdevicesonthishost.
hardware platform get Getinformationabouttheplatform.
network vswitch standard list ListthevirtualswitchesontheESXihost.
network vswitch standard policy shaping get Retrievethenetworkshapinginformationforthe
virtualswitch.
network vswitch standard policy failover get Retrievethefailoverpolicyinformationforthevirtual
switch.
network vswitch standard policy security get Retrievethesecuritypolicyinformationforthe
virtualswitch.
network vswitch standard portgroup policy shaping
get
Retrievethenetworkshapinginformationforthe
portgroup.
network vswitch standard portgroup policy failover
get
Retrievethefailoverpolicyinformationfortheport
group.
network vswitch standard portgroup policy security
get
Retrievethesecuritypolicyinformationfortheport
group.
network nic list ListthephysicalNICscurrentlyinstalledandloaded
onthesystem.
network ip interface list ListtheVMkernelnetworkinterfacescurrently
knowntothesystem.
network ip dns server list PrintalistoftheDNSservercurrentlyconfiguredon
thesystemintheorderinwhichtheywillbeused.
Table 12. esxcfg-ipsec Replacement Commands
vicfg-ipsec Option esxcli Command or Option
--action [none|discard|ipsec] | network ip ipsec sp add --action
--add-sa <sa> | network ip ipsec sa add
--add-sp <sp> | network ip ipsec sp add
--dir [in | out] | network ip ipsec sp add --flowdirection
--dst-port <port> | network ip ipsec sp add --destinationport
--flush-sa | network ip ipsec sp remove --removeall
--flush-sp | network ip ipsec sa remove --removeall
--ealgo [null | 3des-cbc | aes128-cbc]| network ip ipsec sa add --encryptionalgorithm
--ekey <e_key>| network ip ipsec sa add --encryptionkey
--ialgo [hmac-sha1 | hmac-sha2-256] | network ip ipsec sa add --integrityalgorithm
--ikey <i_key> | network ip ipsec sa add --integritykey
--list-sa <sa> | network ip ipsec sa list
--list-sp <sp> | network ip ipsec sp list
--remove-sa <sa> | network ip ipsec sa remove
Table 11. ESXCLI Information Retrieval Commands (Continued)
Command Description

VMware, Inc. 21
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
esxcfg-swiscsi and esxcfg-hwiscsi
TheESX4.xserviceconsoleincludestwocommandsforiSCSImanagement.
Theesxcfg-swiscsicommandmanagessoftwareiSCSI.EquivalentESXCLIcommandsareavailablein
vSphere5.
Theesxcfg-hwiscsicommandmanagedhardwareiSCSI.
--remove-sp <sp> | network ip ipsec sp remove
--sa-dst <destination> network ip ipsec sa add --sadestination
network ip ipsec sa remove --sadestination
--sa-src <IP> | network ip ipsec sa add --sasource
network ip ipsec sa remove --sasource
--sa-name <name> | network ip ipsec sa add --saname
network ip ipsec sa remove --saname
--sp-dst <destination> | network ip ipsec sp add --spdestination
--spi <spi> | network ip ipsec sa add --saspi
network ip ipsec sa remove --saspi
--sp-src <source> | network ip ipsec sp add --spsource
--spmode <mode> | network ip ipsec sp add --spmode
--src-port <port> | network ip ipsec sp add --sourceport
--ulproto [any | tcp | udp | icmp6] network ip ipsec sp add --sourceport
--upperlayerprotocol
Table 13. esxcfg-swiscsi Replacement Commands
esxcfg-swiscsi Option ESXCLI Command Description
-e --enable iscsi software set --enabled=true EnableSoftwareiSCSIonthesystem,if
disabled.
-D --disable iscsi software set
--enabled=false
DisableSoftwareiSCSIonthesystem,if
enabled.
-q --query iscsi software get CheckifSoftwareiSCSIisenabledor
disabledonthesystem.
-s --scan iscsi adapter discovery rediscover
-A <adapter_name>
storage core adapter rescan [-A
<adapter_name> | -all]
Scanthesystemfordisksavailablethrough
SoftwareiSCSIinterface.Callthetwo
commandsinorder.
-k --kill Notsupported
-r --restore Notsupported
Table 12. esxcfg-ipsec Replacement Commands
vicfg-ipsec Option esxcli Command or Option

VMware, Inc. 22
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
esxcfg-route
Theesxcfg-routecommandhasequivalentESXCLIcommands.Thenewcommandsethasenhanced
functionality.
esxcfg-scsidevs
Theesxcfg-scsidevscommandhasequivalentESXCLIcommandsforsomeoftheoptions.
Table 14. esxcfg-hwiscsi Replacement Commands
esxcfg-hwiscsi Option ESXCLI Command Description
-l iscsi physicalnetworkportal param get Listcurrent
configuration
-a [allow | deny]
<vmkernel_SCSI_adapter>
1.Findtheadapter.
iscsi adapter list
2.GetARPredirectioninformation.
iscsi physicalnetworkportal param get -A vmhba4
3.EnableARPredirect.
iscsi physicalnetworkportal param set --option
ArpRedirect=true -A vmhba4
AllowordenyARP
redirectiononthe
adapter.
-j [enable | disable]
<vmkernel_SCSI_adapter>
1.Findtheadapter.
iscsi adapter list
2.Getjumboframeinformation.
iscsi physicalnetworkportal param get -A vmhba4
3,SetMTUto9000toenablejumboframes.
set the mtu to 9000 to enable jumbo frames.
esxcli iscsi physicalnetworkportal param set
-o=MTU -v=9000 -A vmhbaXX
YoucanlatersetMTUbackto1500todisablejumboframes.
esxcli iscsi physicalnetworkportal param set
-o=MTU -v=1500 -A vmhbaXX
Enableordisable
jumboframesupport.
Table 15. esxcfg-rout Replacement Commands
esxcfg-route Option ESXCLI Command Description
add network ip route ipv4 add
network ip route ipv6 add
AddsanIPv4orIPv6route.Youspecifythegateway
andthenetwork.
del network ip route ipv4
remove
network ip route ipv6
remove
RemoveanIPv4orIPv6route.Youspecifythegateway
andthenetwork.
list network ip route ipv4 list
network ip route ipv6 list
ListsconfiguredIPv4orIPv6routs
--family Includedinthecommandasanamespace.
Table 16. esxcfg-scsidevs Replacement Commands
esxcfg-scsidevs Option ESXCLI Command Description
-a |--hbas storage core adapter
list
PrintthemappingsforeachSCSIhostbusadapter(HBA)to
theinformationaboutthatadapter.
-l | --list storage core device
list
Listallthestoragedevicesknowntothesystem,including
bothSCSIandnon-SCSIdevices.Thelistcanbefilteredusing
the--deviceoptiontolimittheoutputtospecificdevice.

VMware, Inc. 23
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
ESXCLIdoesnothaveequivalentoptionsforthe--device,--vfat,and--hba-device-listfiltering
options.
The-o|--offline-cos-devand-n|--online-cos-devoptionsareserviceconsolespecificoptionsandnot
applicabletoESXi5.x.
esxcfg-module
Theesxcfg-modulecommandsupportsmanipulationoftheVMkernelloadablemodulesanddevice
drivers.Forthefollowingesxcfg-moduleoptions,ESXCLIcommandsareavailable.
esxcfg-mpath
Theesxcfg-mpathcommandsupportslistinginformationaboutFibreChanneloriSCSILUNsandchanging
apath’sstate.InvSphere5,equivalentESXCLIcommandsareavailable.
-c
-u
storage core device
list
Listallthedeviceuniqueidentifiers.Includethemapping
fromprimaryidentifiertoallsecondaryidentifiers.Thelist
canbefilteredusingthe--deviceoptiontolimittheoutput
tospecificdevice.
-m
-f
storage filesystem
list
PrintthemappingsfromaVMFSvolumetothedeviceand
partitionsusedinthatVMFS.
Table 17. esxcfg-module Replacement Commands
esxcfg-module Option ESXCLI Command Description
--get-options <module_name>
-g <module_name>
system module parameters
list
Returnstheoptionstringconfiguredtobe
passedtothemodulewhenthemoduleis
loaded.
--set-options <options>
<module_name>
-s <options> <module_name>
system module parameters
set
Specifiestheoptionstringtobepassedtothe
modulewhenthemoduleisloaded.
-e --enable system module set
--enabled=true
Enablethegivenmodule,indicatingthatit
shouldloadatboottime.
-d --disable system module set
--enabled=false
Disablethegivenmoduleandpreventitfrom
loadingatboot.Disablingthemodulehasno
immediateeffectonthemodulestateona
runningsystem.
-q --query system module list
--enabled=[true|false]
Querythesystemforthemodulestoloadat
boot.
-m --mod-name -<name> Notsupported.
-u --unload Notsupported.
--list
-l
system module list
--loaded=[true|false]
ListthesetofcurrentlyloadedVMkernel
modules.
-i --show-info system module get
system module parameters
list
Showinformationaboutthemodule.This
commandcanberunagainstamodulefile.
-f --force system module <cmd>
--force
Skipmodulevalidationforalloptions.Theget
andlistcommandsdonotsupport--force.
-v --verbose -<level> Not supported Displaymoreverboseinformation.
Table 16. esxcfg-scsidevs Replacement Commands (Continued)
esxcfg-scsidevs Option ESXCLI Command Description

VMware, Inc. 24
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
esxcfg-nas
Theesxcfg-nascommandmanipulatesNASfilesystemsassociatedwithESXisystems.InvSphere5,
equivalentESXCLIcommandsareavailable.
ESXCLIalsoincludescommandstomountandunmounttheNASfilesystem.
esxcfg-nics
Theesxcfg-nicscommandmanagesphysicalNICs(uplinkadapters)usedbyanESXihost.InvSphere5,
equivalentESXCLIcommandsareavailable.
Table 18. esxcfg-mpath Replacement Commands
esxcfg-mpath Option ESXCLI Command Description
-l --list <path> |
<device>
storage core path list
storage core device list
Listdetailedinformationforallpathsonthesystem
orforthespecifiedpathordevice.
-L --list-compact Notsupported
-m --list-map storage core device list FordevicescurrentlyregisteredwiththePSA,listthe
filtersattachedtothem.(Notanexactequivalent)
-b --list-paths storage core path list Listalldeviceswiththeircorrespondingpaths,orlist
pathsforthespecifieddevice.
-G --list-plugins storage core plugin list Listallmultipathingpluginsloadedintothesystem.
Ataminimum,thiscommandreturnsNMP(Native
MultipathingPlugin).Ifothermultipathingplugins
havebeenloaded,theyarelistedaswell.
-s --state storage core path setstate
--path=<path>
--state=[active|off]
SetthestateofagivenLUNpathtoeitheractiveor
off.Thisoptionrequiresthatthe--pathoptionsisset
andspecifieseitherthepathUIDorthepathruntime
name.
Ifyouarechangingapath’sstate,thechange
operationfailsifI/Oisactivewhenthepathsettingis
changed.Reissuethecommand.Youmust
successfullyperformatleastoneI/Ooperationbefore
thechangetakeseffect.
Table 19. esxcfg-nas Replacement Commands
esxcfg-nas Option ESXCLI Command Description
--add <name>
-a <name>
storage nfs add AddanewNASfilesystemtotheESXihost.
YoumustspecifythehostnameorIPaddressofthe
NFSvolumetoadd,thesharenameontheremote
system,andthevolumenametousefortheNFS
mount.
--delete <name>
-d <name>
storage nfs remove
--volume-name=<NAS_volume_name>
RemoveanexistingNFSvolumefromtheESXihost.
ThiscommandunmountstheNASfilesystemand
removesitfromthelistofknownfilesystems.
--list
-l
storage nfs list ListallknownNASfilesystemswiththeirmount
name,sharename,andhostname.Indicatethe
mountstatusforeachfilesystem.
--host <n_host>
-o <n_host>
storage nfs add --host AddorremoveaspecifiedNAShost(notESXihost).
Usedwithotheroptions.
--readonly
-y
storage nfs add --readonly AddthenewNFSfilesystemwithread-onlyaccess.
--share <share>
-s <share>
storage nfs add --share=<share> AddorremoveaspecifiedNAShost(notESXihost.
Usedwithotheroptions.

VMware, Inc. 25
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
esxcfg-rescan
Theesxcfg-rescancommandrescansthestorageconfiguration.InvSphere5,equivalentESXCLIcommands
areavailable.
Inaddition,ESXCLIsupportsseveralotherrescancommand.Runesxcli storage core adapter rescan
--help.
esxcfg-vmknic
Theesxcfg-vmkniccommandadds,deletes,andmodifiesVMkernelnetworkinterfaces.InvSphere5,
equivalentESXCLIcommandsareavailable.
Table 20. esxcfg-nics Replacement Commands
esxcfg-nics Option ESXCLI Command Description
--auto
-a
network nic set
--auto
Setthespecifiednetworkadaptertoautonegotiateitsspeedand
duplexsettings.
--duplex
[full|half] <nic>
-d [full|half]
<nic>
network nic set
--duplex
Settheduplexvalueatwhichagivennetworkadaptershouldrun
toeitherfull(transmitdatainbothdirectionsatthesametime)or
half(transmitdatainonedirectionatatime).
--list
-l
network nic list
network nic get
<adapter>
Listinformationaboutallthenetworkadapters.Usenetwork nic
get <adapter>tolistinformationaboutonespecificadapter,for
exampleesxcli network nic get -n vmnic0
--speed <speed>
<nic>
-s <speed> <nic>
network nic set
--speed=<long>
Setthespeedatwhichagivennetworkadaptershouldrun.Valid
valuesforspeedare10,100,1000,or10000.
Table 21. esxcfg-rescan Replacement Commands
esxcfg-rescan Option ESXCLI Command Description
-a|--add storage core adapter rescan
--type=add
Scanforaddeddevices.
-d|--delete <vmhba#> storage core adapter rescan
--type=delete --adapter <vmhba#>
Scanremovingdeaddevices
-A|--all storage core adapter rescan Scanalladapters.Bydefault,thecommand
scansalladapters.Youcanspecifyindividual
adaptersbyusingthe--adapteroption.
-u|--update <vmhba#> storage core adapter rescan
--type=update --adapter <vmhba#>
Scanexistingpathsandupdatetheirstate.
Table 22. esxcfg-vmknic Replacement Commands
esxcfg- option ESXCLI Command Description
--add --ip<address>
--netmask <netmask>
<port-group-name>
network ip interface add AddaVMkernelNICtothesystem.
Whenthecommandcompletes
successfully,thenewlyaddedVMkernel
NICisenabled.
--delete <nic_name> network ip interface remove RemoveaVMkernelNIC.
--disable -D network ip interface set
--interface-name=<NIC>
--enabled=[true|false]
TheESXCLIcommandenablesordisables
thespecifiedVMkernelNIC.
--dvs-name <dvs>
-s
Notsupported.
--dvport_id
<port_id>
Notsupported.
--enable network ip interface ipv4 set
--interface-name=<NIC>
SetandenablethespecifiedVMkernel
NICifitisdisabled.

esxcfg-volume
Theesxcfg-volumecommandmanagesLVMsnapshotorreplicavolumes.InvSphere5,equivalentESXCLI
commandsareavailableintheesxcli storage filesystemandintheesxcli storage vmfsnamespaces.
--enable-ipv6 -6
[true | false]
network ip interface ipv6 set
--enable-dhcpv6
network ip interface ipv6 address
[list|add|remove]
EnableIPv6forthenextboot;managethe
IPv6address.
--ip <address> -i
<address>
network ip interface ipv4 set
--interface-name=<NIC>
network ip interface ipv6 set
--interface-name=<NIC>
TheIPaddresstobeusedforthe
VMkernelNIC.
IfyousetastaticIPv4address,youmust
specifythe--netmaskoptioninsame
command.
--list -l network ip interface list
network ip interface ipv4 list
network ip interface ipv6 list
ListVMkernelnetworkinterfaces.
ListIPv4addressesassignedtothe
system.
ListIPv6addressesassignedtothe
system.
--mtu <mtu> network ip interface set
--interface-name=<NIC> --mtu=<long>
MTUfortheinterfacebeingcreated.Used
atthetop-levelipnamespace,notinside
theipv4oripv6namespace.
--netmask <netmask>
-n
network ip interface ipv4 set
--interface=<NIC> --netmask=<netmask>
network ip interface ipv4 set
--interface=<NIC> --netmask=<netmask>
IPnetmask(X.X.X.X)tobeusedforthe
VMkernelNIC.SettinganIPnetmask
requiresthatthe--interfaceoptionbe
giveninsamecommand.
--peerdns -p network ip interface ipv4 set
--interface=<NIC>
--peer-dns=[true|false]
network ip interface ipv6 set
--interface=<NIC>
--peer-dns=[true|false]
SetpeerDNS.Ifset,thesystemusesthe
hostname,IPaddressanddomain
returnedbyDHCP.ValidonlyforDHCP.
--portgroup
<port_group>
Notneeded.
--unset-ip
-U
Notneeded.
Table 23. esxcfg-volume Replacement Commands
esxcfg-volume Option ESXCLI Command Description
--list -l storage vmfs snapshot
list
ListunresolvedsnapshotLUNsorreplicasofVMFSvolumes.
--mount -m
--persistent -M
storage vmfs snapshot
mount
MountasnapshotorreplicaofaVMFSvolume.Usethe
--nopersistoptiontomountthevolumenon-persistently.
Table 22. esxcfg-vmknic Replacement Commands (Continued)
esxcfg- option ESXCLI Command Description

VMware, Inc. 27
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
esxcfg-vswitch
Theesxcfg-vswitchcommandmanagesvirtualswitches.InvSphere5,equivalentESXCLIcommandsare
available.
--resignature
<VMFS-UUID|label>
storage vmfs snapshot
resignature
Resignatureasnapshotorreplicavolume.
--umount -u
<VMFS-UUID|label>
storage vmfs snapshot
unmount
DisconnectandunmountanexistingVMFSorNASvolume.
Thecommanddoesnotdeletetheconfigurationforthe
volume,butremovesthevolumefromthelistofmounted
volumesandhaltsallI/Oornetworktrafficforthisvolume.
Table 24. esxcfg-vswitch Replacement Commands
esxcfg-vswitch Option ESXCLI Command Description
--add | -a
<switch_name>
network vswitch standard add Addanewvirtualswitch.
--add-pg | -A
<portgroup>
<vswitch_name>
network vswitch standard portgroup add
portgroup-name=<string>
vswitch-name=<string>
Addaportgrouptothespecifiedvirtual
switch.
--add-dvp-uplink |
-P
Notsupported. Addanuplinkadaptertoadistributed
virtualport(DVP).
--add-pg-uplink |
-M
esxcli network vswitch standard
portgroup policy failover set
--active-uplinks=vmnic1,vmnic6,vminic7
Updatethelistofactiveuplinksforthe
portgroup.Thiscommandfailssilently
iftheuplinkadapterdoesnotexist.
--check | -c
<vswitch_name>
network vswitch standard list Checkwhetheravirtualswitchexists.
Print1iftheswitchexistsandprint0
otherwise.Usethevirtualswitchname,
e.g.vSwitch0orvSwitch1,tospecifythe
virtualswitch.
--check-pg | -C
<port_group>
<vswitch_name>
network vswitch standard portgroup list Checkwhetherthespecifiedportgroup
existsornot.
--delete | -d
<vswitch_name>
network vswitch standard remove
--vswitch-name=<vswitch>
Removeavirtualswitch.Runningthe
commandwiththisoptionfailsifany
portsonthevirtualswitchareinuseby
VMkernelnetworksorvirtualmachines.
--del-pg | -D
<port_group>
<vswitch_name>
network vswitch standard portgroup
remove --vswitch-name=<vswitch>
--portgroup-name=<portgroup>
Removeaportgroupfromthevirtual
switch.Runningthecommandwiththis
optionfailsiftheportgroupisinuse,for
example,byavirtualmachineora
VMkernelnetwork.
--del-dvp-uplink |
-Q <adapter_name>
--dvp <DVPort_id>
<dvswitch_name>
ESXCLIdoesnotsupportdistributedswitches.
UsethevSphereClienttoconfiguredistributed
switches.
--del-pg-uplink |
-N <adapter_name>
<port_group>
<dvswitch_name>
network vswitch standard portgroup
policy failover set
--active-uplinks=vmnic1,vmnic6,vminic7
Updatethelistofactiveuplinksforthe
portgroup.
--dvp | -V ESXCLIdoesnotsupportdistributedswitches.
UsethevSphereClienttoconfiguredistributed
switches.
--get-cdp | -b
<vswitch_name>
network vswitch standard listincludes
CDPinformation.
PrintthecurrentCDP(CiscoDiscovery
Protocol)settingforthisvirtualswitch
(validforvSphere4.0andlater).
Table 23. esxcfg-volume Replacement Commands (Continued)
esxcfg-volume Option ESXCLI Command Description

--link | -L
<physical_nic>
<vswitch_name>
network vswitch standard uplink add
--uplink --vswitch
Addanuplinkadapter(physicalNIC)to
avirtualswitch.Runningthecommand
withthisoptionattachesanewunused
physicalnetworkadaptertoavirtual
switch.
--list | -l network vswitch standard list Listallvirtualswitchesandtheirport
groups.
--mtu | -m
<vswitch_name>
network vswitch standard set
--mtu=<long>
SettheMTU(maximumtransmission
unit)ofthevirtualswitch.Thisoption
affectsallphysicalNICsassignedtothe
virtualswitch.
--pg | -p
<port_group>
network vswitch standard portgroup set
--vlan-id=<long>
Providethenameoftheportgroupfor
the--vlanoption.SpecifyALLtoset
VLANIDsonallportgroupsofavirtual
switch.
--set-cdp | -B
<vswitch_name>
[down | listen |
advertise | both]
network vswitch standard set
--cpd-status=<string>
SettheCDPstatusforagivenvirtual
switch(validforvSphere4.0andlater).
Toset,specifydown,listen,advertise,
orboth.
--unlink | -U
<physical_nic>
<vswitch_name>
network vswitch standard uplink remove
--uplink=<uplink> --vswitch=<vswitch>
Removeanuplinkadapterfromavirtual
switch.Anuplinkadaptercorresponds
toaphysicalEthernetadaptertowhich
thevirtualswitchisconnected.Ifyou
removethelastuplinkadapter,youlose
physicalnetworkconnectivityforthat
switch.
--vlan | -v --pg
<port_group>
network vswitch standard portgroup set
--portgroup-name=<str>
--vlan-id=<long>
SettheVLANIDforaspecificportgroup
ofavirtualswitch.Settingtheoptionto0
disablestheVLANforthisportgroup.If
youspecifythisoption,youmustalso
specifythe--portgroupoption.
-X --set-maxactive network vswitch standard portgroup
policy failover set
--active-uplinks=vmnic1,vmnic6,vminic7
Explicitlyspecifythemaximumnumber
ofactiveuplinks.
Atanytime,thereisoneportgroupNIC
array,andacorrespondingsetofactive
uplinks.Forexample,assumethe
portgroupnicarrayis[vmnic1,vmnic0,
vmnic3,vmnic5,vmnic6,vmnic7]and
active-uplinksissettothreeuplinks
(vmnic1,vmnic0,vmnic3),andtherest
arestandbyuplinks.Ifyousettheactive
uplinkswithnewset[vmnic3,vmnic5],
thoseuplinksoverridetheoldset.The
NICarraychangesto[vmnic3,vmnic5,
vmnic6,vmnic7]andmax-active
becomes2.
Table 24. esxcfg-vswitch Replacement Commands (Continued)
esxcfg-vswitch Option ESXCLI Command Description

VMware, Inc. 29
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
esxtop
TheesxtopcommandisavailableandsupportedintheESXiShell.SearchthevSphereDocumentationCenter,
orseethevSphereResourceManagementdocumentation.
esxupdate
TheesxupdatecommandallowsyoutomanageESX4.0andlatersystems.Usethecommandsintheesxcli
softwarenamespacetoinstall,update,remove,ordisplayindividualVIBs(softwarepackages).Use
commandsintheesxcli software sourcesnamespacetoquerydepotcontentsforVIBsandimageprofiles.
AnimageprofiledefinesanESXiimageandconsistsofVIBs.
vicfg-snmp
InvSphere5,youcanusethevicfg-snmpcommandtomanagetheESXiSNMPagent.InvSphere5.1,the
esxcli system snmpnamespacehascorrespondingcommands.
vmkfstools
vmkfstoolsissupportedintheESXiShellandasavCLIcommand.SomedifferencesexistbetweentheESXi
Shellvmkfstoolscommandandthevmkfstools.plvCLIcommand.
NoequivalentESXCLIcommandexists.
vmware-cmd
Thevmware-cmdcommandisincludedinthevCLIpackage,butisnotavailableintheESXiShell.
vm-support
Thevm-supportcommandisavailableintheESXiShell.ThecommandisnotincludedinthevCLIpackage.
IMPORTANTTheupdateprocessinthevSphere5environmenthasbeensimplifiedanddiffersfromthe
processinvSphere4.1.Severalcommandoptionsdonothavedirectequivalents.SeetheUpgradeGuide.
Table 25. esxupdate Replacement Commands
esxupdate
Command ESXCLI Command Description
query esxcli software vib list ListallinstalledVIBpackages.
info vSphere5doesnotsupportbulletins.Instead,
youupdateyoursystemwithindividualVIBsor
imageprofiles.SeetheUpgradedocumentation.
esxcli software vib get --vibname=<str>
esxcli software profile get
DisplayinformationononeormoreVIBs.
update esxcli software vib update
esxcli software profile update
esxcli software vib install
esxcli software profile install
TheupdatecommandupdatesVIBpackages
butdoesnotinstallnewVIBs.
TheinstallcommandinstallsVIBpackages
fromaURLordepot.Thecommandinstalls,
upgrades,ordowngradesVIBs.
remove esxcli software vib remove RemoveselectedVIBsfromthehost.
stage Nolongernecessary.
scan Nolongernecessary.
Runesxcli software sources profile to
queryforimageprofilesinadepot.
Runesxcli software sources vibtodisplay
informationaboutVIBURLsandfiles.
IMPORTANTThevSphereClientnowsupportsalloptionstovm-support.IfyoucannotusethevSphere
ClienttoaccessyourESXisystem,youcanusethevm-supportcommand.

30
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com
VMware, Inc. 3401 Hillview Ave., Palo Alto, CA 94304 www.vmware.com
Copyright © 2010–2015 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are
covered by one or more patents listed at http://www.vmware.com/go/patents. VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or
other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies.
Item: EN-001471-00