Repository navigation
nvx-rs: template mode, repair and activation in NVX's init #852
Copy link
Copy link
Open
Description
Parent: #837 (#833). Needs: #851, stage 3 (#836) or #837's fallback, and #817, in the NVX library wiring workstream (#816); its VM tests run with #853. Unblocks: #853.
Goal. NVX's Rust init captures templates and activates clones through the shared guest library, with every stage 3 feature, and NVX's exit statuses and shutdown.
Today (dev d04d9fb):
- NVX's layered root runs under the shell init:
guest/common/nvx-init-agentassembles an EROFS layer over an ext4 scratch, rejects GPT and the RAM upper, and starts the managed agent on the control TTY (:89-116,:589-679). nvx-rs: run NVX's layered sandbox root from a Rust PID 1 on the guest library #817 replaces it with a Rust PID 1 onnvx::guest::rootandnvx::guest::entry. - The shell
nvx-snapshotcaptures and repairs (guest/common/nvx-snapshot).
Implementation:
- Template mode, in nvx-rs: run NVX's layered sandbox root from a Rust PID 1 on the guest library #817's init: it reads
/proc/cmdlineearly. Withnvx_snapshot_tier=platform, it accepts only the platform allowlist's tokens, skips root assembly, attaches the control session, and runs nvx-rs: capture preparation in the guest, and template mode in the test adapter's guest #840's preparation and capture. - In a clone:
- repair (nvx-rs: repair a restored clone in the guest, with an owned seed and one acknowledgment #842), with the CPU prefix (nvx-rs: per-clone CPU targets #849);
- the restricted state and Activate over NVXC v2 (nvx-rs: Activate, and the restore transaction in Ready, in NVXC v2 #851, nvx-rs: the restricted control state and Activate after a restore, in the guest library and the test adapter's framing #843);
- root activation (nvx-rs: activate a clone's root for GPT images and either upper, with its export, network settings and workload view #845), with listener publication (nvx-rs: per-clone network policies on deny-all templates #850);
- then the managed agent serves MAPS, EXEC and Stop as after a cold boot.
- Statuses: the init maps repair and activation failures to the documented statuses, writes a bounded diagnostic, and powers off. 193, 194 and 195 keep their meanings.
- Shell tools:
nvx-snapshotkeeps serving the other snapshot tiers. - Sizes: the guest binaries' and initramfs's sizes, before and after, are recorded.
Tests:
- Without a VM: template-mode token handling; status mapping.
- In VMs, on KVM, MSHV and WHP, with nvx-rs: template and clone commands in
nvx-rs sandbox#853: template captures; clones of each format and upper; CPU and memory targets; per-clone network policies with listener publication; each failure status.
Guide (#591's numbering): 4.1.4 (NVX's managed layered root in template mode), 5.3.2 (guest preparation in NVX's init), 5.6.2 (NVX's statuses).
Done when: merged, and NVX's clones activate in VMs on the three backends.
Metadata
Metadata
Assignees
Labels
No labels
Activity