In this post, you will learn how to backup and restore the VMware ESXi 6.5 configuration using the ESXi command line.
It goes without saying how important it is to have a backup and the configuration of an ESXi host is no exception. It can be time consuming to configure the network settings and should your hosts USB stick or operating system drive fail, a backup will save you time.
The following tutorial will show you how to create a backup and how to do a restore should you need to.
First of all, since this tutorial will be using the ESXi command line, you will need to connect to the host using SSH. If you don’t know how to enable SSH, you can learn how in the following post: How to Connect to an ESXi 6.5 Host using SSH on Windows.
Once you have connected to the host via SSH, run the following command to backup the configuration:
vim-cmd hostsvc/firmware/backup_config
The following image shows the output of the command.
The backup will be saved in /scratch/downloads
Obviously storing the backup on the same device is not ideal so we need to transfer the archive off the host. You can do that by entering the URL of the backup commands output into a web browser. As you can see in the image above the URL does not contain the IP address of the host. You will need to replace the * with the host IP address.
Alternatively you can use WinSCP or some other utility to transfer the archive using SSH.
In order to restore the backup of the ESXi configuration, you need to install the same version and build number of ESXi on your hardware. Once installed, you need to configure the management network so that you can connect to the device using SSH. Again you will need to enable SSH which you can find out how to do in the post: How to Connect to an ESXi 6.5 Host using SSH on Windows.
Once connected you will need to transfer the backup archive to /tmp/configBundle.tgz on the host using a transfer utility. Read How to Transfer ISO Images and Files to an ESXi Host from Windows to find out how.
With the file transfered, all that’s left to do is run the following commands:
vim-cmd hostsvc/maintenance_mode_enter
vim-cmd hostsvc/firmware/restore_config /tmp/configBundle.tgz
The host will reboot with the old configuration applied. You can now exit maintenance mode and use the host.
In this post we covered how to backup and restore the configuration of an ESXi 6.5 host using the ESXi Command line. It’s worth mentioning again that in order to restore a backup the build of the host must match the build contained in the original backup. This means you should take a backup each time you upgrade the host. If you have any questions or comments about this post, you can leave them in the comment section below.