Backup and restore ESXi host configuration

When you end up reinstalling the ESXi on a host system, you may need to reconfigure the host system. This involves setting up networks, storage and also the host profile. But with the ESXi host configuration backup/restore mechanism we can easily bring the host system back to the prodcution. 

Before starting the process, there are few prerequisites

  • Source and destination build numbers should be matched (similar builds are also supported | but not Major builds)
  • Host UUID must be the same.
  • Hosts must be in Maintenance mode during the backup restore operation

So, let’s see how it works. We are going to use the ESXi command line method

Backup the host configuration

First of all, we need to synchronize the configuration with the below command

vim-cmd hostsvc/firmware/sync_config

To backup the configuration, run the command vim-cmd hostsvc/firmware/backup_config

The output will look like below (* denotes the IP/FQDN of the ESXi host) | the downlodable URL is generated 

http://*/downloads/123456/configBundle-xx.xx.xx.xx.tgz

Then the backup file can be downloaded. Then will look at the restoration process.

Restore the host configuration

First of all, you need to rename the downloaded tgz file to configBundle.tgz

Then copy the downloaded file to the host (it can be a datastore or host local file system) – in this example, I have used tmp directory

Issue the command vim-cmd hostsvc/firmware/restore_config /tmp/configBundle.tgz to restore the config. backup

Add 1 before the backup file location in order to override the UUID mismatch

vim-cmd hostsvc/firmware/restore_config 1 /tmp/configBundle.tgz

Upon the command execution, you will notice that the host system is rebooting. After the reboot you will see all the previous configurations on newly installed Operating System. 

[source: vmware.com]

Please follow and like us:

Author: Chathura Ariyadasa

♚Father ♚Innovative Technical Architect ♚ Cyber Security Strategist ♞ vCISO | vCIO ♞ Blogger & an Adrenaline junkie...