6.0

Table Of Contents
VMware, Inc. 11
Chapter 1 Managing vSphere with Command-Line Interfaces
InstallthevCLIpackageononeofthesupportedWindowsorLinuxsystems.TheESXCLIcommandset
isincluded.SpecifyconnectionoptionstoruncommandsagainstanESXihostdirectly,ortargetavCenter
ServersystemandspecifytheESXihosttorunthecommandagainst.See“InstallingvCLI”onpage 15.
SeeChapter 4,“RunningvCLIHostManagementCommands,”onpage 27.
ESXCLI Command Support when Host and vCLI Version Do Not Match
WhenyourunanESXCLIvCLIcommand,youmustknowthecommandssupportedonthetargethost
specifiedwith--serverorasavMAtarget.Forexample:
IfyouruncommandsagainstESXi4.xhosts,ESXCLI4.xcommandsaresupported.
IfyouruncommandsagainstESXi5.0hosts,ESXCLI5.0commandsaresupported.ESXCLI5.1
commandsthatwereincludedinESXCLI5.0arealsosupported.
IfyouruncommandsagainstESXi5.1hosts,ESXCLI5.1andESXCLI5.0commandsaresupported.
VMwarepartnersmightdevelopcustomESXCLIcommandsthatyoucanrunonhostswherethepartnerVIB
isinstalled.
Runesxcli --server <target> --helpforalistofnamespacessupportedonthetarget.Youcandrill
downinto
thenamespacesforadditionalhelp.
Using PowerCLI to Manage Hosts and Virtual Machines
VMwarevSpherePowerCLIcontainssnapinsandmodulesbasedonMicrosoftPowerShellforautomating
vSphereandvCloudDirectoradministration.PowerCLIprovidesC#andPowerShellinterfacestovSphere
andotherVMwareproductadministration.
vSpherePowerCLIisbasedonMicrosoftPowerShellandusesthePowerShellbasicsyntaxandconcepts.
MicrosoftPowerShellisboth
acommandlineandscriptingenvironment,designedforWindows.Itusesthe
.NETobjectmodelandprovidesadministratorswithsystemadministrationandautomationcapabilities.To
workwithPowerShell,youruncommands,whicharecalledcmdlets.
PowerShellsupportsfeaturessuchaspipelines,wildcards,andeasyaccesstocommandlinehelp.
Youcan
useESXCLIcommandsfromthevSpherePowerCLIconsole,asfollows:
Throughthecmdlet,whichprovidesdirectaccesstotheESXCLInamespaces,applications,and
commands.
Through.NETmethods,whichyouusetocreatemanagedobjectsthatcorrespondtospecificESXCLI
applications.ToaccesstheESXCLI,youcancallmethodsonthesemanagedobjects.
SeethevSpherePowerCLIUser’sGuideinthevSpheredocumentationcenter.
Using DCLI to Manage vCenter Services
TheDCLIcommandsetallowsyoutomanagevCenterservicesthatarenewinvSphere6.0.Youcannot
manageservicesthatwerepartofvSphere5.5fromDCLI.DCLIisnotahostmanagementCLI.
DCLI(DatacenterCLI)isaCLIclientofthevCloudSuiteSDK.DCLIworkslikethis:
1TheuserrunsacommandintheDCLIdirectoryandspecifiesausername.
N
OTEStartingwithvSphere6.0,atrustrelationshipmustexistbetweenthehostfromwhichyourun
ESXCLIcommandsandthetargetESXihostorvCenterServersystem.SeeAppendix 4,“Trust
RelationshipRequirementforESXCLICommands,”onpage 33.
NOTETorunanESXCLIcommandfromPowerCLI,youmustprovidevaluesforallparameters.Ifyou
wanttoomitagivenparameter,pass$nullasitsargument.