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
Getting Started with vSphere Command-Line Interfaces
34 VMware, Inc.
Using the Credential Store
YourvCLIinstallationincludesacredentialstore.Youcanmanagethecredentialstorewiththe
credstore-adminutilityapplication,whichislocatedinthe/Perl/apps/generaldirectoryinsidethe
VMwarevSphereCLIdirectory.
To establish trust for a user with the credential store
1AddtheuserandpasswordforthetargetESXihosttothelocalcredentialstore.
credstore_admin.pl add --server <esxi_HOSTNAME_OR_IP> --username <user> --password <pwd>
2AddthethumbprintforthetargetESXihost.Thisthumbprintwasreturnedintheerrorwhenyou
attemptedtoconnecttothehost.
credstore_admin.pl add --server <esxi_HOSTNAME_OR_IP> --thumbprint <thumbprint>
3Ifyouareusinganon‐defaultcredentialstorefile,youhavetopassitinwiththe--credstoreoption.
Otherwise,thisuserwillbeabletoaccessthehostwithoutauthenticationgoingforward.
Common Options for vCLI Host Management Command Execution
Table 4‐2listsoptionsthatareavailableforallvCLIhostmanagementcommandsinalphabeticalorder.The
tableincludesoptionsforuseonthecommandlineandvariablesforuseinconfigurationfiles.Optionsfor
executingDCLIcommandsaredifferent.
See“RunningHostManagementCommandsfromaWindowsSystem”onpage 37
and“RunningHost
ManagementCommandsfromaLinuxSystem”onpage 37.
IMPORTANTUpdatingthecredentialstoreisatwo‐stepprocess.Firstyouaddtheuserandpasswordforthe
server,andthenyouaddthethumbprintfortheserver.
IMPORTANTStartingwithvSphere5.5,vCLIsupportsbothIPv4andIPv6connections.
Table 4-2. vCLI Connection Options
Option and Environment Variable Description
--cacertsfile <certsfile>
-t <certs_file>
VI_CACERTFILE=<cert_file_path>
ESXCLIcommandsonly.
UsedtospecifytheCA(CertificateAuthority)certificatefile,inPEMformat,
toverifytheidentityofthevCenterServersystemorESXisystemtorunthe
commandon.
InvCLI6.0andlater,youcanonlyrunESXCLIcommandsifatrust
relationshipexistsbetween
thehostyouarerunningthecommandonandthe
systemyouaretargetingwiththe--serveroption(ESXihostorvCenter
Serversystem).YoucanestablishthetrustrelationshipbyspecifyingtheCA
certificatefileorbypassinginthethumbprintforeachtargetserver(ESXihost
orvCenterServer
system).
--config <cfg_file_full_path>
VI_CONFIG=<cfg_file_full_path>
Usestheconfigurationfileatthespecified location.
Specifyapaththatisreadablefromthecurrentdirectory.
--credstore <credstore>
VI_CREDSTORE=<credstore>
Nameofacredentialstorefile.Defaultsto
<HOME>/.vmware/credstore/vicredentials.xmlonLinuxand
<APPDATA>/VMware/credstore/vicredentials.xmlonWindows.
CommandsforsettingupthecredentialstoreareincludedinthevSphereSDK
for
Perl,whichisinstalledwithvCLI.ThevSphereSDKforPerlProgramming
Guideexplainshowtomanagethecredentialstore.
--encoding <encoding>
VI_ENCODING=<encoding>
Specifiestheencodingtobeused.Severalencodingsaresupported.
utf8
cp936(SimplifiedChinese)
shftjis(Japanese)
iso-885901(German).
Youcanuse--encodingtospecifytheencodingvCLIshouldmaptowhenit
isrunonaforeignlanguagesystem.