Snapshot 'pristine' at mint, before the rig bootstrap hook #104
Labels
No labels
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-triage
ready
release
scope:cli
scope:drill
scope:host
scope:installer
scope:templates
scope:tiers
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/box#104
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Snapshot
pristineat mint, before the rig bootstrap hookChild of heavy-duty/rig#62. This is the one that actually delivers "back to
pristine Debian".
The gap
cmd_new's fresh-mint branch runs launch →wait_agent→cloud-init status --wait→ the rig hook atbin/box:1121. At the moment cloud-initfinishes and before rig converges anything, the guest is pristine Debian
plus box's seed. That is the exact state heavy-duty/rig#62 wants back, it
exists for a few seconds on every mint, and nothing captures it.
Capturing it is close to free.
cmd_snapshot(bin/box:1295-1299) is threelines, takes no lock and does not stop the instance, and the storage backend
is btrfs by deliberate design (
host/setup-host.sh:261-298) — CoW, so thesnapshot costs kilobytes until the guest diverges.
Proposal
Take a snapshot named
pristineimmediately before the[ -n "$T_BOOTSTRAP_ROLE" ]block atbin/box:1119. Then:is a complete answer for every tenant role, because everything
bootstrap-tenant.shdoes — docker, node, the agent CLI, the context file,the role marker — is box-local and file-shaped.
Worth considering alongside: a second
bootstrappedsnapshot after asuccessful hook, so an operator can get back to a converged-but-untouched
box without paying a re-mint. Cheap on CoW, and it is the state people
actually want more often than truly-pristine.
Decisions to make
--snapshot-pristine? Default on, I think — the costis near-zero on btrfs and the value only exists if it is already there
when you need it. But on a
dir-backend host (the documented fallback athost/setup-host.sh:294) it is a full multi-GB copy, so the mint shouldprobably detect the driver and skip with a warning rather than silently
double every mint's disk cost.
pristineis what heavy-duty/rig#56 called it and it ishonest — the guest at that point has had cloud-init but not rig.
--from. The clone branch (bin/box:977-990) skipscloud-init and rig entirely, so there is no pristine moment to capture.
A clone should inherit the source's snapshots or take none; it must not
mint a misleading
pristinethat is really "whatever the source was".Note on durability
Snapshots cannot outlive their instance —
box rmtakes every snapshot withit (
bin/box:73, anddocs/plans/2026-07-18-box-export.md:12-13). So thisis an undo, not a backup, and the docs should not let anyone confuse the
two.
box exportremains the durable path.