Skip to content

Commit

Permalink
outofband/poll: require multiple inventory attempts
Browse files Browse the repository at this point in the history
Since some BMCs take a while to have the install firmware version
information to be updated after the update completes successfully.
  • Loading branch information
joelrebel committed Apr 22, 2024
1 parent 89d3430 commit 3b4c71c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/outofband/action_handlers.go
Original file line number Diff line number Diff line change
@@ -518,6 +518,15 @@ func (h *actionHandler) pollFirmwareTaskStatus(a sw.StateSwitch, c sw.Transition
// a new collection should be attempted.
var inventory bool

// verifyAttempts is the number of times this poller will spend
// attempting to verify the installed firmware equals the expected.
//
// Multiple attempts to verify is required to allow the BMC time to have its information updated,
// the Supermicro BMCs on X12SPO-NTFs, complete the update process, but take
// a while to update the installed firmware information returned over redfish.
var verifyAttempts int
var maxVerifyAttempts = 15

// helper func
componentIsBMC := func(c string) bool {
return strings.EqualFold(strings.ToUpper(c), common.SlugBMC)
@@ -558,6 +567,8 @@ func (h *actionHandler) pollFirmwareTaskStatus(a sw.StateSwitch, c sw.Transition

// TODO: break into its own method
if inventory {
verifyAttempts++

err := h.installedEqualsExpected(
tctx,
action.Firmware.Component,
@@ -579,7 +590,7 @@ func (h *actionHandler) pollFirmwareTaskStatus(a sw.StateSwitch, c sw.Transition
case ErrInstalledFirmwareNotEqual:
// if the BMC came online and is still running the previous version
// the install failed
if componentIsBMC(action.Firmware.Component) {
if componentIsBMC(action.Firmware.Component) && verifyAttempts >= maxVerifyAttempts {
errInstall := errors.New("BMC failed to install expected firmware")
return errInstall
}

0 comments on commit 3b4c71c

Please sign in to comment.