Backup and Restore VM Host
- To back up ESXi configuration:
- Run the following command to sync the configuration:
vim-cmd hostsvc/firmware/sync_config - Run the following command to generate a backup file:
vim-cmd hostsvc/firmware/backup_config - Download the configuration file by going to the URL in the output. (Replace * in the URL with the IP address.)

- If unable to download the config file through the browser, it can be found in
/scratch/downloads/<<GUID from output in step b>>/configBundle-hostname.local.tgz. Use WinSCP to transfer the file from ESXi to the local machine or copy it to a datastore
- Run the following command to sync the configuration:
- Restore configuration back to ESXi host:
- Make sure the same ESXi build from which the backup was taken is installed back onto the host.
- Copy the backup file back to the ESXi host. Use WinSCP to copy the config file back to the host
/tmpdirectory. - Rename the file from
configBundle-<host name>.tgztoconfigBundle.tgz.
Example:cp configBundle-esxi7001.vmlab.local.tgz configBundle.tgz - Run this command to put the host into maintenance mode:
esxicli system maintenanceMode set --enable yes - Restore backup. Run command: Recommand modifying the UUID on the backup set before restore. Please skip to step g.
vim-cmd hostsvc/firmware/restore_config /backup_location/configBundle.tgz - If there is an error stating UUID mismatch, then add a 1 to force the override of the Universal Unique Identifier (UUID).
vim-cmd hostsvc/firmware/restore_config 1 /tmp/configBundle.tgz - You can find the UUID by running the command and copying the ID for the next step
vsxcfg-info -u - Unpack the backup ser set, go to the tmp directory, and run the command:
vtar zxvf configBudle.tgz - Modify the UUID in the Manifest.txt, run the vi command:
vi Manifest.txt - Save the Manifest.txt file, run the vi command:
:WQ - After saving the change, run the command:
tar zcvf configBudle.tgz - Restore the config file by running this command, and the host will reboot you can access the host with the original IP.
vim-cmd hostsvc/firmware/restore_config /backup_location/configBundle.tgz
Comments
Post a Comment