Declare the persistent volumes a selected microvm archetype requires #25
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#25
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?
Give a dev microVM the persistent disks it needs to be usable, so selecting the microvm runtime produces a machine that keeps its home directory and its Nix state across a restart instead of failing to evaluate.
Primary goals:
/nix/var/nix, declared in one place in the builders rather than restated per machine.runtime-module-selectioncurrently supplies its own/nix/var/nixvolume so the microvm branch can be forced at all; real declarations make that redundant and it must not be left shadowing them.Current state and specifics
allod/archetypesselects the guest module from the inventoryruntimefact as of allod/archetypes#23, but declares no volumes. ComposingmicrovmGuestwithout a/nix/var/nixentry fails on allod/vmmodules/microvm-store.nix:121-127:/nix/var/nix must have a declared persistent microvm.volumes entry. So the runtime is selectable and no machine can use it — the fail-closed state that PR chose deliberately, and the gap this issue closes.Placement has exactly one home.
allod/nexusdocs/microvm-host.md:81-88records why: a volume image "has no source/destination split the way a credential does: its host path can only live in the guest's ownmicrovm.volumes[].image, because that is the string QEMU renders into-drive file=and the same field the launcher preflights." The host-side placement option that once existed was removed in nexus commit16bd9c7.nexus.microvmnow exposes onlyhostPlaintextRootand per-machinecredentialSources(nix/microvm/host.nix:315-353).Deriving the path is already the established pattern rather than a new idea.
allod/nexuschecks/microvm/fixtures.nix:32,43computesvolumeImageFor = name: "${volumeRoot}/${name}/nix-state.img"fromvolumeRoot = "/var/lib/allod-microvm-volumes".allod/vmchecks/examples.nix:34uses the same shape. A per-machine placement fact would be data that is always a function of the machine name, and the docs above call out that a second declaration would only ever be "typed twice and kept in sync by an assertion, or derived from the option and then compared against itself."The framework declares the paths; the deployer supplies the bytes. Nothing here creates, formats, labels, truncates or relabels an image —
allod/strategydev planmicrovm-framework-adoption.mdcontract 13 keepsautoCreate = falseon every entry and leaves image creation an explicit provisioning action before a VM is enabled. The launcher already refuses a missing, non-regular or inaccessible image before QEMU starts.Scope
In scope: the required-path set per selected microvm archetype, the derived
microvm.volumesentries withautoCreate = falseandneededForBooton the correspondingfileSystemsentries, an overridable framework-owned image root, the archetypes-side error for an incomplete set, removal of theruntime-module-selectionplaceholder, and paired sabotage fixtures for each new assertion.Out of scope and tracked elsewhere in the same arc: runtime credential delivery and the guest credential root; guest networking and the TAP interface; the
extendModuleshost integration that suppliescredentialFilesfrom the Nexus host option; exporting the runtime throughvmFacts; and the nested-boot store-lifecycle tests that settle contract 6a, which the dev plan already requires before any real machine selects this runtime.This is public work. Every value it introduces is framework-owned and derived — a mount point set, an image root, and a name-keyed path. The private side substitutes its own machine data through the existing deploy redirect, exactly as it already does for addresses and host keys; no absolute path tied to a real host is written here.
Part of allod/strategy#20