Here is an article on how to restore ESXi configuration using VMware PowerCLI. Sometimes we need to restore the ESXi configuration. It might be that your ESXi server fails to boot after some maintenance because your boot media is defective. Replace the media, install a new VMware ESXi, configure Configure ESXi host, and then restore the configuration data.
Restoring the ESXi backup configuration data from the backup file requires one extra step. The ESXi server must first be put in maintenance mode via the Set-VMHost command.
When restoring the configuration file, the build version of the host should match the build version of the host that created the backup file. But you can use the -Force choice to override this requirement.
Table of Contents
Restore ESXi Configuration VMware PowerCLI
Cmdlets are used for backup and restore.
Get-VMHostFirmware Set-VMHostFirmware
Now, if you need to restore an ESXi host’s configuration data, you need to put the ESXi into maintenance mode first.
Connect to the host or vCenter Server with the PowerCLI command and enter your credentials.
Connect-VIServer -Server (FQDM or IP Address)
Type credentials, and then click OK.
The ESXi server successfully connected.
I have the ESXi host configuration file in the download folder on the C drive.
Put Host into Maintenance Mode
Enter the following command to put the host in maintenance mode:.
Set-VMHost -VMHost [FQDN or IP] -State ‘Maintenance’
Verify that the host is in maintenance mode.
Restore the host configuration data from the backup directory by running the PowerCLI command.
Set-VMHostFirmware -VMHost [FQDN or IP] -Restore -Force -SourcePath [Path]
The ESXi server will reboot immediately once you hit the enter key.
Type host credentials and then hit OK.
Restarting host.
Now you can verify your host configuration.
As you can see, it’s a simple way to restore the configuration data of your ESXi hosts.
Related: How to Backup VMware ESXi Host Configuration File With Putty
Conclusion
With the above article and information, you will be able to restore the configuration data in a disaster recovery event or configuration error. Follow my article on how to take backup ESXi configuration data. Always ensure to check and verify the created backups.