6.0

Table Of Contents
VMware, Inc. 29
Chapter 4 Running vCLI Host Management Commands
Order of Precedence for vCLI Host Management Commands
WhenyourunavCLIhostmanagementcommand,authenticationhappensintheorderofprecedenceshown
inTable 41.Thisorderofprecedencealwaysapplies.Thatmeans,forexample,thatyoucannotoverridean
environmentvariablesettinginaconfigurationfile.
IfyouareauthenticatingthroughvCenterSingleSignOn,the
orderofprecedenceispreserved,forexample,
informationyouspecifyonthecommandlineoverridesinformationinanenvironmentvariable.
Authenticating Through vCenter Server and vCenter Single Sign-On
ForallESXihoststhat aremanagedbyavCenterServersystemthatisintegratedwithvCenterSingleSignOn
6.0andlater,youcanauthenticatedirectlytothevCenterServersystem,oryoucanauthorizetovCenter
ServerthroughvCenterSingleSignOn.
BestpracticeistoauthenticatethroughvCenter
SingleSignOn.ThevCenterSingleSignOnserviceis
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
IfthespecifieduserisknowntovCenterSingleSignOn,asessioniscreated.Youcansavethesessionwiththe
--savesessionfileargument,andlaterusethatsessionwiththe--sessionfile argument.Forexample,
youcansavethesessionbyrunningthiscommand:
N
OTEAvailableoptionsandorderofprecedencearedifferentforDCLI.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. “UsingEnvironmentVariablesonpage 30
Configurationfile Passwordspecifiedinaconfigurationfile. “UsingaConfigurationFile”onpage 31
Currentaccount
(ActiveDirectory)
Currentaccountinformationusedtoestablish
anSSPIconnection.AvailableonlyonWindows.
“UsingMicrosoftWindowsSecuritySupport
ProviderInterface”onpage 32
Credentialstore Passwordretrievedfromthecredentialstore. vSphereWebServicesSDKProgrammingGuide
andvSphereSDKforPerlProgrammingGuide.
Prompttheuserfor
apassword.
Passwordis
notechoedtoscreen.
NOTEYoucannotusethisapproachifvCenterServerisintegratedwithvCenterSingleSignOn5.0.