Skip to content

Commit

Permalink
outofband/action_handlers: introduce post install delay for BMC firmware
Browse files Browse the repository at this point in the history
This fixes cases where the BMC is not yet ready to accept commands and
results in failures for the next component firmware install,

"err":"run: while running action to install firmware on component bios: action 'initiatingInstallFirmware' on component 'bios' with status 'failed', returned error: 3 errors occurred:\n\t* provider: gofish: unable to determine device vendor, model attributes: failed to retrieve some items: [{\"link\":\"/redfish/v1/Systems\",\"error\":\"500: \\u003c!DOCTYPE HTML PUBLIC \\\"-//IETF//DTD HTML 2.0//EN\\\"\\u003e\\n\\u003chtml\\u003e\\u003chead\\u003e\\n\\u003ctitle\\u003e500 Unknown Reason\\u003c/title\\u003e\\n\\u003c/head\\u003e\\u003cbody\\u003e\\n\\u003ch1\\u003eUnknown Reason\\u003c/h1\\u003e\\n\\u003cp\\u003eThe server encountered an internal error or\\nmisconfiguration and was unable to complete\\nyour request.\\u003c/p\\u003e\\n\\u003cp\\u003ePlease contact the server administrator at \\n [no address given] to inform them of the time this error occurred,\\n and the actions you performed just before this error.\\u003c/p\\u003e\\n\\u003cp\\u003eMore information about this error may be available\\nin the server error log.\\u003c/p\\u003e\\n\\u003c/body\\u003e\\u003c/html\\u003e\\n\"}]\n\t* unable to determine device vendor, model attributes: failed to retrieve some items: [{\"link\":\"/redfish/v1/Systems\",\"error\":\"500: \\u003c!DOCTYPE HTML PUBLIC \\\"-//IETF//DTD HTML 2.0//EN\\\"\\u003e\\n\\u003chtml\\u003e\\u003chead\\u003e\\n\\u003ctitle\\u003e500 Unknown Reason\\u003c/title\\u003e\\n\\u003c/head\\u003e\\u003cbody\\u003e\\n\\u003ch1\\u003eUnknown Reason\\u003c/h1\\u003e\\n\\u003cp\\u003eThe server encountered an internal error or\\nmisconfiguration and was unable to complete\\nyour request.\\u003c/p\\u003e\\n\\u003cp\\u003ePlease contact the server administrator at \\n [no address given] to inform them of the time this error occurred,\\n and the actions you performed just before this error.\\u003c/p\\u003e\\n\\u003cp\\u003eMore information about this error may be available\\nin the server error log.\\u003c/p\\u003e\\n\\u003c/body\\u003e\\u003c/html\\u003e\\n\"}]\n\t* failure in FirmwareInstall\n\n","file":"worker.go","function":"runTaskStatemachine","level":"warning","line":"451","msg":"task for device failed","time":"2023-07-13T07:41:47Z"
  • Loading branch information
joelrebel committed Jul 14, 2023
1 parent 521bf60 commit 4c1ccf5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/outofband/action_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"
"time"

"github.com/bmc-toolbox/common"
sw "github.com/filanov/stateswitch"
"github.com/hashicorp/go-multierror"
"github.com/metal-toolbox/flasher/internal/metrics"
Expand Down Expand Up @@ -438,6 +439,21 @@ func (h *actionHandler) pollFirmwareInstallStatus(a sw.StateSwitch, c sw.Transit

// return nil when install is complete
case model.StatusInstallComplete:
if strings.EqualFold(action.Firmware.Component, common.SlugBMC) {
tctx.Logger.WithFields(
logrus.Fields{
"bmc": tctx.Asset.BmcAddress,
"delay": delayBMCReset.String(),
}).Debug("BMC firmware install completed, added delay to allow the BMC to complete its update process..")

if err := sleepWithContext(tctx.Ctx, delayBMCReset); err != nil {
return errors.Wrap(
ErrFirmwareInstallFailed,
err.Error(),
)
}
}

return nil

default:
Expand Down

0 comments on commit 4c1ccf5

Please sign in to comment.