Last updated on Tuesday 16th of November 2021 08:30:50 PM
©ESXi configuration backup with ©XSIBackup-Free edition
Use ©XSIBackup-Free to backup your ©ESXi host configuration, learn how to restore configuration backupsDownload latest edition of ©XSIBackup-Free here
Let's pose it clear. The ©ESXi host configuration is nothing but the /etc directory. The previous phrase should be all any experienced sysadmin needs to know to deal with the matter. Nonetheless, we are going to offer you some more clues and tools so that you can create and restore ©ESXi configuration backups.
Knowing the above anybody would think: "hey, I just have to create a tarball of the /etc dir and keep it somewhere out of the host itself". Right!, the only question that would still remain is: "could there be some process that keeps some of the files in the /etc dir open that prevents a simple /etc dir backup from working?".
To answer the above conundrum, or to just fly over it, the ©ESXi command line provides some tools to take care of that, so that you can make sure the backup you make contains everything you need to restore your ©ESXi host config to some other host. Of course, you should always restore to the same build the backup came from. restoring to a different version/ build could lead to some inconsistency that you would need to resolve on your own and that is not among the subjects we will cover in this post.
The command below will generate a file with a .tgz extension in the /scratch/downloads dir, it is nothing but a tarball with a slighly different format than usual .tar.gz files.
ESXi01 # vim-cmd hostsvc/firmware/backup_config
Bundle can be downloaded at : http://*/downloads/52bf9a47-0371-1661-0471-c245de883414/configBundle-esxi1.clm95.33hops.com.tgz
Of course, if you perform your backups manually, you should make sure that you get the .tgz file you just created out of the host, otherwise, in case of failure you could loose your configuration backups along with the host itself. You can easily do so by using the HTTP download link you are given.
Restore the configuration manuallyShould your host fail, you could easily recover your configuration by extracting the /etc directory contained in the .tgz tarball and overwritting the one in some ©ESXi fresh install. You can check that procedure in this VMWare post: https://kb.vmware.com/s/article/2043048
There is also another very straight procedure that you can follow to restore some ESXi configuration. It consists in putting the ©ESXi host in maintenance mode, to prevent any of the files that we want to overwrite to be open by some host process and then using the restore_config command.
vim-cmd hostsvc/firmware/restore_config /tmp/configBundle.tgz
Needless to say that the above described method backs up your host configuration, but not the VMs in the host. In case you restore some configuration in an empty host, you will have registered VMs which are pointing to non existent files.
Automate your host config backup along with your VMs backup©XSIBackup provides an easy way to backup your host's configuration along with your Virtual Machines every time you run a VM backup cycle. It is as easy as appending the --config-backup argument to any backup job. By doing so, the .TGZ file will be generated and placed in the cfgbak directory of any ©XSIBackup repository.
./xsibackup --backup "VMs(VM1,VM2,VM3)" /vmfs/volumes/backup/MY_XSI_REPO --config-backup
This feature is available in all editions of the ©XSIBackup software including the Free version.