You are on page 1of 30

Technical Note

Command-Line Management in vSphere 5 for Service Console Users


ESXi 5.1
StartingwithvSphere5.0,theserviceconsole(alsocalledconsoleOSorCOS)withitsassociatedLinux installationisnolongeravailable.IfyouarecurrentlyusingESXserviceconsolecommands,scripts,agents,or logs,thistechnicalnotehelpsyoutransitiontoanoffhostimplementationortousetheESXiShellinspecial cases.

Introductiononpage 1 TransitioningServiceConsoleCommandsonpage 2 ESXiShellAccessonpage 5 ReplacingAgentsonpage 10 LogginginvSphere5onpage 11 RetrievingNetworkingInformationonpage 13 AddingThirdPartyExtensionstoHostsonpage 14 ReferencetoReplacementsforServiceConsoleCommandsonpage 14

IMPORTANTChangesmadetothehostusingtheDCUI,thevSphereClient,ESXCLI,orotheradministrative toolsarecommittedtopermanentstorageeveryhourorupongracefulshutdown.Changesmightbelostifthe hostfailsbeforetheyarecommitted.

Introduction
InvSphere5.0andvSphere5.1,VMwareoffersthefollowingtools,CLIs,andAPIsthatreplaceESX4.xservice consolecomponents.
CLI or Tool vCLI Description IncludesESXCLIcommands,vicfg- commands,andafewothercommandsfor managingvSphere. PowerCLIcmdletsformanagingESXihostsand virtualmachines. Availability InstallavCLIpackageonaWindowsorLinux systemorruncommandsfromvMA. InstallMicrosoftPowerShellonaWindows system,andinstallvSpherePowerCLItorun bothPowerShellandPowerCLIcmdletfromthe PowerCLIprompt.

PowerCLI

VMware, Inc.

Command-Line Management in vSphere 5 for Service Console Users

CLI or Tool vMA

Description ALinuxvirtualappliancethatincludesthe vSphereSDKforPerlandthevCLIpackage. Alsosupportsthevifastpassauthentication component. Setoftroubleshootingcommandstousewhen vCLIcannotaccessyourESXisystem.Includes ESXCLIcommandsandesxcfg-commands (deprecated).

Availability DeployvMAonanESXisystemandrun commandsagainstauthenticatedtargetservers fromvMA. TheESXiShellisdisabledbydefault.Youcan enabletheShellforlocalorremoteaccess.

ESXiShell commands

Transitioning Service Console Commands


Ifyouarecurrentlymanagingyourenvironmentwithserviceconsolecommands,youcanperformthesame managementtasksinvSphere5.0andvSphere5.1inoneofthefollowingways.

UseoneofthevSphereClientinterfaces. InstallvCLIorPowerCLIonamanagementserver,writescriptswiththosecommands,andrunthescripts againsttargethosts.SeeRunningvCLIorPowerCLICommandsfromRemoteHostsonpage 3. Forcertaintroubleshootingandadvancedmanagementcommands,usecommandsfromtheESXCLI commandsetdirectlytheESXiShell.SeeUsingtheESXiShellonpage 5.


vSphere 5.0 and vSphere 5.1 OffhostmanagementwithvCLI. InstallonWindowsorLinuxorusevMA. See TransitioningServiceConsole Commandsonpage 2.Referenceto ReplacementsforServiceConsole Commandsonpage 14listsvCLIor ESXCLIreplacementsforserviceconsole commandsandpointstomigrationlists inthistechnicalnote. GettingStartedwithvSphere CommandLineInterfaces vSphereCommandLineInterfaceSolutions andExamples

ESX 4.x Service Console Serviceconsolecommands

Serviceconsolecommands

OffhostmanagementwithVMware PowerCLIcmdletsfromaWindowssystem.

Serviceconsolecommands

OnhostmanagementintheESXiShellis possibleifsystemfailuresorotherissues preventyoufromusingoffhostmanagement commands. ESXiShellisdisabledbydefault IfyourunagentsintheESX4.xservice console,youcanreplacethemwith infrastructureservicesinmanycases. RunningthirdpartyagentsintheESXiShell isnotsupported.

SeeESXiShellLocalAccessonpage 5 andRemoteAccesstoESXiShellUsing SSHonpage 8.

Agents

ReplacingAgentsonpage 10.

Linuxnetworking commands. Serviceconsolelogs

NotavailableintheESXiShell.UseESXCLI commandsinstead. Finegrainedcontroloversystemlogsis available.Youcansendlogstothelocal systemortoaremotehost.

SeeRetrievingNetworking Informationonpage 13. LogginginvSphere5onpage 11

Figure 1illustratesthedifferencesbetweenCLIsinESXi4.1andESXi5.0andlater.

InESX4.1,afairlylargesetofserviceconsolecommandsisavailable.AsmallsetofESXCLIcommands isavailableinboththeserviceconsoleandaspartofthevCLIpackage.ThevCLIpackageincludes,in additiontoESXCLIcommands,asetofvicfg-commandsandothercommandsforhostmanagement. ESXi5.0andlaterdoesnotincludeaserviceconsole.IntheESXiShell,youcanrunamuchexpandedset ofESXCLIcommandsandasmallsetofothercommands.ThesameESXCLIcommands,aswellasafew othercommands,areincludedinthevCLIpackageforoffhostmanagement.


2

VMware, Inc.

Command-Line Management in vSphere 5 for Service Console Users

Figure 1. Command-Line Interfaces in ESX 4.1 and ESXi 5.0 and later
Commands running on host vCLI

ESX 4.1

Service console commands Commands running on host

ESXCLI ESXCLI

vicfg-and other commands vCLI

ESXi 5

esxcfg(deprecated) POSIX (subset)

ESXCLI ESXCLI

vicfg-and other commands

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.Runningoffhostishighlyrecommendedbecauseitfacilitatesscripting. 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.

VMware, Inc.

Command-Line Management in vSphere 5 for Service Console Users

Command Set ESXCLIvCLI commands

Description 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.

ThefollowingdocumentationhelpsyouworkwithvCLIcommands.

GettingStartedwithvSphereCommandLineInterfacesgivesoverviewsofavailablecommandsandincludes instructionsforinstallingvCLIonWidowsorLinuxanddetailedinformationaboutconnectionoptions. vSphereCommandLineInterfaceConceptsandExamplespresentsusageexamplesformanycommands,such assettingupsoftwareandhardwareiSCSI,addingvirtualswitches,settingupActiveDirectory authentication,andsoon.Thedocumentincludesthesameexamplewiththevicfg-commandandthe ESXCLIcommandwheresupported. vSphereCommandLineInterfaceReferenceisareferencetobothvicfg-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. IMPORTANTESXCLIonESX4.xhostsdoesnotsupporttargetingavCenterServersystem.Youcantherefore notruncommandswith--serverpointingtoavCenterServersystemevenifyouinstallvCLI5.0orvCLI5.1.

PowerCLI Cmdlet Set


VMwareoffersacomprehensivesetofPowerCLIcmdlets.YoucaninstallthePowerCLIpackageona WindowssystemonwhichMicrosoftPowerShellisinstalledandusePowerCLIcmdletstomanagehostsand virtualmachines.PowerCLIcmdletsandvCLIcommandsoverlapinfunctionality.ThePowerCLIfocusison virtualmachinemanagement.ThevCLIfocusisonhostmanagement. SeethevSpherePowerCLIdocumentationset,availableintheVMwareAdministrationAutomationProducts sectionofhttp://www.vmware.com/support/pubs.

VMware, Inc.

Command-Line Management in vSphere 5 for Service Console Users

Using the ESXi Shell


EachESXihostincludesanESXiShell,whichisdisabledbydefault.Administratorscanusethatshellto performtroubleshootingandadvancedtaskssuchastestingscriptsinnonproductionenvironments. Youcanaccesstheshellasfollows:

Enablelocalaccessandusethelocalshellonthephysicalconsoleorusingaserialport.SeeESXiShell LocalAccessonpage 5. EnableSSHaccessandusetheshelloveramanagementnetworkwithSSH.SeeESXiShellAccesson page 5.

IMPORTANTESXiShellisintendedforexperiencedCLIusers.Minorerrorsintheshellcanresultinserious problems.InsteadofrunningcommandsdirectlyintheESXiShell,usevCLIcommandsorPowerCLIcmdlets. TheESXiShellincludesthefollowingcommandsets.


Command Set ESXCLIcommands Description 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(seeShellCommandson page 10).ThesecommandsarenotsupportedbyVMwarebutareincludedforusein troubleshootingsituations.UsethevSphereClientorVMwarecommandsinsteadwhere possible. SetoftroubleshootingcommandsforusewithVMwareTechnicalSupport.localcli commandsequivalenttoESXCLIcommandsbutbypassthehostdaemon(hostd). Warning:localclicommandsareonlyforsituationswhenhostdisunavailableandcannot berestarted.Afteryourunalocalclicommand,youmustrestarthostd.Usinglocalcli commandsinothersituationsisnotsupported.Aninconsistentsystemstateandpotential failurecanresult.

localclicommands

ESXi Shell Access


AnESXisystemincludesadirectconsolethatallowsyoutostartandstopthesystemandtoperformalimited setofmaintenanceandtroubleshootingtasks.ThedirectconsoleincludestheESXiShell.TheESXiShell includesasetoffullysupportedESXCLIcommandsandasetofcommandsfortroubleshootingand remediation.YoumustenableaccesstotheESXiShellfromthedirectconsoleofeachsystem.Youcanenable accesstothelocalESXiShelloraccesstotheESXiShellwithSSH. NOTEForsecurityreasons,youshouldenableESXiShellonlywhenrequired.

ESXi Shell Local Access


TheESXiShellisdisabledbydefault.YoucanenabletheESXiShellfortroubleshootingfromthedirectconsole. AllESXCLIcommandsthatareavailableintheESXiShellarealsoincludedinthevCLIpackage.Installthe vCLIpackageordeploythevMAvirtualappliance,andruncommandsagainstyourESXihosts,insteadof runningcommandsintheESXiShellitself.SeeGettingStartedwithvSphereCommandLineInterfaces.

VMware, Inc.

Command-Line Management in vSphere 5 for Service Console Users

Enabling the ESXi Shell


YoucanenabletheESXiShellfromthedirectconsoleandfromthevSphereClient.EnablingtheESXiShell meansmakingitaccessibleasalocalconsoleavailabledirectlyoroveranout-of-bandnetwork. To enable the ESXi Shell from the Direct Console 1 2 3 AccessthedirectconsoleoftheESXihost,pressF2,andprovidecredentialswhenprompted. ScrolltoTroubleshootingOptions,andpressEnter. SelectEnableESXiShellandpressEnter. Ontheleft,EnableESXiShellchangestoDisableESXiShell.Ontheright,ESXiShellisDisabled changestoESXiShellisEnabled. 4 (Optional)Configurethetime-outfortheESXiShell a b 5 SelectModifyESXiShelltimeoutandpressEnter. Enterthetime-outvalueinminutesandpressEnter.

PressEscuntilyoureturntothemaindirectconsolescreen.

YoucanenabletheESXiShellfromthevSphereClient. To enable the local or remote ESXi Shell from the vSphere Client 1 2 3 4 Selectthehost,clicktheConfigurationtab,andclickSecurityProfileintheSoftwarepanel. IntheServicessection,clickProperties. SelectESXiShellandclickOptions. ChangetheESXiShelloptions.

Totemporarilystartorstoptheservice,clicktheStartorStopbutton. Toenableaccesspermanently,clickStartandstopwithhost.Thechangewilltakeeffectthenexttime yourebootthehost.

ClickOK.

AfteryouhaveenabledtheESXiShell,youcanuseitfromthatmonitororthroughanout-of-bandnetwork connection. To enable to local or remote ESXi Shell from the vSphere Web Client 1 2 3 4 Selectthehost,clicktheManagetab,andclickSettings. UnderSystem,selectSecurityProfile. IntheServicespanel,clickEdit. Selectaservicefromthelist.

ESXiShell SSH DirectConsoleUI

ClickServiceDetailsandselectthestartuppolicyStartandstopmanually. WhenyouselectStartandstopmanually,theservicedoesnotstartwhenyourebootthehost.Ifyouwant theservicetostartwhenyourebootthehost,selectStartandstopwithhost.

6 7

SelectStarttoenabletheservice. ClickOK.

AfteryouhaveenabledtheESXiShell,youcanuseitfromthatmonitororthroughanout-of-bandnetwork connection.

VMware, Inc.

Command-Line Management in vSphere 5 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 1 2 3 4 FromtheTroubleshootingModeOptionsmenu,selectModifyESXiShellandSSHtimeoutsandpress Enter. EntertheavailabilitytimeoutandpressEnter. EntertheidletimeoutandpressEnter. PressEscuntilyoureturntothemainmenuoftheDirectConsoleInterface.

To set ESXi Shell timeouts from the vSphere Client 1 2 3 4 SelectthehostintheinventoryandclicktheConfigurationtab. IntheConfigurationtabsSoftwarepanel,clickAdvancedSettings. Intheleftpanel,clickUserVars. IntheUserVars.ESXiShellTimeOutentertheavailabilitytimeoutinminutes. YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect. 5 IntheUserVars.ESXiShellInteractiveTimeOutfield,entertheidletimeoutsetting. YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect. 6 ClickOK.

To set ESXi Shell timeouts from the vSphere Web Client 1 2 3 4 5 Selectthehostintheinventory,clicktheManagetab,andclickSettings. UnderSystem,selectAdvancedSystemSettings. Intheleftpanel,clickUserVars. SelectUserVars.ESXiShellTimeOutandclicktheEditicon Entertheavailabilitytimeoutinminutes. YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect. 6 7 SelectUserVars.ESXiShellInteractiveTimeOutandclicktheEditicon Entertheavailabilitytimeoutinminutes. YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect. 8 ClickOK.

Accessing the ESXi Shell with the Direct Console


AfteryouenableESXiShellaccess,youcanaccessthelocalshell. To access the local ESXi Shell 1 2 Atthemaindirectconsolescreen,pressAlt-F1toopenavirtualconsolewindowtothehost. Providecredentialswhenprompted.

VMware, Inc.

Command-Line Management in vSphere 5 for Service Console Users

Whenyoutypethepassword,charactersarenotdisplayedontheconsole. 3 4 Tologout,typeexitintheshell. Toreturntothedirectconsole,pressAlt-F2.

Setting ESXi Shell Timeout


TheESXiShelltimeoutsettingspecifieshowlong,inminutes,youcanleaveanunusedsessionopen.By default,thetimeoutfortheESXiShellis0,whichmeansthesessionremainsopenevenifitisunused.Ifyou changethetimeout,forexample,to30minutes,youhavetologinagainafterthetimeoutperiodhaselapsed. NOTEIfyouareloggedinwhenthetimeoutperiodelapses,yoursessionwillpersist.However,theESXiShell willbedisabled,preventingotherusersfromloggingin. YoucanmodifythetimeoutfromtheDirectConsoleorfromthevSphereClient. To modify the ESXi Shell Timeout

IntheDirectConsole,followthesesteps. a b SelectModifyESXiShelltimeoutandpressEnter. Enterthetime-outvalueinminutesandpressEnter.

InthevSphereClient,followthesesteps. a b c d IntheConfigurationtabsSoftwarepanel,clickAdvancedSettings. Intheleftpanel,clickUserVars. LocateUserVars.ESXiShellTimeOutandenterthetimeoutvalueinminutes. ClickOK.

Remote Access to ESXi Shell Using SSH


IfSecureShellisenabledfortheESXiShell,youcanrunshellcommandsbyusingaSecureShellclientsuch asSSHorPuTTY.

Enabling SSH for the ESXi Shell


Bydefault,youcannotaccesstheESXiShellusingaSecureShellclient.YoucanenableSSHaccessfromthe directconsole. To enable SSH access in the direct console 1 2 3 AtthedirectconsoleoftheESXihost,pressF2andprovidecredentialswhenprompted. ScrolltoTroubleshootingOptions,andpressEnter. SelectEnableSSHandpressEnteronce. Ontheleft,EnableSSHchangestoDisableSSH.Ontheright,SSHisDisabledchangestoSSHis Enabled. 4 PressEscuntilyoureturntothemaindirectconsolescreen.

YoucanenableremotecommandexecutionfromthevSphereClient. To enable SSH from the vSphere Client 1 2 3 4


VMware, Inc.

SelectthehostandclicktheConfigurationtab. ClickSecurityProfileintheSoftwarepanel. IntheServicessection,clickProperties. SelectSSHandclickOptions.


8

Command-Line Management in vSphere 5 for Service Console Users

ChangetheSSHoptions.

Totemporarilystartorstoptheservice,clicktheStartorStopbutton. ToenableSSHpermanently,clickStartandstopwithhost.Thechangetakeseffectthenexttimeyou rebootthehost.

ClickOK.

AfteryouhaveenabledSSH,youcanuseanSSHclienttologintotheESXiShellandrunESXiShell commands.

Accessing the ESXi Shell with SSH


IfSSHisenabledonyourESXihost,youcanuseanSSHclienttoruncommandsonthatshell. To access the ESXi Shell with SSH 1 2 OpenanSSHclient. SpecifytheIPaddressordomainnameoftheESXihost. PrecisedirectionsvarydependingontheSSHclientyouuse.Seevendordocumentationandsupport. 3 Providecredentialswhenprompted.

ESXi Shell Commands


TheESXiShellincludesseveralsetsofcommands. Table 1. ESXi Shell Commands
Command Set ESXCLIcommands Description AlargesetofnewESXCLIcommandssupportsmanyadministrativetasks.Thecommandsare fullysupportedandtestedbyVMwareandincludecommand-linehelp.SeeGettingStartedwith vSphereCommandLineInterfaces. Theesxcfg- commandsavailableintheserviceconsolearedeprecated.Thecommandswill beremovedfromtheESXiShellinafuturerelease.SeeReferencetoReplacementsforService ConsoleCommandsonpage 14. SeeShellCommandsonpage 10. SetoftroubleshootingcommandsforusewithVMwareTechnicalSupport.localcli commandsareequivalenttoESXCLIcommandsbutbypassthehostdaemon(hostd). Warning:localclicommandsareonlyforsituationswhenhostdisunavailableandcannot berestarted.Afteryourunalocalclicommand,youmustrestarthostd.Usinglocalcli commandsinothersituationsisnotsupported.Aninconsistentsystemstateandpotential failurecanresult.

esxcfg-commands

POSIX-like commands localclicommands

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

VMware, Inc.

Command-Line Management in vSphere 5 for Service Console Users

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>

IMPORTANTForacompletelistofESXCLIcommands,seethevSphereCommandLineInterfaceReference.The vSphereCommandLineInterfaceConceptsandExamplesdocumentillustrateshowtoperformcommontaskswith ESXCLIorvicfg-commands.

Shell Commands
IncontrasttoVMwareESX,VMwareESXidoesnotincludeaconsoleOSwithalargesetofshellcommands andothersoftware.However,asmallsetofshellcommandsisavailableintheESXiShell. IMPORTANTThecommandsarenottestedorsupportedbyVMware.UseVMwarecommandssuchas ESXCLI,vicfg-commands,andsoon,instead. Youcanseealistofcommandsin/usr/bin.Whenyoulistthecommandswithls -al,noticethatseveralof theutilitiesareredirectedtocommandsappropriateinthevSphereenvironment.Thefollowingcommands producedifferentresultsthantypicalshellcommands.

Severalcommandsareredirectedtovmkvsitools. IMPORTANTvmkvsitoolsisintendedforusewithVMwareTechnicalSupport.Donotuse vmkvsitoolstomanageyoursystem.

Pingcommandsareredirectedtovmkping. SomeadditionalcommandsareavailableintheESXiShellforcertaintroubleshootingtasks.Usethese commandswheninstructedbyaVMwareKnowledgeBasearticleorVMwareTechnicalSupportstaff. Usermanagementcommandsaredeprecated.

Goto/usr/binandrunls -atoseeacompletelist.

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. Table 2. Infrastructure Services for Production Environments
Function Timesynchronization Centralizedlogcollection ESX NTPagentinservice console Syslogagentinservice console ESXi Built-inNTPservice Built-inSyslogservice Management vicfg-ntpcommand esxcli system syslog commands vSphereClient

VMware, Inc.

10

Command-Line Management in vSphere 5 for Service Console Users

Table 2. Infrastructure Services for Production Environments (Continued)


Function SNMPmonitoring Localaccess authentication ESX SNMPagentinservice console ActiveDirectory(AD) agentinserviceconsole BuiltinActiveDirectory service ESXi Built-inSNMPservice Built-inActiveDirectory service Management esxcli system snmp command vSphereClient vicfg-authconfigvCLI command.

Logging in vSphere 5
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.SeeUsingESXCLIforSyslogConfigurationonpage 11. vCenterServerandESXihaveSNMPagents.YoucansetupthevCenterServerSNMPagentwiththe vSphereClient.YoucansetuptheESXiSNMPagentwiththevSphereClientortheesxcli system snmp commands.SeevSphereCommandLineInterfaceSolutionsandExamples. ListenforCIMindications.

Using ESXCLI for Syslog Configuration


Theesxcli system syslogcommandallowsyoutoconfiguretheloggingbehaviorofyourESXisystem. YoucanperformthesamecustomizationswiththevSphereclient,asdiscussedinthevCenterServerandHost Managementdocumentation.Thecommandhasthefollowingoptions: Table 3. esxcli syslog Options
Option mark reload config get config set Description Markalllogswiththespecifiedstring. Reloadtheconfigurationandupdateanyconfigurationvaluesthathavechanged. Retrievethecurrentconfiguration. 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.

VMware, Inc.

11

Command-Line Management in vSphere 5 for Service Console Users

Table 3. esxcli syslog Options (Continued)


Option config logger list config logger set Description Showcurrentlyconfiguredsub-loggers. Setconfigurationoptionsforaspecificsublogger.Useoneofthefollowingoptions:

--id=<str>IDoftheloggertoconfigure(required) --reset=<str>Resetvaluestodefault --rotate=<long>Numberofrotatedlogstokeepforaspecificlogger(requires --id) --size=<long>Setsizeoflogsbeforerotationforaspecificlogger,inkilobytes (requires--id)

esxcli system syslog Examples Thefollowingworkflowillustrateshowyoumightuseesxcli system syslogforlogconfiguration. 1 Showconfigurationoptions.


esxcli system syslog config get Default Rotation Size: 1024 Default Rotations: 8 Log Output: /scratch/log Logto Unique Subdirectory: false Remote Host: <none>

Setalllogstokeeptwentyversions,thenstartoverwritingtheoldestlog.
esxcli system syslog config set --default-rotate=20

SettherotationpolicyforVMkernellogsto10rotations,rotatingat2MB.
esxcli system syslog config logger --id=vmkernel --size=2048 --rotate=10

Sendlogstoremotehostmyhost.mycompany.com.ThelogswillusethedefaultUDPport,514.
esxcli system syslog config set --loghost='myhost.mycompany.com'

Sendlogs/scratch/mylogsontheremotehostmyhost.mycompany.comusingTCP/IPport1514.
esxcli system syslog config set --loghost='tcp://myhost.mycompany.com:1514' --logdir='/scratch/mylogs'

Sendalogmessageintoalllogssimultaneously.
esxcli system syslog mark --message="this is a message!"

Reloadthesyslogdaemonandapplyconfigurationchanges.
esxcli system syslog reload

Viewing Logs in the ESXi Shell


IntheESX4.xshell,thelocationforlogsis/var/log.IntheESXiShell,youcanalsofindallcurrentlogsinthe /var/logdirectory.Someofthelogsaresymboliclinkstothe/var/run/logdirectory. Mostlogsareattoplevelandnotinsideadirectoryunder/var/run/log.Availablelogsdependonwhich pluginsareinstalledandwhatotherchangesmighthavebeenmadetothesystem.Thefollowingtablelists somefrequentlyusedlogsintheESXiShell.
ESX 4.x shell /var/log/vmware/hostd.log /var/log/vmkwarning /var/log/vmksummary ESXi 5.x shell /var/log/hostd.log /var/log/vmkwarning.log /var/log/vmksummary.log Description Logforthehostdaemon.

VMware, Inc.

12

Command-Line Management in vSphere 5 for Service Console Users

ESX 4.x shell /var/log/messages /var/log/vmware/vpx/vpxa.log

ESXi 5.x shell /var/log/vmkernel.log /var/log/vpxa.log

Description VMkernelwarningsandVMkernel events. vCenterServeragentlog.

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 1 InstalltheESXiDumpCollectorserviceonthevCenterServersystemoraWindowsorLinuxsystemof yourchoice. ESXiDumpCollectorisoneoftheservicesyoucaninstallusingthevCenterServersysteminstallation package.SeevSphereInstallationandSetup. IfyouusethevCenterServeronLinuxappliance,ESXiDumpCollectorispreinstalled. 2 SetupESXisystemsthatshoulduseESXiDumpCollectorwithcommandsintheesxcli 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

YouarepromptedforausernameandpasswordfortheESXihost.

Retrieving Networking Information


LinuxcommandsforretrievingnetworkinginformationarenotincludedintheESXiShell.Youcaninstead useESXCLIcommands.

VMware, Inc.

13

Command-Line Management in vSphere 5 for Service Console Users

OnESXi5,ifconfiginformationistheinformationfortheVMkernelNICthatattachestotheManagement Networkportgroup.YoucanretrievethatinformationbyusingESXCLIcommands.
esxcli esxcli esxcli esxcli network network network network ip ip ip ip interface interface interface interface list ipv4 get -n vmk<X> ipv6 get -n vmk<X> 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 2 3 DownloadtheZIPdepottoyourESXisystembutdonotunpackit. Runesxcli software vibtoaddthepackagetoyoursystem. 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. IMPORTANTThisdocumentdoesnotpresentacompletelistofESXCLIcommands.Thefocusisonreplacing existingserviceconsolecommands.SeethevSphereCommandLineInterfaceReferenceforacompletelistof commands. ThelinksintheCommandcolumnofthetablepointtomoredetailedinformationforeachcommand,with correspondingESXCLIcommandsforeachoptionwhereavailable.ClickthelinkintheMoreInformation columnforatablewithdetailedinformationaboutthatcommand.

VMware, Inc.

14

Command-Line Management in vSphere 5 for Service Console Users

Table 4. Replacements for Service Console Commands


Service Console Command esxcli esxcfg-advcfg esxcfg-dumppart esxcfg-firewall ESXi 5 Replacement SyntaxformostESXCLIcommandshaschanged. esxcli system settings advanced esxcli system coredump InESX4.x,protectstheserviceconsole.InESXi5.x, esxcfg-firewallisnotnecessarybecausenoservice consoleexists. Theesxcli network firewallcommandisavailablefor ESXifirewallmanagement. esxcfg-info ProvidesaviewoftheinternalstateoftheVMkerneland serviceconsolecomponents.Someofthefunctionalityis coveredbycertainESXCLIcommands. esxcli network ip ipsec esxcli iscsi esxcfg-infoonpage 20 No More Information ESXCLICommand Syntaxonpage 16 esxcfg-advcfgonpage 18 esxcfg-dumpparton page 19 vSphereSecurity documentation. Deprecated ESXi Shell No Yes Yes N.A.

esxcfg-ipsec esxcfg-swiscsi esxcfg-hwiscsi esxcfg-module esxcfg-mpath esxcfg-nas esxcfg-nics esxcfg-rescan esxcfg-route esxcfg-scsidevs esxcfg-vmknic

esxcfg-ipseconpage 21 esxcfg-swiscsiand esxcfg-hwiscsionpage 22 esxcfg-moduleon page 24 esxcfg-mpathonpage 24 esxcfg-nasonpage 25 esxcfg-nicsonpage 25 esxcfg-rescanonpage 26 esxcfg-routeonpage 23 esxcfg-scsidevson page 23 esxcfg-vmknicon page 26 esxcfg-volumeon page 27

No Yes Yes Yes Yes Yes Yes Yes Yes Yes

esxcli system module esxcli storage core pathcommands. esxcli storage nfs esxcli network nic esxcli storage corecommands. esxcli network ip routecommands Useesxcli storage coreandesxcli storage core filesystemcommands. esxcli network ip interfacecoversmostoptionsand includesanumberofoptionsnotavailableinthe esxcfg-vmkniccommand. esxcli storage filesystem Usedtoconfigureserviceconsolenetworkingin4.xsystems. NotneededandnotavailableintheESXi5.xESXiShell. esxcli network vswitch standardforstandardswitches. esxcli network vswitch dvsfordistributedswitches. SupportedintheESXi5.xESXiShell.Ifyoudonothave accesstotheESXiShell,usetheresxtopremotevCLI commandfromasupportedLinuxsystemorfromvMA. esxclisoftware vib Note:Bothesxupdateandvihostupdatearenotsupported againstESXi5.0andESXi5.1hosts.

esxcfg-volume esxcfg-vswif esxcfg-vswitch

Yes Yes

esxcfg-vswitchon page 28 esxtoponpage 29

Yes No

esxtop

esxupdate

esxupdateonpage 29

Yes

vmkfstools

ThevmkfstoolscommandisavailableintheESXi5.xESXi Shell.ThevmkfstoolsvCLIcommandoptionsdifferslightly fromtheshellcommandoptions. Nochangeandnotdeprecated.

vmkfstoolsonpage 30

No

vmkping

Usevmkping --helpfor information.

No

VMware, Inc.

15

Command-Line Management in vSphere 5 for Service Console Users

Table 4. Replacements for Service Console Commands (Continued)


Service Console Command vmware-cmd ESXi 5 Replacement NotavailableinESXiShell.AvailableinvCLI.Inmanycases, VMwarePowerCLIcmdletsperformthesametasksas vmware-cmd. Createsatararchivecontainingdebugginginformationfor theserver. ThiscommandisintendedforusewithVMwareSupport.No equivalentvCLIcommandexists. More Information Usevmware-cmd--help forinformation. Usevm-support --help formoreinformation. Deprecated ESXi Shell Yes

vm-support

No

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]

IMPORTANTYoumustupdateallESXCLIcommandsexplicitly;noscriptsareavailableforthetask.Starting withvSphere5.0,mostmanagementcommandswillbeESXCLIcommands. Updates to ESXCLI 4.x Commands Thefollowingtablelistsequivalentcommandsforesxclicorestoragecommands. Table 5. esxcli 4.x corestorage namespace
ESXCLI in ESXi 4.x corestorage claiming reclaim --<option> corestorage 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> ESXCLI in ESXi 5.x storage core claiming reclaim --<option> storage core claiming unclaim --<option> storage core claimrule add --<options> Severalnewoptionsforthiscommandareavailable.Seethe vSphereCommandLineInterfaceReference,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 for Service Console Users

Thefollowingtablelistsequivalentcommandsforesxcli storage nmpcommands. Table 6. esxcli nmp namespace


esxcli storage nmp commands in ESXi 4.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] esxcli storage nmp commands in ESXi 5.x 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]

Theesxcli networkcommandsincludedinESXCLI4.1havebeenrenamed.Manyadditionalnetworking commandsareavailableinESXCLI5.x Table 7. esxcli network namespace


esxcli 4.x network neighbors list network connection list esxcli 5.x network ip neighbor list network ip connection list Comment ListARPtableentries. ListactiveTCP/IPconnections.

Theesxcli swiscsinamespacesupportsafewmanagementcommandsforsoftwareiSCSIinESXi4.1.The commandshavebeenrenamed.ESXCLIequivalentshavealsobeenaddedfortheesxcfg-swiscsiand esxcfg-hwiscsicommands. Table 8. esxcli swiscsi namespace


ESXCLI 4.x swiscsi nic [--add | --list | --remove] swiscsi vmknic --list esxcli 5.x iscsi networkportal [add | list | remove] iscsi logicalnetworkportal list Comment PerformoperationsontheiSCSInetwork portal(iSCSIVMkernelNIC). PerformoperationsontheiSCSIlogical networkportal.

VMware, Inc.

17

Command-Line Management in vSphere 5 for Service Console Users

Table 8. esxcli swiscsi namespace (Continued)


ESXCLI 4.x swiscsi vmnic --list swiscsi session [--add | --list | --remove] esxcli 5.x iscsi physicalnetworkportal list iscsi session [add | list | remove] Comment PerformoperationsontheiSCSIphysical networkportal(uplink). PerformoperationsoniSCSIsessions. Note:Theaddandremovecommandsare intendedonlyforusebyVMware partners. Usetheiscsi session connection namespacetoperformoperationsonthe iSCSIconnection.

The4.1esxcli vmsnamespaceallowsyoutolistvirtualmachinesandforciblystopthem.Thenamespacehas beenrenamed.


esxcli 4.x vms vm kill esxcli 5.x vm process kill Comment Forciblykillvirtualmachinesthatarenotrespondingtonormalstop operations.Requiresthetypeofkilloperation(soft,hard,force) andtheworldIDofthevirtualmachinetokill. DisplaytheworldIDofvirtualmachinesonthehost.

vms vm list

vm process list

esxcfg-advcfg Insteadofesxcfc-advcfg,useesxcli system settings advanced.Thefollowingcommandsare supported. Table 9. esxcfg-advcfg Replacement Commands
esxcfg-advcfg option -g|--get ESXCLI Command system settings advanced list -o=option Description GetthevalueoftheVMkerneladvanced configurationoption.Us--optionto retrieveinformationforasingleoption,or --treetolimitthelisttoaspecificsubtree. SetthevalueoftheVMkerneladvanced configurationoption. ResetaVMkerneladvancedconfiguration optiontodefault. ListallVMkerneladvancedconfiguration options.

-s|--set <value> -d|--default -l|--list -q|--quiet -k|--set-kernel -j|--get-kernel -c|--get-config -m|--set-message

system settings advanced set system settings advanced set -d|--default system settings advanced list Nolongersupported system settings kernel set system settings kernel list Notsupported system welcomemsg set

SetaVMkernelloadtimeoptionvaluefor thenextboot. GetaVMkernelloadtimeoptionvaluefor thenextboot.

Setthewelcomemessageforthedirect console.Youcanretrievethemessagewith system welcomemsg get. EnsuretheVMkernelsystemUUIDisset andprintit. Getthevalueofauser-specifiedgeneric value. Setthevalueofauser-specifiedgeneric value.

-u|--uuid -G|--get-user-var -S|--set-user-var

system uuid get system settings advanced list | grep <var> system settings advanced set

VMware, Inc.

18

Command-Line Management in vSphere 5 for Service Console Users

Table 9. esxcfg-advcfg Replacement Commands (Continued)


esxcfg-advcfg option -D|--del-user-var -U|--user-var -A|--add-option <name> ESXCLI Command Addingordeletinguservariablesisnolonger supported. --option=<str> Nolongersupported. ThisoptionwasusedtoaddCIMoptions.Use theCIMSDKinstead. Addingordeletinguservariablesisnolonger supported. Addingordeletinguservariablesisnolonger supported. Addingordeletinguservariablesisnolonger supported. Addingordeletinguservariablesisnolonger supported. Addingordeletinguservariablesisnolonger supported. Addingordeletinguservariablesisnolonger supported. Nolongersupported. ThisoptionwasusedtoaddCIMoptions.Use theCIMSDKinstead. Useesxcli system settings advanced listtolistalloptionsinstead. TheESXCLIcommandliststhevalueofthe VMkerneladvancedconfigurationoptions. Theoutputincludesthecurrentsettingfor eachoption. Nameoftheuservariabletouseforwhen retrievingandsettinguservariables. Description

-T|--add-type -E|--add-desc -F|--add-default -N|--add-min -M|--add-max -H|--add-hidden <val> -L|--del-option <name>

-V|--has-option <name>

-r|--restore

Nolongeravailable.Internaluseonlyin previousversions.

esxcfg-dumppart WhenusingtheESXiShell,youcanconfigureyoursystemtosavecoredumpstoalocalpartitionortousethe ESXiDumpCollectorandsavecoredumpstoaprespecifiedlocalorremotepartition.


Useesxcli coredump partitioncommandstoconfigurealocaldumppartition. InstallESXiDumpCollectortosupportsendingcoredumpstoaremotehostandrunesxcli coredump networkcommandstoconfiguretheremotedumppartition.

IMPORTANTYoucannolongeruseesxcfg-dumpparttoenablecoredumps.UseESXCLIinstead. Thefollowingtableliststheesxcfg-dumppartcommandoptionsandcorrespondingESXCLIcommands.

VMware, Inc.

19

Command-Line Management in vSphere 5 for Service Console Users

Table 10. esxcfg-dumppart Replacement Commands


-

esxcfg-dumppart Option -l | --list

ESXCLI Command system coredump partition list

Description 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 -S | --smart-activate

system coredump partition get system coredump partition set --smart --enable= true

Gettheconfigureddiagnosticpartition forthesystem. Runthesmartactivatealgorithmto activatetheconfigureddump partition,orifnopartitionis configured,selectthebestpossible candidatebasedonthemediaofthe availabledumppartitions. Makethespecifiedpartitionthe currentdiagnosticpartition. Deactivatetheactivediagnostic partitionordeactivateESXiDump Collector. CAUTION:Ifyourunthiscommand, yoursystemcannotwriteerrorstoa fileuntilanotherpartitionisactivated. Youloseanyerrorrecordiferrors occur.

-a | --activate -d | --deactivate

system coredump partition set --enable=true system coredump partition set --enable=false

-s <naa.xx:1> | --set <naa.xxxxxxxx:1> -C | --copy [-n | --newonly] [-z | --zdumpname] [-o | --slot] -L --log

system coredump partition set --partition xxx.xxx NocorrespondingESXCLIcommand.

Setandactivatethediagnostic partition.Specifythepartitionusing naa.xxx:1oreui.xxxsyntax.

NocorrespondingESXCLIcommand.

esxcfg-info NocomprehensivesetofequivalentESXCLIcommandscorrespondingtoesxcfg-infoisavailableyet.The followingcommandsareofferingsomeoftheesxcfg-infocapability. Table 11. ESXCLI Information Retrieval Commands


Command hardware bootdevice list hardware clock get hardware cpu cpuid get harware cpu cpuid get --cpu=<n> Description Listthebootdeviceorderforthishost,ifavailable. Displaythecurrenthardwareclocktime. GetinformationfromtheCPUIDinstructiononeach CPUonthishost. GetinformationfromtheCPUIDinstructiononCPU number<n>.

VMware, Inc.

20

Command-Line Management in vSphere 5 for Service Console Users

Table 11. ESXCLI Information Retrieval Commands (Continued)


Command hardware cpu global get hardware cpu list hardware memory get hardware pci list hardware platform get network vswitch standard list network vswitch standard policy shaping get network vswitch standard policy failover get network vswitch standard policy security get network vswitch standard portgroup policy shaping get network vswitch standard portgroup policy failover get network vswitch standard portgroup policy security get network nic list network ip interface list network ip dns server list Description ListinformationandconfigurationglobaltoallCPUs. ListallCPUsonthishost. Getinformationaboutmemory. ListallthePCIdevicesonthishost. Getinformationabouttheplatform. ListthevirtualswitchesontheESXihost. Retrievethenetworkshapinginformationforthe virtualswitch. Retrievethefailoverpolicyinformationforthevirtual switch. Retrievethesecuritypolicyinformationforthe virtualswitch. Retrievethenetworkshapinginformationforthe portgroup. Retrievethefailoverpolicyinformationfortheport group. Retrievethesecuritypolicyinformationfortheport group. ListthephysicalNICscurrentlyinstalledandloaded onthesystem. ListtheVMkernelnetworkinterfacescurrently knowntothesystem. PrintalistoftheDNSservercurrentlyconfiguredon thesystemintheorderinwhichtheywillbeused.

esxcfg-ipsec InvSphere5.1,youcanusecommandsintheesxcli network ip ipsecnamespaceinplaceofthe esxcfg-ipseccommand. Table 12. esxcfg-ipsec Replacement Commands
vicfg-ipsec Option --action [none|discard|ipsec] | --add-sa <sa> | --add-sp <sp> | --dir [in | out] | --dst-port <port> | --flush-sa | --flush-sp | --ealgo [null | 3des-cbc | aes128-cbc]| --ekey <e_key>| --ialgo [hmac-sha1 | hmac-sha2-256] | --ikey <i_key> | --list-sa <sa> | --list-sp <sp> | --remove-sa <sa> | esxcli Command or Option network ip ipsec sp add --action network ip ipsec sa add network ip ipsec sp add network ip ipsec sp add --flowdirection network ip ipsec sp add --destinationport network ip ipsec sp remove --removeall network ip ipsec sa remove --removeall network ip ipsec sa add --encryptionalgorithm network ip ipsec sa add --encryptionkey network ip ipsec sa add --integrityalgorithm network ip ipsec sa add --integritykey network ip ipsec sa list network ip ipsec sp list network ip ipsec sa remove

VMware, Inc.

21

Command-Line Management in vSphere 5 for Service Console Users

Table 12. esxcfg-ipsec Replacement Commands


vicfg-ipsec Option --remove-sp <sp> | --sa-dst <destination> esxcli Command or Option network ip ipsec sp remove 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> | --spi <spi> | network ip ipsec sp add --spdestination network ip ipsec sa add --saspi network ip ipsec sa remove --saspi --sp-src <source> | --spmode <mode> | --src-port <port> | --ulproto [any | tcp | udp | icmp6] network ip ipsec sp add --spsource network ip ipsec sp add --spmode network ip ipsec sp add --sourceport network ip ipsec sp add --sourceport --upperlayerprotocol

esxcfg-swiscsi and esxcfg-hwiscsi TheESX4.xserviceconsoleincludestwocommandsforiSCSImanagement. Theesxcfg-swiscsicommandmanagessoftwareiSCSI.EquivalentESXCLIcommandsareavailablein vSphere5. Table 13. esxcfg-swiscsi Replacement Commands
esxcfg-swiscsi Option -e --enable -D --disable -q --query -s --scan ESXCLI Command iscsi software set --enabled=true iscsi software set --enabled=false iscsi software get iscsi adapter discovery rediscover -A <adapter_name> storage core adapter rescan [-A <adapter_name> | -all] -k --kill -r --restore Notsupported Notsupported Description EnableSoftwareiSCSIonthesystem,if disabled. DisableSoftwareiSCSIonthesystem,if enabled. CheckifSoftwareiSCSIisenabledor disabledonthesystem. Scanthesystemfordisksavailablethrough SoftwareiSCSIinterface.Callthetwo commandsinorder.

Theesxcfg-hwiscsicommandmanagedhardwareiSCSI.

VMware, Inc.

22

Command-Line Management in vSphere 5 for Service Console Users

Table 14. esxcfg-hwiscsi Replacement Commands


esxcfg-hwiscsi Option -l -a [allow | deny] <vmkernel_SCSI_adapter> ESXCLI Command iscsi physicalnetworkportal param get 1.Findtheadapter. iscsi adapter list 2.GetARPredirectioninformation. iscsi physicalnetworkportal param get -A vmhba4 3.EnableARPredirect. iscsi physicalnetworkportal param set --option ArpRedirect=true -A vmhba4 -j [enable | disable] <vmkernel_SCSI_adapter> 1.Findtheadapter. iscsi adapter list 2.Getjumboframeinformation. iscsi physicalnetworkportal param get -A vmhba4 3.Enablejumboframesupport. iscsi physicalnetworkportal param set --option ArpRedirect=true --adapter=vmhba4 Enableordisable jumboframesupport. Description Listcurrent configuration AllowordenyARP redirectiononthe adapter.

esxcfg-route Theesxcfg-routecommandhasequivalentESXCLIcommands.Thenewcommandsethasenhanced functionality. Table 15. esxcfg-rout Replacement Commands


esxcfg-route Option add ESXCLI Command network ip route ipv4 add network ip route ipv6 add del network ip route ipv4 remove network ip route ipv6 remove list network ip route ipv4 list network ip route ipv6 list --family Includedinthecommandasanamespace. ListsconfiguredIPv4orIPv6routs Description AddsanIPv4orIPv6route.Youspecifythegateway andthenetwork. RemoveanIPv4orIPv6route.Youspecifythegateway andthenetwork.

esxcfg-scsidevs Theesxcfg-scsidevscommandhasequivalentESXCLIcommandsforsomeoftheoptions. Table 16. esxcfg-scsidevs Replacement Commands


esxcfg-scsidevs Option -a |--hbas -l | --list ESXCLI Command storage core adapter list storage core device list storage core device list Description PrintthemappingsforeachSCSIhostbusadapter(HBA)to theinformationaboutthatadapter. Listallthestoragedevicesknowntothesystem,including bothSCSIandnon-SCSIdevices.Thelistcanbefilteredusing the--deviceoptiontolimittheoutputtospecificdevice. Listallthedeviceuniqueidentifiers.Includethemapping fromprimaryidentifiertoallsecondaryidentifiers.Thelist canbefilteredusingthe--deviceoptiontolimittheoutput tospecificdevice. PrintthemappingsfromaVMFSvolumetothedeviceand partitionsusedinthatVMFS.

-c -u

-m -f

storage filesystem list

VMware, Inc.

23

Command-Line Management in vSphere 5 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. Table 17. esxcfg-module Replacement Commands
esxcfg-module Option --get-options <module_name> -g <module_name> --set-options <options> <module_name> -s <options> <module_name> -e --enable -d --disable ESXCLI Command system module parameters list system module parameters set system module set --enabled=true system module set --enabled=false Description Returnstheoptionstringconfiguredtobe passedtothemodulewhenthemoduleis loaded. Specifiestheoptionstringtobepassedtothe modulewhenthemoduleisloaded. Enablethegivenmodule,indicatingthatit shouldloadatboottime. Disablethegivenmoduleandpreventitfrom loadingatboot.Disablingthemodulehasno immediateeffectonthemodulestateona runningsystem. Querythesystemforthemodulestoloadat boot.

-q --query -m --mod-name -<name> -u --unload --list -l -i --show-info

system module list --enabled=[true|false] Notsupported. Notsupported. system module list --loaded=[true|false] system module get system module parameters list

ListthesetofcurrentlyloadedVMkernel modules. Showinformationaboutthemodule.This commandcanberunagainstamodulefile. Skipmodulevalidationforalloptions.Theget andlistcommandsdonotsupport--force. Displaymoreverboseinformation.

-f --force -v --verbose -<level>

system module <cmd> --force Not supported

esxcfg-mpath Theesxcfg-mpathcommandsupportslistinginformationaboutFibreChanneloriSCSILUNsandchanging apathsstate.InvSphere5,equivalentESXCLIcommandsareavailable. Table 18. esxcfg-mpath Replacement Commands


esxcfg-mpath Option -l --list <path> | <device> -L --list-compact -m --list-map -b --list-paths ESXCLI Command storage core path list storage core device list Notsupported storage core device list storage core path list FordevicescurrentlyregisteredwiththePSA,listthe filtersattachedtothem.(Notanexactequivalent) Listalldeviceswiththeircorrespondingpaths,orlist pathsforthespecifieddevice. Description Listdetailedinformationforallpathsonthesystem orforthespecifiedpathordevice.

VMware, Inc.

24

Command-Line Management in vSphere 5 for Service Console Users

Table 18. esxcfg-mpath Replacement Commands (Continued)


esxcfg-mpath Option -G --list-plugins ESXCLI Command storage core plugin list Description Listallmultipathingpluginsloadedintothesystem. Ataminimum,thiscommandreturnsNMP(Native MultipathingPlugin).Ifothermultipathingplugins havebeenloaded,theyarelistedaswell. SetthestateofagivenLUNpathtoeitheractiveor off.Thisoptionrequiresthatthe--pathoptionsisset andspecifieseitherthepathUIDorthepathruntime name. Ifyouarechangingapathsstate,thechange operationfailsifI/Oisactivewhenthepathsettingis changed.Reissuethecommand.Youmust successfullyperformatleastoneI/Ooperationbefore thechangetakeseffect.

-s --state

storage core path setstate --path=<path> --state=[active|off]

esxcfg-nas Theesxcfg-nascommandmanipulatesNASfilesystemsassociatedwithESXisystems.InvSphere5, equivalentESXCLIcommandsareavailable. Table 19. esxcfg-nas Replacement Commands


esxcfg-nas Option --add <name> -a <name> ESXCLI Command storage nfs add Description AddanewNASfilesystemtotheESXihost. YoumustspecifythehostnameorIPaddressofthe NFSvolumetoadd,thesharenameontheremote system,andthevolumenametousefortheNFS mount. storage nfs remove --volume-name=<NAS_volume_name> RemoveanexistingNFSvolumefromtheESXihost. ThiscommandunmountstheNASfilesystemand removesitfromthelistofknownfilesystems. ListallknownNASfilesystemswiththeirmount name,sharename,andhostname.Indicatethe mountstatusforeachfilesystem. AddorremoveaspecifiedNAShost(notESXihost). Usedwithotheroptions. AddthenewNFSfilesystemwithread-onlyaccess. AddorremoveaspecifiedNAShost(notESXihost. Usedwithotheroptions.

--delete <name> -d <name>

--list -l --host <n_host> -o <n_host> --readonly -y --share <share> -s <share>

storage nfs list

storage nfs add --host storage nfs add --readonly storage nfs add --share=<share>

ESXCLIalsoincludescommandstomountandunmounttheNASfilesystem. esxcfg-nics Theesxcfg-nicscommandmanagesphysicalNICs(uplinkadapters)usedbyanESXihost.InvSphere5, equivalentESXCLIcommandsareavailable. Table 20. esxcfg-nics Replacement Commands


esxcfg-nics Option --auto -a --duplex [full|half] <nic> -d [full|half] <nic> ESXCLI Command network nic set --auto network nic set --duplex Description Setthespecifiednetworkadaptertoautonegotiateitsspeedand duplexsettings. Settheduplexvalueatwhichagivennetworkadaptershouldrun toeitherfull(transmitdatainbothdirectionsatthesametime)or half(transmitdatainonedirectionatatime).

VMware, Inc.

25

Table 20. esxcfg-nics Replacement Commands (Continued)


esxcfg-nics Option --list -l --speed <speed> <nic> -s <speed> <nic> ESXCLI Command network nic list network nic get <adapter> network nic set --speed=<long> Description Listinformationaboutallthenetworkadapters.Usenetwork nic get <adapter>tolistinformationaboutonespecificadapter,for exampleesxcli network nic get -n vmnic0 Setthespeedatwhichagivennetworkadaptershouldrun.Valid valuesforspeedare10,100,1000,or10000.

esxcfg-rescan Theesxcfg-rescancommandrescansthestorageconfiguration.InvSphere5,equivalentESXCLIcommands areavailable. Table 21. esxcfg-rescan Replacement Commands


esxcfg-rescan Option -a|--add -d|--delete <vmhba#> -A|--all ESXCLI Command storage core adapter rescan --type=add storage core adapter rescan --type=delete --adapter <vmhba#> storage core adapter rescan Description Scanforaddeddevices. Scanremovingdeaddevices Scanalladapters.Bydefault,thecommand scansalladapters.Youcanspecifyindividual adaptersbyusingthe--adapteroption. Scanexistingpathsandupdatetheirstate.

-u|--update <vmhba#>

storage core adapter rescan --type=update --adapter <vmhba#>

Inaddition,ESXCLIsupportsseveralotherrescancommand.Runesxcli storage core adapter rescan --help. esxcfg-vmknic Theesxcfg-vmkniccommandadds,deletes,andmodifiesVMkernelnetworkinterfaces.InvSphere5, equivalentESXCLIcommandsareavailable. Table 22. esxcfg-vmknic Replacement Commands
esxcfg- option --add --ip<address> --netmask <netmask> <port-group-name> --delete <nic_name> --disable -D ESXCLI Command network ip interface add Description AddaVMkernelNICtothesystem. Whenthecommandcompletes successfully,thenewlyaddedVMkernel NICisenabled. RemoveaVMkernelNIC. TheESXCLIcommandenablesordisables thespecifiedVMkernelNIC.

network ip interface remove network ip interface set --interface-name=<NIC> --enabled=[true|false] Notsupported. Notsupported.

--dvs-name <dvs> -s --dvport_id <port_id>

Command-Line Management in vSphere 5 for Service Console Users

Table 22. esxcfg-vmknic Replacement Commands (Continued)


esxcfg- option --enable --enable-ipv6 -6 [true | false] ESXCLI Command network ip interface ipv4 set --interface-name=<NIC> network ip interface ipv6 set --enable-dhcpv6 network ip interface ipv6 address [list|add|remove] --ip <address> -i <address> network ip interface ipv4 set --interface-name=<NIC> network ip interface ipv6 set --interface-name=<NIC> --list -l network ip interface list network ip interface ipv4 list network ip interface ipv6 list TheIPaddresstobeusedforthe VMkernelNIC. IfyousetastaticIPv4address,youmust specifythe--netmaskoptioninsame command. ListVMkernelnetworkinterfaces. ListIPv4addressesassignedtothe system. ListIPv6addressesassignedtothe system. --mtu <mtu> network ip interface set --interface-name=<NIC> --mtu=<long> network ip interface ipv4 set --interface=<NIC> --netmask=<netmask> network ip interface ipv4 set --interface=<NIC> --netmask=<netmask> --peerdns -p network ip interface ipv4 set --interface=<NIC> --peer-dns=[true|false] network ip interface ipv6 set --interface=<NIC> --peer-dns=[true|false] --portgroup <port_group> --unset-ip -U Notneeded. Notneeded. MTUfortheinterfacebeingcreated.Used atthetop-levelipnamespace,notinside theipv4oripv6namespace. IPnetmask(X.X.X.X)tobeusedforthe VMkernelNIC.SettinganIPnetmask requiresthatthe--interfaceoptionbe giveninsamecommand. SetpeerDNS.Ifset,thesystemusesthe hostname,IPaddressanddomain returnedbyDHCP.ValidonlyforDHCP. Description SetandenablethespecifiedVMkernel NICifitisdisabled. EnableIPv6forthenextboot;managethe IPv6address.

--netmask <netmask> -n

esxcfg-volume Theesxcfg-volumecommandmanagesLVMsnapshotorreplicavolumes.InvSphere5,equivalentESXCLI commandsareavailableintheesxcli storage filesystemandintheesxcli storage vmfsnamespaces. Table 23. esxcfg-volume Replacement Commands
esxcfg-volume Option --list -l --mount -m --persistent -M --resignature <VMFS-UUID|label> --umount -u <VMFS-UUID|label> ESXCLI Command storage vmfs snapshot list storage vmfs snapshot mount storage vmfs snapshot resignature storage vmfs snapshot unmount Description ListunresolvedsnapshotLUNsorreplicasofVMFSvolumes. MountasnapshotorreplicaofaVMFSvolume.Usethe --nopersistoptiontomountthevolumenon-persistently. Resignatureasnapshotorreplicavolume. DisconnectandunmountanexistingVMFSorNASvolume. Thecommanddoesnotdeletetheconfigurationforthe volume,butremovesthevolumefromthelistofmounted volumesandhaltsallI/Oornetworktrafficforthisvolume.

VMware, Inc.

27

esxcfg-vswitch Theesxcfg-vswitchcommandmanagesvirtualswitches.InvSphere5,equivalentESXCLIcommandsare available. Table 24. esxcfg-vswitch Replacement Commands


esxcfg-vswitch Option --add | -a <switch_name> --add-pg | -A <portgroup> <vswitch_name> --add-dvp-uplink | -P --add-pg-uplink | -M --check | -c <vswitch_name> ESXCLI Command network vswitch standard add network vswitch standard portgroup add portgroup-name=<string> vswitch-name=<string> Notsupported. esxcli network vswitch standard portgroup policy failover set --active-uplinks=vmnic1,vmnic6,vminic7 network vswitch standard list Description Addanewvirtualswitch. Addaportgrouptothespecifiedvirtual switch. Addanuplinkadaptertoadistributed virtualport(DVP). Updatethelistofactiveuplinksforthe portgroup.Thiscommandfailssilently iftheuplinkadapterdoesnotexist. Checkwhetheravirtualswitchexists. Print1iftheswitchexistsandprint0 otherwise.Usethevirtualswitchname, e.g.vSwitch0orvSwitch1,tospecifythe virtualswitch. Checkwhetherthespecifiedportgroup existsornot. Removeavirtualswitch.Runningthe commandwiththisoptionfailsifany portsonthevirtualswitchareinuseby VMkernelnetworksorvirtualmachines. Removeaportgroupfromthevirtual switch.Runningthecommandwiththis optionfailsiftheportgroupisinuse,for example,byavirtualmachineora VMkernelnetwork.

--check-pg | -C <port_group> <vswitch_name> --delete | -d <vswitch_name>

network vswitch standard portgroup list

network vswitch standard remove --vswitch-name=<vswitch>

--del-pg | -D <port_group> <vswitch_name>

network vswitch standard portgroup remove --vswitch-name=<vswitch> --portgroup-name=<portgroup>

--del-dvp-uplink | -Q <adapter_name> --dvp <DVPort_id> <dvswitch_name> --del-pg-uplink | -N <adapter_name> <port_group> <dvswitch_name> --dvp | -V

ESXCLIdoesnotsupportdistributedswitches. UsethevSphereClienttoconfiguredistributed switches. network vswitch standard portgroup policy failover set --active-uplinks=vmnic1,vmnic6,vminic7 ESXCLIdoesnotsupportdistributedswitches. UsethevSphereClienttoconfiguredistributed switches. network vswitch standard listincludes CDPinformation. PrintthecurrentCDP(CiscoDiscovery Protocol)settingforthisvirtualswitch (validforvSphere4.0andlater). Updatethelistofactiveuplinksforthe portgroup.

--get-cdp | -b <vswitch_name>

Command-Line Management in vSphere 5 for Service Console Users

Table 24. esxcfg-vswitch Replacement Commands (Continued)


esxcfg-vswitch Option --link | -L <physical_nic> <vswitch_name> ESXCLI Command network vswitch standard uplink add --uplink --vswitch Description Addanuplinkadapter(physicalNIC)to avirtualswitch.Runningthecommand withthisoptionattachesanewunused physicalnetworkadaptertoavirtual switch. Listallvirtualswitchesandtheirport groups. SettheMTU(maximumtransmission unit)ofthevirtualswitch.Thisoption affectsallphysicalNICsassignedtothe virtualswitch. Providethenameoftheportgroupfor the--vlanoption.SpecifyALLtoset VLANIDsonallportgroupsofavirtual switch. SettheCDPstatusforagivenvirtual switch(validforvSphere4.0andlater). Toset,specifydown,listen,advertise, orboth. Removeanuplinkadapterfromavirtual switch.Anuplinkadaptercorresponds toaphysicalEthernetadaptertowhich thevirtualswitchisconnected.Ifyou removethelastuplinkadapter,youlose physicalnetworkconnectivityforthat switch. SettheVLANIDforaspecificportgroup ofavirtualswitch.Settingtheoptionto0 disablestheVLANforthisportgroup.If youspecifythisoption,youmustalso specifythe--portgroupoption. 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.

--list | -l --mtu | -m <vswitch_name>

network vswitch standard list network vswitch standard set --mtu=<long>

--pg | -p <port_group>

network vswitch standard portgroup set --vlan-id=<long>

--set-cdp | -B <vswitch_name> [down | listen | advertise | both] --unlink | -U <physical_nic> <vswitch_name>

network vswitch standard set --cpd-status=<string>

network vswitch standard uplink remove --uplink=<uplink> --vswitch=<vswitch>

--vlan | -v --pg <port_group>

network vswitch standard portgroup set --portgroup-name=<str> --vlan-id=<long>

-X --set-maxactive

network vswitch standard portgroup policy failover set --active-uplinks=vmnic1,vmnic6,vminic7

esxtop TheesxtopcommandisavailableandsupportedintheESXiShell.SearchthevSphereDocumentationCenter, orseethevSphereResourceManagementdocumentation. esxupdate TheesxupdatecommandallowsyoutomanageESX4.0andlatersystems.Usethecommandsintheesxcli softwarenamespacetoinstall,update,remove,ordisplayindividualVIBs(softwarepackages).Use commandsintheesxcli software sourcesnamespacetoquerydepotcontentsforVIBsandimageprofiles. AnimageprofiledefinesanESXiimageandconsistsofVIBs.

VMware, Inc.

29

Command-Line Management in vSphere 5 for Service Console Users

IMPORTANTTheupdateprocessinthevSphere5environmenthasbeensimplifiedanddiffersfromthe processinvSphere4.1.Severalcommandoptionsdonothavedirectequivalents.SeetheUpgradeGuide. Table 25. esxupdate Replacement Commands


esxupdate Command query info ESXCLI Command esxcli software vib list vSphere5doesnotsupportbulletins.Instead, youupdateyoursystemwithindividualVIBsor imageprofiles.SeetheUpgradedocumentation. esxcli software vib get --vibname=<str> esxcli software profile get update esxcli software vib update esxcli software profile update esxcli software vib install esxcli software profile install remove stage scan esxcli software vib remove Nolongernecessary. Nolongernecessary. Runesxcli software sources profile to queryforimageprofilesinadepot. Runesxcli software sources vibtodisplay informationaboutVIBURLsandfiles. TheupdatecommandupdatesVIBpackages butdoesnotinstallnewVIBs. TheinstallcommandinstallsVIBpackages fromaURLordepot.Thecommandinstalls, upgrades,ordowngradesVIBs. RemoveselectedVIBsfromthehost. Description ListallinstalledVIBpackages. DisplayinformationononeormoreVIBs.

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. IMPORTANTThevSphereClientnowsupportsalloptionstovm-support.IfyoucannotusethevSphere ClienttoaccessyourESXisystem,youcanusethevm-supportcommand.

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 20102012 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-000888-00

30

You might also like