Backing up ESXi host configuration data
- To synchronize the configuration changed with persistent storage, run this command:# vim-cmd hostsvc/firmware/sync_config
- To back-up the configuration data for the ESXi host, run this command:# vim-cmd hostsvc/firmware/backup_config
Note: The command will output a URL (http://<host_fqdn_orIP>/downloads/123456/configBundle-xx.xx.xx.xx.tgz) from where you can download the backup file, either by opening it in a web brower or using other means like wget.
3. download file
Restoring ESXi host configuration data
- Rename configBundle-HostFQDN.tgz to configBundle.tgz before initiating the restore command.
- Put the host into maintenance mode by running the below command:
# vim-cmd hostsvc/maintenance_mode_enter
- Copy the backup configuration file to the ESXi host or an available datastore.
- Reboot the host. This step is required, otherwise the restore workflow might not finish completely
- Once ESXi has rebooted, move the config bundle file to /tmp/configBundle.tgz.
Then run this command to restore the ESXi host configuration:
# vim-cmd hostsvc/firmware/restore_config 0
Note: Add a 1 to force an override of the UUID mismatch.
For example: # vim-cmd hostsvc/firmware/restore_config 1
- Executing this command will initiate an automatic reboot of the host after command completion.
- However, starting from vSphere 7.0 U2, the configuration could be encrypted using TPMs and in which case, the -force option will not work if the host got changed. We need the same TPM that was used on the host during backup, to restore. In other words,
from vSphere 7.0U2, the override will not work if the host has TPM enabled.