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
Authentication Description
Command line The user name and password specied on the command line take precedence, even if a credential
store exists.
Environment variable A user name specied in an environment variable takes precedence over user names in the
credential store, but not over the command line.
Credential store The user name and password retrieved from the credential store. A custom credential store le at
a non-default location has precedence over a le at the default location.
Input, Output, and Return Codes
DCLI supports the following input arguments.
Basic types
You can enter basic types like string, int, double, or boolean on the command
line.
List types
You can provide the same option multiple times on the command line and
DCLI treats it as a list.
Currently supported output formaer types are simple, xml, html, table, csv and json. You can change the
output format by passing the formatter option to DCLI.
For scripting purposes DCLI returns a non-zero error code for an unsuccessful command. To see the last
command status in interactive mode, run the $? command.
Using DCLI with Variables
You can predene a set of variables in the environment where you run DCLI commands so you do not have
to pass the options every time you run a command. The following environment variables are supported.
Variables Supported by DCLI
Variable Description
DCLI_SERVER Set this variable to pass the server IP address.
Passing the server option on the command line overrides this variable.
DCLI_CACERTFILE Set this variable to pass the path of a CA certicate le.
Passing the cacert-file option on the command line overrides this variable.
DCLI_USERNAME Set this variable to pass the user name required for authentication.
Passing the username option on command line overrides this variable.
DCLI_CREDFILE Set this variable to point to a DCLI credential store le. Default value is
~/.dcli/.dcli_credstore.
Passing the credstore-file option on the command line overrides variable.
DCLI_HISTFILE Set this variable to point to a DCLI interactive shell history le path. Default value is
~/.dcli/.dcli_history.
DCLI_LOGFILE Set this variable to specify the log le for DCLI.
Using DCLI Interactive Mode
DCLI supports interactive shell mode which you can activate by using dcli +interactive.
Interactive mode supports tab completion of namespaces, commands, command options, and option values
in case of enumeration values. With DCLI interactive mode you can also pass a partial command if it is
uniquely resolvable. For example, dcli> com vmware vcenter vm list can also be run as dcli> vm list.
Getting Started with vSphere Command-Line Interfaces
50 VMware, Inc.