In some cases we need to reinstall ESXi host. To avoid time consuming setting up servers, we can quickly backup and restore host configuration. To achieve this, there are three possible ways: ESXi command line, vSphere CLI or PowerCLI.
In this article I will show how backup and restore host configuration data using ESXi command line.
1. Backup ESXi host configuration
1. Enable SSH service on the ESXi host.
2. SSH to the ESXi host.
3. Synchronize the configuration changed with persistent storage with a command:
vim-cmd hostsvc/firmware/sync_config
4. Back-up the configuration data for the ESXi host with a command:
vim-cmd hostsvc/firmware/backup_config
5. Copy generated http:// address to the web browser. In place of asterisk ‘*‘ put FQDN or IP of your ESXi host. Download the file.
6. This is a download ESXi data backup file:
2. Restore ESXi host configuration
1. Rename previously downloaded backup file from configBundle-vexpert-nuc.infra.home.tgz to configBundle.tgz
2. Put the host into maintenance mode with this command or from the web client:
vim-cmd hostsvc/maintenance_mode_enter
3. Copy configBundle.tgz to one of the available datastore in the host and reboot ESXi.
4. Than, move your backup file configBundle.tgz to /tmp
5. To restore the ESXi host configuration run this command:
vim-cmd hostsvc/firmware/restore_config 0
6. Exit from maintenance mode with a command:
vim-cmd hostsvc/maintenance_mode_exit