6.0

Table Of Contents
Getting Started with vSphere Command-Line Interfaces
10 VMware, Inc.
Using ESXCLI for Host Management
YoucanmanagemanyaspectsofanESXihostwithcommandsintheESXCLIcommandset.Youcanrun
ESXCLIcommandsasvCLIcommands,orrunthemintheESXiShellintroubleshootingsituations.
YoucanalsorunESXCLIcommandsfromthePowerCLIshellbyusingtheGet-EsxClicmdlet.Seethe
vSphere
PowerCLIAdministrationGuideandthevSpherePowerCLIReference.
ThesetofESXCLIcommandsthatareavailableonahostdependsonthehostconfiguration.ThevSphere
CommandLineInterfaceReferencelistshelpinformationforallESXCLIcommands.Youcanrunesxcli
--server <MyESXi> --helpbeforeyourunacommandona
hosttomakesurethatthecommandisdefined
onthehostyouaretargeting.
ESXCLI Syntax
EachESXCLIcommandusesthesamesyntax.
esxcli [dispatcher options] <namespace> [<namespace> ...] <cmd> [cmd options]
dispatcheroptions.Predefinedoptionsforconnectioninformationsuchastargethost,username,andso
on.SeeChapter 4,“RunningvCLIHostManagementCommands,”onpage 27.Notrequiredwhenyou
runthecommandintheESXiShell.IfthetargetserverisavCenterServersystem,specifythetargetESXi
host
beforeanyESXCLInamespaces,commands,andsupportedoptions.
ManyESXCLIcommandsgenerateoutputyoumightwanttouseinyourapplication.Youcanrunesxcli
withthe--formatterdispatcheroptionandsendtheresultingoutputasinputtoaparser.
namespace.GroupsESXCLIcommands.vSphere5.0andlatersupportnestednamespaces.
command.Reportsonormodifiesstateonthesystem.
Examples
esxcli --server myESXi --username user1 --password 'my_password' storage nfs list
esxcli --server myVCServer --username user1 --password 'my_pwd' --vihost myESXi.mycompany.com
storage nfs list
options.Manycommandssupportoneormoreoptions,displayedinthehelporthevCLIReference.For
somecommands,multipleoptionvalues,separatedbyspaces,arepossible.
Example
esxcli system module parameters set -m <module> -p "a=1 b=1 c=1"
Running ESXCLI vCLI Commands
YoucanrunanESXCLIvCLIcommandintheESXiShellfortroubleshootingandremotelyagainstaspecific
hostoragainstavCenterServersystem.Youhavethefollowingchoices:
DeploythevMAapplianceonanESXisystemandauthenticateagainstasetoftargetservers.Youcan
thenrunESXCLIcommandsagainstanytargetserverbyspecifyingthe--hostdispatcheroption.No
additionalauthenticationisrequired.SeethevSphereManagementAssistantGuide.
I
MPORTANTStartingwithvSphere6.0,ESXCLIexpectsatrustrelationshipbetweenthetargethostand
thesystemonwhichyourunthecommand.Youcanestablishthisrelationshipinoneoftheseways:
Usethe--cacertsfileoptionorVI_CACERTFILE variable
Storethethumbprintinthesessionfile.
Specifythethumbprintwiththe--thumbprintoptionorVI_THUMBPRINTvariable.
Youcanpassinthethumbprintthatisreturnedintheerrorifyoutrustthehostyouaretargeting.See
“TrustRelationshipRequirementforESXCLICommands”onpage 33foranexample.