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. 29
Chapter 4 Running vCLI Host Management Commands
Order of Precedence for vCLI Host Management Commands
WhenyourunavCLIhostmanagementcommand,authenticationhappensintheorderofprecedenceshown
inTable 4‐1.Thisorderofprecedencealwaysapplies.Thatmeans,forexample,thatyoucannotoverridean
environmentvariablesettinginaconfigurationfile.
IfyouareauthenticatingthroughvCenterSingleSign‐On,the
orderofprecedenceispreserved,forexample,
informationyouspecifyonthecommandlineoverridesinformationinanenvironmentvariable.
Authenticating Through vCenter Server and vCenter Single Sign-On
ForallESXihoststhat aremanagedbyavCenterServersystemthatisintegratedwithvCenterSingleSign‐On
6.0andlater,youcanauthenticatedirectlytothevCenterServersystem,oryoucanauthorizetovCenter
ServerthroughvCenterSingleSign‐On.
BestpracticeistoauthenticatethroughvCenter
SingleSign‐On.ThevCenterSingleSign‐Onserviceis
includedinthePlatformServicesController.ThePlatformServicesControllercanbeembeddedinyour
vCenterServerinstallation,oronePlatformServicesControllercanhandleauthentication,certificate
management,andsomeothertasksformultiplevCenterServersystems.
Youusethe
--pscoptionand,optionally,the--server option.
psc‐SpecifiesthePlatformServicesControllerinstanceassociatedwiththevCenterServersystemthat
managesthehost.
server‐SpecifiesthevCenterServersystemthatmanagesthehost.RequiredifthePlatformServices
ControllerinstanceisassociatedwithmorethanonevCenterServersystem.
vihost‐SpecifiestheESXihost,asinearlierversionsofvCLI.
Examples
vicfg-nics -l --username <sso_username> --password "<admin_pwd>" --server <vc_HOSTNAME_OR_IP>
--psc <psc_HOSTNAME_OR_IP> --vihost <esxi_HOSTNAME_OR_IP>
esxcli --server <vc_HOSTNAME_OR_IP> --vihost <esxi_HOSTNAME_OR_IP> --username <USERNAME>
--password <PASSWORD> --psc <psc_HOSTNAME_OR_IP> hardware clock get
IfthespecifieduserisknowntovCenterSingleSign‐On,asessioniscreated.Youcansavethesessionwiththe
--savesessionfileargument,andlaterusethatsessionwiththe--sessionfile argument.Forexample,
youcansavethesessionbyrunningthiscommand:
N
OTEAvailableoptionsandorderofprecedencearedifferentforDCLI.See“OrderofPrecedenceforDCLI
Authentication”onpage 43.
Table 4-1. vCLI Authentication Precedence
Authentication Description See
Commandline Password(--password),sessionfile
(--sessionfile),orconfigurationfile
(--config)specifiedonthecommandline.
“UsingaSessionFile”onpage 30
Environment
variable
Passwordspecifiedinanenvironmentvariable. “UsingEnvironmentVariables”onpage 30
Configurationfile Passwordspecifiedinaconfigurationfile. “UsingaConfigurationFile”onpage 31
Currentaccount
(ActiveDirectory)
Currentaccountinformationusedtoestablish
anSSPIconnection.AvailableonlyonWindows.
“UsingMicrosoftWindowsSecuritySupport
ProviderInterface”onpage 32
Credentialstore Passwordretrievedfromthecredentialstore. vSphereWebServicesSDKProgrammingGuide
andvSphereSDKforPerlProgrammingGuide.
Prompttheuserfor
apassword.
Passwordis
notechoedtoscreen.
NOTEYoucannotusethisapproachifvCenterServerisintegratedwithvCenterSingleSign‐On5.0.