Backing up an ESXi host configuration
Saturday, December 07, 2019 » linux, vmware
This is a quick guide on how to backup a ESXi host using the vSphere CLI from a different server.
ESXi Command Line
Run on the ESXi host.
1
vim-cmd hostsvc/firmware/backup_config
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 asconfigBundle-HostFQDN.tgz
Restoring the ESXi Configuration
1 2
vim-cmd hostsvc/maintenance_mode_enter vim-cmd hostsvc/firmware/restore_config /tmp/configBundle.tgz
vSphere CLI
Download the latest compressed tarball version of vSphere CLI (requires login) from the vmware website.
Copy the file to the linux host.
1
scp VMware-vSphere-CLI-6.7.0-xxxxx.x86_64.tar.gz user@host:~/
Untar the contents.
1
tar xzvf VMware-vSphere-CLI-6.7.0-xxxxx.x86_64.tar.gz
Install the needed packages.
1
yum install -y openssl-devel libxml2-dev e2fsprogs-dev cpan libuuid-devel perl-XML-LibXML
Run the installation script in the
vmware-vsphere-cli-distrib
folder.1
cd vmware-vsphere-cli-distrib ; ./vmware-install.pl
The installer will prompt to install into the default directory or a custom location, afater the installation is complete run the following to remotely backup your esxi host.
1
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.