How to Backup ESXi Configuration with PowerCLI

I have 2 ESXi Hosts without vCenter. For backup the ESXi configuration I used a PowerCLI script:

Connect-VIServer [2001:DB8::10]
Connect-VIServer [2001:DB8::11]
$esxhost = Get-VMHost
Get-VMHostFirmware -VMHost $esxhost -BackupConfiguration -DestinationPath C:\Backup

Change the IP Address with the address of yours ESXi hosts and set the DestinationPath according to your environment.

For restore the configuration use these commands:

Connect-VIServer [2001:DB8::10]
$esxhost = Get-VMHost
Set-VMHostFirmware -VMHost $esxhost -Restore -SourcePath C:\Backup\configBundle-[2001:DB8::10].tgz

Remember to put ESXi host in “Maintenance Mode” before restore the conf.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s