EsxI Backup Configuration via PowerCLI

EsxI Backup Configuration via PowerCLI The following PowerCLI script will backup the configuration of your ESXi servers: $backpath = “C:\backups\” $eVMHs = Get-View -ViewType HostSystem |?{$_.config.product.ProductLineId -eq “embeddedEsx”} |?{$_.Runtime.ConnectionState -eq “connected”} Foreach ($eVMH in $eVMHs) {Set-VMHostFirmware -VMHost $ -BackupConfiguration -DestinationPath $backpath} To restore the configuration Step#1, put the ESXi host is maintenance mode, this is a requirement: set-VMHost -vmhost MyESXiHost -state Maintenance Step#2, restore the config bundle: Get-VMHost MyESXiHost | Set-VMHostFirmware -Restore -SourcePath C:\Temp\configBundle-MyESXiHost.tgz You can eventually add the -Force if the bundle is mismatched, that is when you restore to a different ESXi build.

Leave a Reply

Your email address will not be published. Required fields are marked *