This is a quick guide on how to back up an ESXi host using the vSphere CLI from a different server.

Update: The vSphere CLI was deprecated and isn’t supported on ESXi 7.0 and later. On current hosts, use the vim-cmd method below or PowerCLI’s Get-VMHostFirmware -BackupConfiguration.

ESXi Command Line

  1. Run on the ESXi host.

shell vim-cmd hostsvc/firmware/sync_config vim-cmd hostsvc/firmware/backup_config sync_config flushes any pending configuration changes to disk first so the backup is current. Note: The command should output a URL in which a web browser may be used to download the file.

For example : Bundle can be downloaded at : http://*/downloads/123456/configBundle-xx.xx.xx.xx.tgz Where * denotes the host IP/FQDN. The backup file is also located in the /scratch/downloads directory as configBundle-HostFQDN.tgz

  1. Restoring the ESXi Configuration

shell vim-cmd hostsvc/maintenance_mode_enter vim-cmd hostsvc/firmware/restore_config /tmp/configBundle.tgz

vSphere CLI

  1. Download the latest compressed tarball version of vSphere CLI (requires login) from the vmware website.

  2. Copy the file to the linux host.

    shell scp VMware-vSphere-CLI-6.7.0-xxxxx.x86_64.tar.gz user@host:~/ 3. Untar the contents.

    shell tar xzvf VMware-vSphere-CLI-6.7.0-xxxxx.x86_64.tar.gz 4. Install the needed packages.

    shell yum install -y openssl-devel libxml2-dev e2fsprogs-dev cpan libuuid-devel perl-XML-LibXML 5. Run the installation script in the vmware-vsphere-cli-distrib folder.

    shell cd vmware-vsphere-cli-distrib ; ./vmware-install.pl 6. The installer will prompt to install into the default directory or a custom location, after the installation is complete run the following to remotely backup your esxi host.

shell vicfg-cfgbackup --server=ESXi_host_IP_address --username=root -s output_file_name NOTE: the vSphere CLI method has been deprecated on the latest version of ESXi.

vsphere deprecated