Set-VMHostFirmware issues

Alex
Alex used Ask the Experts™
on
Guys,

Trying to restore the configuration of a host getting this error.....

PS H:\> Set-VMHostFirmware -Restore -SourcePath C:\temp\backup\configBundle-Computername.tgz -force
Set-VMHostFirmware : 04/09/2018 10:56:35      Set-VMHostFirmware            Response status code does not indicate success: 401 (Unauthorized).      
At line:1 char:1
+ Set-VMHostFirmware -Restore -SourcePath C:\temp\backup\configBundle-U ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-VMHostFirmware], ViError
    + FullyQualifiedErrorId : Client20_SystemManagementServiceImpl_UploadHostFirmware_UploadFailed,VMware.VimAutomation.ViCore.Cmdle
   ts.Commands.Host.SetVMHostFirmware
 
I've also changed the host name of the new box I'm restoring too, also, when I try the restore..... Wait, If i have a different Root password on the new host than that which is on the source host. Would that cause my restore to fail? Because when I restore it looks like it'll be successful and then goes wrong.

Thanks

Alex

P.S We taking bets if Mr Hancock comes? :-)  He's always on the ball :D
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AlexSenior Infrastructure Analyst

Author

Commented:
Oh I have dropped it into maintenance mode as well
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Are you using the command...

Set-VMHostFirmware -VMHost 10.0.0.1 -Restore -SourcePath c:\bundleToRestore.tgz -HostUser root -HostPassword exampleRootPassword

Open in new window


You need to use the current password for the host you are accessing....,....

Have you tried using  vSphere CLI ?
AlexSenior Infrastructure Analyst

Author

Commented:
I'm doing it in power CLi, is that different? I got it from VMware's website and just ran the code to install the CMDLets

I'm doing everything but the username and password, I'll try that now,
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Yes, many ways to backup and restore...

PowerCLI is one method...

vSphere CLI is another...

https://kb.vmware.com/s/article/2042141

There is also a GUI by Slymsoft, which will backup automatically, but you will need to restore manually.

http://slymsoft.com/esxi-conf-backup/
AlexSenior Infrastructure Analyst

Author

Commented:
OK so I'm doing that code now and I get

Set-VMHostFirmware : 04/09/2018 11:30:31      Set-VMHostFirmware            A general system error occurred: Internal error      
At line:1 char:1
+ Set-VMHostFirmware -VMHost 10.0.0.1 -Restore -SourcePath C:\temp\bac ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-VMHostFirmware], SystemError
    + FullyQualifiedErrorId : Client20_SystemManagementServiceImpl_RestoreVmHostFirmware_ViError,VMware.VimAutomation.ViCore.Cmdlets
   .Commands.Host.SetVMHostFirmware
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
what version of PowerCLI is this, and what host version/build are you using ?
AlexSenior Infrastructure Analyst

Author

Commented:
VMware.Vim                      6.7.0.9288211
VMware.VimAutomation.Cis.Core   10.1.0.8377811
VMware.VimAutomation.Common     10.1.0.8342134
VMware.VimAutomation.Core       10.1.0.8344055
VMware.VimAutomation.Sdk        10.1.0.8342078

And it's on VMware-ESXi-6.5.0-5310538-HPE-650.10.1.0.47-Jul2017
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
I've seen this issue before, it could be to do with either Power CLI version mismatch between Host version and PowerCLI, or Scratch location which is often a problem with HPE versions.

the scratch location is used, to receive the config, before writing to the destination.

it may be worth checking scratch locations, do you know how to do this ?
AlexSenior Infrastructure Analyst

Author

Commented:
Iv'e checked the scratch location and there is a downloads folder for creating the backup, but I don't know if I need another folder for restoring.
AlexSenior Infrastructure Analyst

Author

Commented:
OK so

PS C:\WINDOWS\system32> Set-VMHostFirmware -VMHost 10.1.9.27 -Restore -Force -SourcePath C:\temp\Backup\configBundle-UKTVMWL04P.tgz -HostUser Root -HostPassword "Password"
Set-VMHostFirmware : 04/09/2018 13:24:20        Set-VMHostFirmware              Response status code does not indicate success: 401 (Unauthorized).
At line:1 char:1
+ Set-VMHostFirmware -VMHost 10.1.9.27 -Restore -Force -SourcePath C:\t ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-VMHostFirmware], ViError
    + FullyQualifiedErrorId : Client20_SystemManagementServiceImpl_UploadHostFirmware_UploadFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.SetVMHostFirmware
AlexSenior Infrastructure Analyst

Author

Commented:
I'm restoring this onto new metal as well, I can't see why this won't work.... So I've taken a config from one host in an HA cluster and i'm trying to restore it to a test server. If that's relevant.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Try vSphere CLI, this is a common issue with Power CLI, if vSphere CLI commands also fail, there is a host config issue.

Same models of hardware and ESXi version ?
AlexSenior Infrastructure Analyst

Author

Commented:
Andrew, I don't suppose you've written a guide for this have you?
VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017
Commented:
It's very easy...

Download and install vSphere CLI

https://code.vmware.com/tool/vsphere-cli/6.5

and then execute

vicfg-cfgbackup
AlexSenior Infrastructure Analyst

Author

Commented:
Thank you as always Andrew, consistently a pleasure learning from you :D
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
No problems, glad to be of assistance. Have a good day.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial