top of page

Backup and Restore ESXi host configuration in PowerCLI

Steps to Backup the ESXi Configuration:


- Login ESXi via PowerCLI

- Run Connect-VIServer -Server 192.168.119.129 and Specify the Credential once pop-up

- Click Yes

- Now you are connected to the ESXi

- To backup the configuration of the ESXi Run Get-VMHostFirmware -vmhost 192.168.119.129 -BackupConfiguration -DestinationPath "C:\Temp\backup ESXi host"

- The backup is created to this path C:\Temp\backup ESXi host

- You can use this as well to get the backup. Run get-vmhost | get-vmhostfirmware -BackupConfiguration -DestinationPath “C:\Temp\backup ESXi host\”

- Backup is completed


Steps to Restore the ESXi Configuration:


Note: Reverting an ESXi host is only valid if the host was updated using one of these methods:


VIB installation or removal

Profile installation or removal

ESXi host update using VMware Update Manager

Updated from an ISO


Note: Rolling back your ESXi version is a permanent operation. it is not possible to roll back to the previous default after initiating the rollback operation.


The scenario here is the ESXi 6.5 upgraded to ESXi 7 and we need to restore back to version 6.5


- Login to ESXi via SSH to get the current version

- Use the following command to Looking at the boot.cfg to see the versions contained for ESXi rollback Run tail -2 /*bootbank/boot.cfg

- As we can see below the altbootbank contains the newer version and bootbank contains the older version

- Below is the ESXi 6.5 version Image

- Login to the ESXi via PowerCLI Run Connect-VIServer -Server 192.168.119.129 and Specify the Credential once pop-up

- Set the ESXi to maintenance mode Run Set-VMHost -VMHost 192.168.119.129 -State Maintenance

- Before restoring the config Use the following command to Looking at the boot.cfg to see the versions contained for ESXi rollback Run tail -2 /*bootbank/boot.cfg

- Below is the ESXi 7 version Image

- To restore the ESXi to 6.5 version Run Set-VMHostFirmware -VMHost 192.168.119.129 -Restore -Force -SourcePath "C:\Temp\backup ESXi host\configBundle-192.168.119.129.tgz"

- Now the ESXi will reboot automatically

- Now the ESXi version is restored


Process to revert to a previous version of ESXi:


- Press the SHIFT+R key sequence when prompted while the ESXi host is booting.

- When you see the Loading VMware Hypervisor message, there is a short delay before the hypervisor image is decompressed. This is the moment to press the SHIFT+R key to recovery mode.

- This launches the VMware Hypervisor Recovery screen. It is a simple display with the current (Default) image listed as well as the alternate ESXi image. As you can see in the following screen, I have the following ESXi versions listed:

- Select Y to roll back

- ESXi will reboot and it will roll back to old verison


- After rolling back, SHIFT+R will show no alternate versions to roll back to. It is not possible to roll back to the previous default after initiating the rollback operation.

The rollback option for ESXi presents a unique troubleshooting or testing tool to go back to a previous version of the ESXi hypervisor.


Comments


bottom of page