After a Power Cut, Nodes Must Boot After the Storage They Mount

In progress Kubernetes Linux

When power returns to a homelab or small data centre, every machine boots at once, but they don't all become useful at once. A Kubernetes worker is ready in a minute; a NAS checking its pools may take ten. Pods that mount NFS volumes then start before the exports exist, fail to mount, and sit in ContainerCreating or CrashLoopBackOff. Recovery is fastest when the boot order follows the dependency order, and when every machine actually powers itself back on.

The Dependency Order

  1. Core network: router, switches, DHCP and DNS. Nothing else can find anything without them.
  2. Storage: the NAS or SAN. Check pool health and that exports are served before going on.
  3. Control plane: the API server and etcd.
  4. Workers: the nodes that run the workloads.

Each layer only depends on the ones above it. Starting them out of order isn't fatal (Kubernetes retries mounts and restarts pods), but it turns a five-minute recovery into a long, noisy one, and some apps don't recover cleanly from a failed first start.

Make Machines Come Back on Their Own

Most motherboards stay off after a power cut. In the UEFI/BIOS power settings, Restore on AC Power Loss (the name varies by vendor) has three values:

Setting After power returns
Power Off (often the default) stays off until someone presses the button
Power On boots immediately
Last State returns to whatever state it was in when power was lost

For unattended servers choose Power On (or Last State).

References

Review cards

Flashcard In what order should machines come back after a power cut, and why?

Core network, storage, control plane, workers: each layer depends only on the ones before it. Out of order isn't fatal, but it turns a five-minute recovery into a long, noisy one.

Flashcard Why check stateful apps after storage returns, even when their pods turn green?

Pods that started before the NFS export failed to mount and sat in ContainerCreating or CrashLoopBackOff. The kubelet retries, but an app that started without its data may have created empty files, a fresh database or a broken lock.

Quiz Which Restore on AC Power Loss value leaves a server off after power returns?
  • Power Off
  • Power On
  • Last State

Power Off, often the default, waits for someone to press the button. Unattended servers need Power On (or Last State, which restores whatever state they were in).

Flashcard How can workers be made to start only once storage is ready?

A BIOS power-on delay, a systemd mount dependency that waits for the NFS server (x-systemd.automount or a mount unit with retries), or Wake-on-LAN from the control plane once storage is up.