Give a deployment a sanctioned way to arm microVM autostart #47
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes#47
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?
A deployment that wants a microVM guest to survive a host reboot has no supported place to say so — the only route today is
lib.mkForce, learned from a check fixture. Give that decision a named option and a documented home, so arming a real machine is an explicit, greppable act rather than a technique copied out of a test.Primary goals:
allod/strategy#20's human-only gate.Current state and specifics
The pull request allod/archetypes#39 assigns
autostart = falsefor every guest its join creates (flake.nix:986onagent/microvm-host-guest-join, inside themicrovm.vms = lib.mapAttrs …block). It is a plain definition rather thanlib.mkDefault, so a deployment's ordinary assignment is a module conflict and onlylib.mkForceoverrides it. That is consistent with this codebase's practice of making an override of a load-bearing value loud rather than silent, and the default itself is correct:allod/strategy#20's agent gates make "enable microvm autostart for a real machine" a human-only act, so the framework declares a guest without arming it.What is missing is the operator-facing half.
checks/microvm-host-join.nixdriveslib.mkForce trueand observes its fixture guest enteringconfig.microvm.autostart, which proves the setting is reachable — it does not make a test technique the deployment policy. Neitherallod/archetypesnorallod/nexusnames a place to put that override, and nothing documents one.Until it exists, a deployment wanting the reboot recovery its libvirt VMs have today (nixpkgs defaults
virtualisation.libvirtd.onBootto"start", which restores guests that were running before shutdown) must either copylib.mkForceout of a check fixture or runsystemctl start microvm@<name>by hand after every host boot.Proposed default
Extend
nexus.microvm.machines.<name>with anautostartoption defaulting tofalse, and have theallod/archetypesjoin read it the way it already readsnexus.microvm.hostPlaintextRoot. That surface exists for exactly this class of value —nix/microvm/host.nix:338describes it as per-machine host runtime data for the microvms declared inmicrovm.vms, every value deployment composition input — andcredentialSourcesis currently its only member. Keying on the machine name also keeps arming per machine rather than fleet-wide.The alternative is an
allod.archetypes.microvm.*knob alongsidevolumeImageRoot, which keeps the change in one repo but puts host runtime policy in the guest-composition namespace. Take it only if the cross-repo read proves awkward.If the option lands in
allod/nexus, this is two pull requests rather than one: the arc's implementation sequence requires each source repo's change to be independently reviewable and revertible.Scope
In: the option declaration, the join reading it, a check proving that a deployment-set value reaches
config.microvm.autostartwhile the default leaves that list empty, and documentation naming where a deployment sets it.Out: changing the default, which stays
false. Out: themicrovm.socketexport raised as a separate follow-up by the same review. Out: whether any real machine is armed, which is a deployment act underallod/strategy#20's agent gates.Trigger: this is wanted before the first real microVM machine is expected to survive an unattended host reboot. Until then a manual start after each host boot is an acceptable cost.
Part of allod/strategy#20.