Home VMware Using PowerCLI to Backup and Restore ESXi Host Configuration

Using PowerCLI to Backup and Restore ESXi Host Configuration

by admin

As an alternative to vicfg-cfgbackup.pl as a way to backup and restore ESXi host configuration you may want to consider PowerCLI.

As a quick review, vicfg-cfgbackup is a script that allows you to backup and restore your host configuration. To use it you will need to install vCLI (on windows or linux) or you can use the vMA Appliance.

The basic syntax is as follows:

You can use vicfg-cfgbackup.pl –server server_name -f -l backup_file_name to create a configuration backup, whilst vicfg-cfgbackup.pl –server server_name -r can be used to restore.

Anyway, back to PowerCLI. Using the Get-VMHostFirmware CMDlet we can also backup and restore our configuration.

To create a backup:
Get-VMHostFirmware -VMHost $host -BackupConfiguration -DestinationPath C:\HostBackups

And to restore a configuration:
Set-VMHostFirmware -VMHost $Host -Restore -SourcePath c:\Hostbackups\backupfile.tgz -HostUser user -HostPassword password
You can read more about it here

One thing to look out for, like when using vicfg-cfgbackup.pl, is that if you are restoring the configuration to different hardware you will need to use the -force parameter.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More