6.0
Table Of Contents
- Getting Started with vSphere Command-Line Interfaces
- Contents
- About This Book
- Managing vSphere with Command-Line Interfaces
- Installing vCLI
- Running Host Management Commands in the ESXi Shell
- Running vCLI Host Management Commands
- Overview of Running vCLI Host Management Commands
- Protecting Passwords
- Authenticating Through vCenter Server and vCenter Single Sign-On
- Authenticating Directly to the Host
- Trust Relationship Requirement for ESXCLI Commands
- Common Options for vCLI Host Management Command Execution
- Using vCLI Commands in Scripts
- Running Host Management Commands from a Windows System
- Running Host Management Commands from a Linux System
- Running DCLI Commands
- Index
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
VMwarevSpherePowerCLIcontainssnap‐insandmodulesbasedonMicrosoftPowerShellforautomating
vSphereandvCloudDirectoradministration.PowerCLIprovidesC#andPowerShellinterfacestovSphere
andotherVMwareproductadministration.
vSpherePowerCLIisbasedonMicrosoftPowerShellandusesthePowerShellbasicsyntaxandconcepts.
MicrosoftPowerShellisboth
acommand‐lineandscriptingenvironment,designedforWindows.Itusesthe
.NETobjectmodelandprovidesadministratorswithsystemadministrationandautomationcapabilities.To
workwithPowerShell,youruncommands,whicharecalledcmdlets.
PowerShellsupportsfeaturessuchaspipelines,wildcards,andeasyaccesstocommand‐linehelp.
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
OTEStartingwithvSphere6.0,atrustrelationshipmustexistbetweenthehostfromwhichyourun
ESXCLIcommandsandthetargetESXihostorvCenterServersystem.SeeAppendix 4,“Trust
RelationshipRequirementforESXCLICommands,”onpage 33.
NOTETorunanESXCLIcommandfromPowerCLI,youmustprovidevaluesforallparameters.Ifyou
wanttoomitagivenparameter,pass$nullasitsargument.