lab: restart-policy no, sane healthcheck retries, launcher recovery hint #36
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/machine-configs!36
Loading…
Reference in a new issue
No description provided.
Delete branch "lab-restart-resilience"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A host reboot turns the lab into a silent zombie: this morning the
workstation booted from a clean power-off and docker's restart policy
respawned clab-lab-test-01/02/03, each crash-looping 194 times at ~64 s
intervals while the CHR nodes stayed down.
Mechanism (verified this morning)
veths into the container's netns at deploy time. A docker-level restart
builds a fresh netns and nothing re-plugs them; on the host, the labsw
bridge itself is gone after boot.
"only 0 of 1 data NICs appeared" (correct), and the
alwayspolicyrespawns it forever. linux-kind nodes got restart=always, mikrotik_chr
nodes policy=no, so a reboot leaves the lab half up.
test -e /run/vm-node/ready, Interval 2 s,Retries 300) needs 10 min of consecutive failures to go unhealthy, longer
than the 64 s respawn cycle, so docker reported
healthyfor 8 hours.VM disks were untouched (the loop dies before qemu starts). All three state
files said
stopped; recovery istask lab:up && task lab:boot.Changes
lab/lab.clab.yml:defaults: restart-policy: "no". Auto-restart cannever help a node whose links containerlab will not re-plug; a reboot now
leaves the lab uniformly down and
task lab:up(alreadydeploy --reconfigure+ switch ports + wait-healthy + cert push) is thesingle recovery path.
modules/flake-parts/lab-node-image.nix: healthcheckRetries300 -> 5,so
healthymeans something again.lab/vm-node-launcher.sh: the NIC-timeout exit now names the recovery:"links are not re-plugged after a container restart - run task lab:up".
Testing
Reproduction observed live (RestartCount 194, log line every ~64 s).
Recovery + verification with this branch checked out:
task lab:image,task lab:up,task lab:boot,task lab:cluster-check, then theresilience test:
docker restart clab-lab-test-01must leave it stoppedwith no respawn, and
task lab:upmust bring it back. Results posted as acomment.
containerlab does not re-plug data links when docker restarts a container, so restart=always on the linux-kind nodes turned every host reboot into a silent 194-restart loop ("only 0 of 1 data NICs appeared" every ~64s) while the CHR nodes stayed down. restart-policy: no everywhere makes a reboot leave the lab uniformly down and task lab:up the only recovery path; healthcheck Retries 300 -> 5 so a dead launcher cannot report healthy (300 x 2s outlives nothing); the launcher now names the fix in its own exit line.Verification (2026-11-16, from this branch)
Reproduction, pre-fix. Live this morning: test-01/02/03 at
restarts=194each,only 0 of 1 data NICs appearedevery ~64 s, dockerhealthythroughout, r1/r2/isp down,labswbridge absent, test-01 netnsheld only
lo+eth0.Deploy with the fix.
task lab:image,task lab:up: containerlabaccepts
defaults.restart-policy, every node came uppolicy=no restarts=0, test-01 haseth1again,labswrecreated, 7/7 healthy,router certs re-issued and pushed ("REST over HTTPS verifies against the lab
root").
task lab:boot: 3 Raft voters unsealed, contract applied, hostsenrolled.
task lab:cluster-check: passed.Resilience test.
docker restart clab-lab-test-01against the healthylab: one run, clean VM stop (qemu signal 15), launcher logged
then
status=exited exit=1 restarts=0and stayed there. No respawn, othernodes untouched. Pre-fix this was the infinite loop.
Recovery test.
task lab:up(7/7 healthy) ->task lab:boot(enrolled,k3s restarts) ->
lab:cluster-checkpassed; VIP failover re-elected totest-02 along the way.