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
42 VMware, Inc.
Example
dcli com vmware cis tagging tag create --help
usage: com vmware cis tagging tag create [-h] --create-spec-name CREATE_SPEC_NAME
--create-spec-description CREATE_SPEC_DESCRIPTION --create-spec-category-id
CREATE_SPEC_CATEGORY_ID
Creates a tag
Input Arguments:
-h, --help show this help message and exit
--create-spec-name CREATE_SPEC_NAME
The display name of the tag (required string)
--create-spec-description CREATE_SPEC_DESCRIPTION
The description of the tag (required string)
--create-spec-category-id CREATE_SPEC_CATEGORY_ID
The unique identifier of the parent category in which this tag will be
created (required string)
Running DCLI Commands Included in the vCLI Package
YourunvCLIcommandsfromanadministrationserveronwhichyouinstalledthevCLIpackage.After
installation,openacommandpromptintheVMware\VMware DCLI folder,whichisatthesamelevelasthe
VMwarevSphereCLIfolder.
Youspecifyaserver,username,andpassword.Ifyouspecifycredstore-add,DCLIcreates
acredentialstore
fileonthelocalmachineandyouarenolongerrequiredtospecifytheusernameandpasswordwhenyourun
DCLIcommandsagain.
Running DCLI Commands on the vCenter Server Appliance
TherootuseronthevCenterServerAppliancecanrunDCLIcommandsfromtheapplianceshell.
1SSHintotheshellorlogintotheshelldirectlyastherootuser.
Theadministrator@vsphere.localuserdoesnothaveprivilegestorunDCLIcommands.
2Youcanruncommandsindividually,orstarttheinteractiveDCLIshell.Theinteractiveshellhasseveral
advantagesincludingtabcompletionandahistoryfile.
>dcli +interactive
3Youcanlistcommands,displayhelpforcommands,andexecutecommands.Intheexamplebelow,the
interactiveshellusesthedcli>prompt,thedefault.
dcli> com vmware vapi metadata cli command list
Using DCLI with a Credential Store File
ToavoidtypingintheusernameandpasswordeachtimeyourunaDCLIcommand,youcanaddthecurrent
userandtheassociatedpasswordandserverIPaddresstoacredentialstorefilebyusingthecredstore-add
optiononthecommandline.
Passwordsareencryptedinthecredentialstore
file,butifyouwanttoremovecredentialstoreinformation,
youcanuse+credstore-removetodoso.
Bydefault,thecredentialstorefileislocatedin<homedir>/.dcli/.dcli_credstore,butyoucanchangethe
locationwiththe+credstore-fileoption.
Examples
Thefollowingexamplesillustratehowyoucaninteractwiththecredential
store.
1Addanewcredentialstoreentry.
dcli com vmware cis tagging tag list +credstore-add +username user1
2Removeacredentialstoreentry.