Common Options for vCLI Host Management Command Execution

You can use connection options that are available for all vCLI host management commands and common options that you can use when you run a
vicfg-
vCLI command.

vCLI Connection Options

The following table lists options that are available for all vCLI host management commands in alphabetical order. The table includes options for use on the command line and variables for use in configuration files. Options for executing DCLI commands are different.
Starting with vSphere 5.5, vCLI supports both IPv4 and IPv6 connections.
Option and Environment Variable
Description
--cacertsfile <certsfile>
-t <certs_file>
VI_CACERTFILE=<cert_file_path>
ESXCLI commands only.
Used to specify the CA (Certificate Authority) certificate file, in PEM format, to verify the identity of the
system or
system to run the command on.
In vCLI 6.0 and later, you can only run ESXCLI commands if a trust relationship exists between the host you are running the command on and the system you are targeting with the
--server
option (
host or
system). You can establish the trust relationship by specifying the CA certificate file or by passing in the thumbprint for each target server (
host or
system).
--config <cfg_file_full_path>
VI_CONFIG=<cfg_file_full_path>
Uses the configuration file at the specified location.
Specify a path that is readable from the current directory.
--credstore <credstore>
VI_CREDSTORE=<credstore>
Name of a credential store file. Defaults to
<HOME>/.vmware/credstore/vicredentials.xml
on Linux and
<APPDATA>/VMware/credstore/vicredentials.xml
on Windows. Commands for setting up the credential store are included in the vSphere SDK for Perl, which is installed with vCLI. The
vSphere SDK for Perl Programming Guide
explains how to manage the credential store.
--encoding <encoding>
VI_ENCODING=<encoding>
Specifies which encoding to use. Several encodings are supported.
  • utf8
  • cp936
    (Simplified Chinese)
  • shftjis
    (Japanese)
  • iso-885901
    (German)
You can use
--encoding
to specify the encoding for vCLI to map to when it is run on a foreign language system.
--passthroughauth
VI_PASSTHROUGHAUTH
If you specify this option, the system uses the Microsoft Windows Security Support Provider Interface (SSPI) for authentication. Trusted users are not prompted for a user name and password. See the Microsoft Web site for detailed information on SSPI.
This option is supported only if you are connecting to a
system.
--passthroughauthpackage <package>
VI_PASSTHROUGHAUTHPACKAGE= <package>
Use this option with
--passthroughauth
to specify a domain-level authentication protocol to be used by Windows. By default, SSPI uses the Negotiate protocol, which means that client and server try to negotiate a protocol that both support.
If the
system to which you are connecting is configured to use a specific protocol, you can specify that protocol by using this option.
This option is supported only if you are running vCLI on a Windows system and connecting to a
system.
--password <passwd>
VI_PASSWORD=<passwd>
Uses the specified password (used with
--username
) to log in to the server.
  • If
    --server
    specifies a
    system, the user name and password apply to that server. If you can log in to the
    system, you need no additional authentication to run commands on the
    hosts that server manages.
  • If
    --server
    specifies an
    host, the user name and password apply to that server.
Use the empty string (' ' on Linux and " " on Windows) to indicate no password.
If you do not specify a user name and password on the command line, the system prompts you and does not echo your input to the screen.
--portnumber <number>
VI_PORTNUMBER=<number>
Uses the specified port to connect to the system specified by
--server
. Default is 443.
--protocol <HTTP|HTTPS>
VI_PROTOCOL=<HTTP|HTTPS>
Uses the specified protocol to connect to the system specified by
--server
. Default is HTTPS.
--psc <hostname_or_IP>
VI_PSC=<hostname_or_IP>
Host name or IP address of the Platform Services Controller instance that is associated with the
system that manages the host. In many cases, the Platform Services Controller is embedded in the
system, but external Platform Services Controller instances are supported as well. For those cases, use the
--server
option to specify the
system that manages the host.
This option implies user authentication with vCenter Single Sign-On. The user you specify must be able to authenticate to vCenter Single Sign-On.
--savesessionfile <file>
VI_SAVESESSIONFILE=<file>
Saves a session to the specified file. The session expires if it is idle for 30 minutes.
--server <server>
VI_SERVER=<server>
Uses the specified
or
system. Default is
localhost
.
If - -server points to a
system, you can also specify the
--psc
option to log in to the
system with vCenter Single Sign-On.
Use the
--vihost
option to specify the
host that you want to run the command against. See Authenticating Through and vCenter Single Sign-On.
--servicepath <path>
VI_SERVICEPATH=<path>
Uses the specified service path to connect to the
host. Default is
/sdk/webService
.
--sessionfile <file>
VI_SESSIONFILE=<file>
Uses the specified session file to load a previously saved session. The session must be unexpired.
--thumbprint <thumbprint>
VI_THUMBPRINT=<thumbprint>
Expected SHA-1 host certificate thumbprint if no CA certificates file is provided in the
--cacertsfile
argument. The thumbprint is returned by the server in the error message if you attempt to run a command without specifying a thumbprint or certificate file.
--url <url>
VI_URL=<url>
Connects to the specified vSphere Web Services SDK URL.
--username <u_name>
VI_USERNAME=<u_name>
Uses the specified user name.
  • If
    --server
    specifies a
    system, the user name and password apply to that server. If you can log in to the
    system, you need no additional authentication to run commands on the
    hosts that server manages.
  • If
    --server
    specifies an
    system, the user name and password apply to that system.
If you do not specify a user name and password on the command line, the system prompts you and does not echo your input to the screen.
--vihost <host>
-h <host>
When you run a vCLI command with the
--server
option pointing to a
system, use
--vihost
to specify the
host to run the command against.
This option is not supported for each command. If supported, the option is included when you run
<cmd> --help
.

vCLI Common Options

The following lists options not used as connection options that you can use when you run a
vicfg-
vCLI command.
Option
Description
--help
Prints a brief usage message. The message first lists each command-specific option and then each of the common options.
--verbose
Displays additional debugging information.
--version
Displays version information.