HewlettPackard / POSH-HPEOneView

PowerShell language bindings library for HPE OneView.
http://hewlettpackard.github.io/POSH-HPEOneView/
125 stars 52 forks source link

unable to Update-OVServerFirmware if no server-profile is attached to server-hardware #631

Closed renekessel closed 1 year ago

renekessel commented 1 year ago

I want to try to update server firmware via OneView without a server-profile.

Install Firmware Updates

$baseline = (Get-OVBaseline | Where-Object {$_.ISOFileName -match "Gen10"} | Sort-Object $_.ReleaseDate -Descending | select -first 1).Uri.OriginalString
Update-OVServerFirmware -InputObject $srvobject -Baseline $baseline -FirmwareInstallationPolicy LowerThanBaseline | Wait-OVTaskComplete

Error message: Update-OVServerFirmware : The requested resource '/rest/server-hardware/firmware-compliance' could not be found. Confirm resource ID/URI and try the call again.

[Version]$ModuleVersion = '7.20.3325.2416'

ChrisLynchHPE commented 1 year ago

I'm not able to reproduce this reported condition. Can you please provide the generated log file with the following:

$baseline = (Get-OVBaseline | Where-Object {$_.ISOFileName -match "Gen10"} | Sort-Object $_.ReleaseDate -Descending | select -first 1).Uri.OriginalString
Get-OVCommandTrace -ScriptBlock { Update-OVServerFirmware -InputObject $srvobject -Baseline $baseline -FirmwareInstallationPolicy LowerThanBaseline | Wait-OVTaskComplete }
renekessel commented 1 year ago

Hello Chris,

thanks for your response. We have seen that we have done a mistakes themself and removed the option (...).Uri.OriginalString in first line to select the baseline for update. Now we get the following output from your command.

2301120912_HPEOV_transcript.log

No task to update the server firmware will be running for the selected server.

Additional we have found another error that the BIOS version is not in right semantic version format and will not updated.

firmwarupdate_BIOS_error.log

Best regards

René

ChrisLynchHPE commented 1 year ago

We have seen that we have done a mistakes themself and removed the option (...).Uri.OriginalString in first line to select the baseline for update. Now we get the following output from your command.

Yes, I was going to point that out you just provide the object to the parameter. And you were instead using the string URI of the baseline, which wouldn't work.

Additional we have found another error that the BIOS version is not in right semantic version format and will not updated.

Yes, that I was able to reproduce and have a workaround I'm going to release. That behavior has been present since HPE OneView 1.0 for some unknown reason and we are going to change that in the core product. I'm going to re-open this issue for the System ROM version reporting issue, which will be fixed.

renekessel commented 1 year ago

Hi Chris,

but we have the problem that no task will be started to update firmware. Can you tell me why. We see that updates are available on host, but no task will be created and running.

Best regards

René

ChrisLynchHPE commented 1 year ago

I'm not sure. In looking at the captured verbose output I don't see the PTCH API call to initiate a firmware update. I need to look into this further.

renekessel commented 1 year ago

Hello Chris,

I have collect new logs from a new attempt to update a server. The first attempt was with option wait-ovtaskcomplete.

$baseline = Get-OVBaseline | Where-Object {$_.ISOFileName -match "Gen10"} | Sort-Object $_.ReleaseDate -Descending | select -first 1 Get-OVCommandTrace -ScriptBlock { Update-OVServerFirmware -InputObject $srvobject -Baseline $baseline -FirmwareInstallationPolicy LowerThanBaseline | Wait-OVTaskComplete }

Why it doesn't work with that option?

2301161424_HPEOV_transcript_with_wait-ovtaskcomplete.log

The second time it was without the option wait-ovtaskcomplete. A task for the update was currently started and it seems to be working, but why doesn't the option work here?

$baseline = Get-OVBaseline | Where-Object {$_.ISOFileName -match "Gen10"} | Sort-Object $_.ReleaseDate -Descending | select -first 1 Get-OVCommandTrace -ScriptBlock { Update-OVServerFirmware -InputObject $srvobject -Baseline $baseline -FirmwareInstallationPolicy LowerThanBaseline }

2301161429_HPEOV_transcript_without_wait-ovtaskcomplete.log

Best Regards René

ChrisLynchHPE commented 1 year ago

Why it doesn't work with that option?

It's because the Cmdlet puts another object on the pipeline it should not have been doing. That object is not a task resource, which causes Wait-OVTaskComplete to generate a terminating error. This terminates the pipeline by default and thus the task is never created from the appliance due to the Cmdlet workflow. This is what I will have fixed in an update I'm publishing soon for both 7.20 and 8.00 libraries.

ChrisLynchHPE commented 1 year ago

I just release 7.20.3391.2120, which is published to the PowerShell Gallery.

I will be releasing an updated 8.0 library later this week.

renekessel commented 1 year ago

Hi Chris,

that sounds good and thanks for your support.

Best regards

René

ChrisLynchHPE commented 1 year ago

I just released 8.00.3396.2206, which is publised to the PowerShell Gallery. Please update to the appropriate release here and that will solve both issues.

Please confirm prior to closing this issue.

renekessel commented 1 year ago

Hello Chris,

the new release works and we can close this issue.

Thanks and best regards

René