vSphere Command-line Interface (vSphere CLI) is an official command-line tool to manage your vSphere infrastructure. Next, this article will briefly introduce it and show you how to install it on your system.
Virtualization offers great convenient and cost reduction for enterprises in the 21st century. With tools like VMware vSphere, it is possible for administrators to efficiently deploy and manage a large virtual environment on the official VMware vSphere Client. Most of its settings are available in the graphical user interface (GUI), but for all configurations including those not displayed in GUI, you need to use vSphere Command-line Interface (CLI).
vSphere Command-line Interface (vCLI) is a composite package of tools and libraries, including commands for managing different aspects of your environment, either locally or remotely.
For vSphere Command-line Interface download, you can go to VMware’s official website: vSphere CLI or find the installer in the Automation Tools and SDKs section of the Drivers & Tools tab of the vSphere download page.
Take vSphere 6.7 as an example, the components of the vSphere CLI command set including:
VMware has announced the end of life of vSphere CLI.
According to VMware, starting with vSphere 7.0, vSphere CLI package is not be released and it will be end of life, but all existing capabilities of vSphere CLI are supported with more API centric tools such as esxcli and Perl SDK.
You can download esxcli and/or Perl SDK as separate packages. Vicfg scripts shipped with the vCLI package will no longer be available in the future vSphere releases.
Next, this part will show you how to install vSphere Command-line Interface on your system. After installation, you can run vCLI commands and vSphere SDK for Perl utility applications from the operating system command line.
The vCLI installer installs both vSphere SDK for Perl and vCLI because many vCLI commands run on top of the vSphere SDK for Perl. You can install a vCLI package on a Linux or a Microsoft Windows system, and the content of the installer package differs for different platforms.
You can select from them according to your system type.
1. Download the vCLI Windows installer package, and then start the installer, click Next in the Welcome page.
Note: If you are prompted to remove older versions of vSphere SDK for Perl or vCLI, you can either accept or cancel the installation, and install the vCLI package on a different system. Please note that the installer replaces both the vSphere SDK for Perl and vCLI. If you want to keep an older version, please install this package on a different system.
2. To install the vCLI in a nondefault directory, click Change and select an alternative directory. And then click Next to continue.
The default location is C:\Program Files\VMware\VMware vSphere CLI.
3. Click Install to proceed with the installation.
4. The installation might take several minutes to complete. Then you can reboot your system.
Note: If you do not reboot, path settings might not be correct on your Windows platform.
1. Download the vCLI Linux installer package.
2. Log in as root, and untar the vCLI binary that you downloaded.
tar –zxvf VMware-vSphere-CLI-6.X.X-XXXXX.x86_64.tar.gz
A vmware-vsphere-vcli-distrib directory is created.
3. (Optional) If your server uses a proxy to access the Internet, and if your http:// and ftp:// proxy were not set when you installed prerequisite software, set them now.
export http_proxy=:port
export ftp_proxy=:port
4. Run the installer.
sudo vmware-vsphere-cli-distrib/vmware-install.pl
5. To accept the license terms, enter yes and press Enter.
The installer connects to CPAN and installs prerequisite software. Establishing a connection might take a long time.
6. Specify an installation directory, or press Enter to accept the default, which is /usr/bin.
A complete installation process has the following result.
If you accepted the defaults during installation, you can find the installed software in the following locations.
You may need an effective backup software for VMware vSphere to protect your virtual environment and gain the ability to quickly recover your virtual machines when needed. In this article, I will introduce an efficient vSphere backup software - AOMEI Cyber Backup, which enables you to backup multiple VMs either managed by vCenter Server, or on a standalone ESXi host.
It simplifies the backup process and present the steps with intuitive GUI interface. In addition, it offers you the following benefits.
✦ Agentless Backup: create complete and independent image-level backup for VMware ESXi and Hyper-V VMs. ✦ Flexible vSphere Backup: batch backup large numbers of VMs managed by vCenter Server, or multiple VMs on a standalone ESXi host. ✦ Multiple Storage Destinations: backup to local drive, or network destinations like Windows share or NAS. ✦ Automated Execution: create backup schedules to automate backups daily, weekly, monthly. ✦ Role Assignment: allows one administrator to create sub-accounts with limited privileges.
AOMEI Cyber Backup supports both paid and free versions of VMware ESXi 6.0 and later versions. Next, I will show you how to perform vSphere VM backup and restore via AOMEI Cyber Backup. You can click the following button to download the free trial.
*You can choose to install this VM backup software on either Windows or Linux system.
▶ Backup multiple VMs:
1. Bind Devices: Access to AOMEI Cyber Backup web client, navigate to Source Device > VMware > + Add VMware Device to Add vCenter or Standalone ESXi host. And then click … > Bind Device.
2. Create Backup Task: Navigate to Backup Task > + Create New Task, and select VMware ESXi Backup as the Backup Type.
3. Set the Task Name, Device, Target, Schedule and Cleanup as needed.
4. Run Backup: Now you can click Start Backup and select Add the schedule and start backup now, or Add the schedule only.
Created backup tasks will be listed and monitored separately for restoring, progress checking and schedule changing.
▶ Restore VM from backup:
5. Restore from Backup: Select the backup task you want to restore, and click ... > Restore to open the wizard.
Or you can click Backup Management > History Versions. Specify a VM and select a restore point from the left list.
6. Start Restore: Choose to Restore to original location or Restore to new location. And click Start Restore to recover the virtual machine in place.
▶ Restore to new location: Create a new VM in the same or another datastore/host directly from the backup to perform out-of-spacre recovery, saves the trouble of re-configuring the new VM.
vSphere Command-line Interface (vSphere CLI) is an official administrative interface for managing ESXi hosts, making it possible for you to configure all settings, including the hidden ones from GUI. This article briefly introduced what is vSphere Command-line Interface, and showed you how to install it on Windows or Linux systems.
Except for managing ESXi hosts, protect the data on your virtual machines is also of great importance. You can backup VMware ESXi VMs via AOMEI Cyber Backup, an efficient VM backup software that provides continuous protection for your vSphere environment.