Transitioning Service Console Commands
If you are currently managing your environment with service console commands, you can perform the same management tasks in vSphere 5.0 and later in one of the following ways.
Transitioning Service Console Commands. Reference to Replacements for Service Console Commands lists vCLI or ESXCLI replacements for service console commands and points to migration lists in this technical note.
Command-Line Interfaces in ESX 4.1 and ESXi 5.0 and later illustrates the differences between CLIs in ESXi 4.1 and ESXi 5.0 and later.
Command-Line Interfaces in ESX 4.1 and ESXi 5.0 and later
Using vSphere Client Interfaces
Most tasks you perform in the ESX Service Console can be performed by one of the graphical user interfaces to ESXi or vCenter Server systems. The interfaces allow you to manage your infrastructure, and to perform operations on multiple hosts at the same time.
vSphere 5.0 and later documentation explains how to perform tasks by using one of the client UIs. Online help is available from both client UIs.
Running vCLI or PowerCLI Commands from Remote Hosts
If you have scripts that use ESX 4.x service console commands or run commands in the ESX 4.x service console directly, running vCLI commands or PowerCLI cmdlets from the host on which you installed those packages gives the best results. However, running off-host is highly recommended because it facilitates scripting.
You can use vCLI even if hosts are in lockdown mode by targeting the vCenterServer system and specifying the target ESXi host with the --vihost parameter, for example:
esxcli --server <my_vc> --vihost <my_esxi> [<authentication>] storage nfs list
If you do not specify additional authentication parameters, the vCLI infrastructure prompts for a username and password for the vCenter Server system specified by --server.
vCLI Command Set
The vCLI command set includes common system administration commands which you can run against ESXi systems from any machine with network access to those systems. You can also run most vCLI commands against a vCenter Server system and target any ESXi system that vCenter Server system manages.
Install the vCLI command set on a supported versions of Windows or Linux. The user running a command against a server must be authenticated for that server. The vCLI package includes several command sets.
Run esxcli --help to see all top-level namespaces. You can run --help at any level of the hierarchy.
The esxcli command set in the ESXi Shell and the esxcli vCLI command set support the same functionality. When running vCLI commands, you must specify the target server and authentication options.
vicfg- (esxcfg-) vCLI commands
Set of commands for managing many aspects of vSphere. For each vicfg- vCLI command, the package includes an esxcfg- vCLI command that is equivalent of the vicfg- vCLI command.
Important: esxcfg- vCLI commands are not always equivalent to corresponding esxcfg- service console or ESXi Shell commands.
vicfg- commands will be deprecated in future releases. Use esxcli commands instead where possible.
A small set of management commands is available. Commands include vifs for file migration, vmware-cmd for managing virtual machines, and vmkfstools for VMFS file management.
The following documentation helps you work with vCLI commands.
Getting Started with vSphere Command-Line Interfaces gives overviews of available commands and includes instructions for installing vCLI on Widows or Linux and detailed information about connection options.
vSphere Command-Line Interface Concepts and Examples presents usage examples for many commands, such as setting up software and hardware iSCSI, adding virtual switches, setting up Active Directory authentication, and so on. The document includes the same example with the vicfg- command and the ESXCLI command where supported.
vSphere Command-Line Interface Reference is a reference to both vicfg- commands and ESXCLI commands. The vicfg- command help is generated from the POD available for each command, run pod2html for any vicfg- command to generate individual HTML files interactively. The ESXCLI reference information is generated from the ESXCLI help.
Running ESXCLI Commands Against ESXi 4.x Hosts
When you run an ESXCLI vCLI command, you must know the commands supported on the target host specified with --server or as a vMA target.
VMware partners might develop custom ESXCLI commands that you can run on hosts where the partner VIB has been installed.
Run esxcli --server <target> --help for a list of namespaces supported on the target. You can drill down into the namespaces for additional help.
Important ESXCLI on ESX 4.x hosts does not support targeting a vCenter Server system. You can therefore not run commands with --server pointing to a vCenter Server system even if you install vCLI 5.0 or vCLI 5.1.
PowerCLI Cmdlet Set
VMware offers a comprehensive set of PowerCLI cmdlets. You can install the PowerCLI package on a Windows system on which Microsoft PowerShell is installed and use PowerCLI cmdlets to manage hosts and virtual machines. PowerCLI cmdlets and vCLI commands overlap in functionality. The PowerCLI focus is on virtual machine management. The vCLI focus is on host management.
See the vSphere PowerCLI documentation set, available in the VMware Administration Automation Products section of the vSphere documentation page.
Using the ESXi Shell
Each ESXi host includes an ESXi Shell, which is disabled by default. Administrators can use that shell to perform troubleshooting and advanced tasks such as testing scripts in non production environments.
You can access the shell as follows:
The ESXi Shell includes the following command sets.
Run esxcli --help to see all top-level namespaces. You can run --help at any level of the hierarchy.
The esxcli command set in the ESXi Shell and the esxcli vCLI command set support the same functionality. When running vCLI commands, you must specify the target server and authentication options.
esxcfg- commands
Set of commands for managing many aspects of vSphere. Most esxcfg- commands available in the ESX 4.x service console are available in the ESXi Shell but are deprecated in ESXi 5.0 and will be removed in a future release.
Use ESXCLI commands instead of esxcfg- commands. If no ESXCLI command exists, use the vicfg- commands in the vCLI command set.
A small set of POSIX-style commands is included in the shell (see Shell Commands). These commands are not supported by VMware but are included for use in troubleshooting situations. Use the vSphere Client or VMware commands instead where possible.
localcli commands
Set of troubleshooting commands for use with VMware Technical Support. localcli commands equivalent to ESXCLI commands but bypass the host daemon (hostd).
Warning: localcli commands are only for situations when hostd is unavailable and cannot be restarted. After you run a localcli command, you must restart hostd. Using localcli commands in other situations is not supported. An inconsistent system state and potential failure can result.