Skip to content

Commit

Permalink
fix: check for server power state when in use
Browse files Browse the repository at this point in the history
Sometimes if power off event is followed by server allocation
immediately, IPMI might "lie" about power status of the server.

Server is being powered off, while it reports power on status.

In this case Sidero might fail to power on an allocated Server.

Workaround that by checking for power state in this state.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
(cherry picked from commit 274ae33)
  • Loading branch information
smira authored and andrewrynhard committed Dec 3, 2021
1 parent b5e71c6 commit 4a87926
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ func (r *ServerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
}
}

return f(true, ctrl.Result{})
// keep checking power state from time to time, as sometimes IPMI lies about the power state
return f(true, ctrl.Result{RequeueAfter: constants.PowerCheckPeriod})
case !s.Status.InUse && !s.Status.IsClean:
// when server is set to PXE boot to be wiped, ConditionPowerCycle is set to mark server
// as power cycled to avoid duplicate reboot attempts from subsequent Reconciles
Expand Down
1 change: 1 addition & 0 deletions app/sidero-controller-manager/pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
InitrdAsset = "initramfs.xz"

DefaultRequeueAfter = time.Second * 20
PowerCheckPeriod = 5 * time.Minute

DefaultServerRebootTimeout = time.Minute * 20
)

0 comments on commit 4a87926

Please sign in to comment.