After a Power Cut, Nodes Must Boot After the Storage They Mount
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
- Core network: router, switches, DHCP and DNS. Nothing else can find anything without them.
- Storage: the NAS or SAN. Check pool health and that exports are served before going on.
- Control plane: the API server and etcd.
- 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
- Kubernetes MOC - hub for Kubernetes notes.
- Kubernetes Storage Failures Usually Start on the Host or the NAS - what fails when a node mounts NFS.
- ext4 Remounts Root Read-Only When It Cannot Trust the Disk, and the kubelet Falls with It - the other way a power cut hurts a node.
- systemd documentation: systemd.mount - mount units and
x-systemd.automount.
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.