6.5
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
- Run Host Management Commands from a Windows System
- Run Host Management Commands from a Linux System
- Running DCLI Commands
- Index
You must specify a server, user name, and password. If you specify credstore-add, DCLI creates a credential
store le on the local machine. As a result, you are no longer required to specify the user name and
password when you run DCLI commands again.
Running DCLI Commands on the vCenter Server Appliance
The root user on the vCenter Server Appliance can run DCLI commands from the appliance shell.
The following options are available.
n
Use SSH to connect to the shell or log in to the shell directly as the root user.
n
You can run commands individually, or start the interactive DCLI shell. The interactive shell has several
advantages including tab completion and a history le.
>dcli +interactive
n
You can list commands, display help for commands, and run commands. In the example below, the
interactive shell uses the default dcli> prompt.
dcli> com vmware vcenter vm list
Using DCLI with a Credential Store File
To avoid entering the user name and password each time you run a DCLI command, you can add the
current user and the associated password and server IP address to a credential store le by using the
credstore-add option on the command line.
Passwords are encrypted in the credential store le, but if you want to remove credential store information,
you can use +credstore-remove to do so.
By default, the credential store le is located in <homedir>/.dcli/.dcli_credstore, but you can change the
location with the +credstore-file option.
Examples
The following examples illustrate how you can interact with the credential store.
1 Add a new credential store entry.
dcli com vmware cis tagging tag list +credstore-add +username user1
2 Remove a credential store entry.
dcli +credstore-remove +server <server> +username user1
3 List all credential store entries.
dcli +credstore-list
Order of Precedence for DCLI Authentication
When you run a DCLI command, authentication happens in order of precedence, which always applies.
That means, for example, that you can override an environment variable seing from the command line.
If you are authenticating through vCenter Single Sign-On, the order of precedence is preserved.
The following table shows the DCLI authentication precedence order.
Chapter 5 Running DCLI Commands
VMware, Inc. 49