VMware Cloud Community
DZ1
Hot Shot
Hot Shot

Using Set-VMhostfirmware or some other cmdlet for a restore

I have a STIG that I am working on, and I want to be able to take the configuration of one ESXi host, and transfer that to a completely different host.  I've used Get-VMhostfirmware to backup and then Set-VMhostfirmware to restore the config on the same host, so I thought that maybe I could force the config onto a completely different host.  I tried to disconnect a host, and then add it with its IP address only, then using Get-VMhostfirmware to back it up, and then disconnecting it, and then adding the new host with the the static IP address of the host that I just took the backup of and restoring it that way, but it does not work. 

The only solution that I can think of is using host profiles, but I'm wondering is there another cmdlet that I could use, or is there some trick that I could use with Get/Set-VMhostfirmware that would allow me to push the config of one host onto a completely different host?

0 Kudos
4 Replies
LucD
Leadership
Leadership

If I understand you correctly, you did a Set-VMHostFirmware with the Restore switch to a an ESXi B with the firmware backup you took from ESXi A ?

Was the ESXi B host in maintenance mode when you did the restore ?

Did you get any error messages during that restore ?

Any errors during the boot of ESXi B ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
DZ1
Hot Shot
Hot Shot

Yes, and why didn't I just use A and B as examples?  I could have saved so much typing...lol.  Host A was 192.168.1.1 let's say, because I wanted the names to match.  I ran the Get-VMhostfirmware with the correct parameters and then disconnected the host. I then changed Host B to 192.168.1.1 and added it to vCenter, I ran the command and received the error below. Both were in maintenance mode

From what I read, the cmdlet wasn't designed to be used this way...oh, and sorry, I left out vital information.  The hardware is different, one host is a BL460c Gen 8, and the other is a BL460c G6.  I'm doing this on purpose of course, because I want to see if it will work, I also plan on trying it with the same hardware, but I'm curious about the limitations. 

PS C:\Users>  Get-VMHost '192.168.1.1' | Set-VMHostFirmware -Restore -SourcePath c:\ESXibackups -Force

Set-VMHostFirmware : 7/9/2013 1:47:16 PM    Set-VMHostFirmware        A general system error occurred: Internal error   

At line:1 char:30

+  Get-VMHost '192.168.1.1' | Set-VMHostFirmware -Restore -SourcePath c:\ESXiback ...

+                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Set-VMHostFirmware], SystemError

    + FullyQualifiedErrorId : Client20_SystemManagementServiceImpl_RestoreVmHostFirmware_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.SetVM

   HostFirmware

0 Kudos
LucD
Leadership
Leadership

I was expecting a MismatchedBundle fault.

The Set-VMHostFirmware -Restore cmdlet uses under the covers the RestoreFormwareConfiguration method.

And the MismatchedBundle fault makes it very clear why your action won't work, mismatched UUID.

Now you could consider zapping the UUIDs in the bundle, but that would be a hell of  a lot of work since the bundle layout is not specified publicly afaik.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
DZ1
Hot Shot
Hot Shot

Just to be sure I'm going to try again, I'm also going to try the exact same hardware, just to see. 

0 Kudos