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
Using PowerCLI to Manage Hosts and Virtual Machines
VMware PowerCLI contains snap-ins and modules based on Microsoft PowerShell for automating vSphere
and vCloud Director administration. PowerCLI provides C# and PowerShell interfaces for vSphere and
other VMware product administration.
PowerCLI is based on Microsoft PowerShell and uses the PowerShell basic syntax and concepts. Microsoft
PowerShell is both a command-line and scripting environment, designed for Windows. It uses the .NET
object model and provides administrators with system administration and automation capabilities. To work
with PowerShell, you run commands, which are called cmdlets.
PowerShell supports features such as pipelines, wildcards, and easy access to command-line help.
You can use ESXCLI commands from the PowerCLI console, by using the following options.
n
Through the cmdlet that provides direct access to the ESXCLI namespaces, applications, and
commands.
n
Through .NET methods, which you use to create managed objects that correspond to specic ESXCLI
applications. To access the ESXCLI, you can call methods on these managed objects.
See the PowerCLI User’s Guide in the vSphere documentation center.
Using DCLI to Manage vCenter Services
With the DCLI command set, you can run virtual machine management, appliance management, content
library, and tagging commands.
You cannot manage services that are part of vSphere 5.5 or earlier from DCLI. DCLI is not a host
management CLI.
DCLI is a CLI client of the vSphere Automation SDK. The following workow explains how DCLI works.
1 You run a DCLI command.
2 If you are not authenticated, DCLI prompts for a user name and password.
3 The command connects you to the vCenter Single Sign-On service and checks whether the user account
specied on the command-line or in a credential store le can authenticate.
4 If you can authenticate, DCLI communicates with the vCenter Server and runs the vSphere Automation
API that corresponds to the DCLI command. Dierent vCenter Server systems support dierent
services.
N If the authenticated user account does not have permissions to run the DCLI command, you
receive an Unauthorized error message, even if the user credentials are correct.
5 DCLI displays the result or an error message.
You can run DCLI commands as follows.
n
vCLI package - Install the vCLI package on the server of your choice, or deploy a vMA virtual machine.
You can then run DCLI commands against an endpoint. See “Using DCLI Commands,” on page 48.
n
vCenter Server Appliance - Run DCLI commands from the vCenter Server Appliance shell. See
“Running DCLI Commands on the vCenter Server Appliance,” on page 49.
n
vCenter Server Windows command prompt - Install vCenter Server on a supported Windows system
and run DCLI commands from the command prompt.
Getting Started with vSphere Command-Line Interfaces
12 VMware, Inc.