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>
  • Loading branch information
smira committed Dec 2, 2021
1 parent d0df929 commit 274ae33
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 @@ -217,7 +217,8 @@ func (r *ServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
}
}

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

Expand Down

0 comments on commit 274ae33

Please sign in to comment.