feat(pxe-infra): add vm.autostart option (default false)
The QEMU/KVM guest was unconditionally `wantedBy = [ "multi-user.target" ]`, which means it would have come up on every boot of rydiwo. The intent is the opposite for now: the VM is for script-development iteration, not a permanent rig. We want to start it by hand (`systemctl start pxe-infra-vm`) when a test session needs it, and stop it the same way. - modules/options.nix: new options.pxe-infra.vm.autostart (default false). Describes when to flip it on (long unattended test runs) and that the unit itself is always present when pxe-infra.vm.enable is true. - modules/pxe-infra/vm.nix: wantedBy is now `lib.optional config.pxe-infra.vm.autostart "multi-user.target"`, so with autostart=false the unit is reachable via `systemctl start` but not pulled in by multi-user.target. - configurations/mini-laptop.nix: commented example now shows the `vm.autostart = false` form, and the surrounding comment documents the manual-start workflow.
This commit is contained in:
1 parent
bc62b6f03d
commit
85953f9b3d
3 files changed
+36
-6
No files matched your search
@@ -333,6 +333,21 @@
|
||||
testable memory in Phase 3 (RAM burnin).
|
||||
'';
|
||||
};
|
||||
autostart = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether the QEMU guest starts on boot. Off by default:
|
||||
for script-development iteration, you start it by hand
|
||||
(`systemctl start pxe-infra-vm`) and stop it the same
|
||||
way. Set this to true if you want the VM up whenever
|
||||
rydiwo is up (e.g. while leaving a long unattended
|
||||
test running). The systemd unit itself is always
|
||||
present when pxe-infra.vm.enable is true, so toggling
|
||||
autostart does not require anything beyond this
|
||||
option flipping.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# iPXE bootloader staging. Bridges the UEFI firmware (which
|
||||
|
||||
@@ -31,7 +31,12 @@
|
||||
|
||||
systemd.services.pxe-infra-vm = {
|
||||
description = "pxe-infra: PXE-boot QEMU/KVM guest (L4)";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
# Autostart is off by default. The unit still exists, so
|
||||
# `systemctl start pxe-infra-vm` is enough to bring the
|
||||
# guest up for a test session; `systemctl stop` to tear
|
||||
# it down. To bring it up on every boot, set
|
||||
# pxe-infra.vm.autostart = true.
|
||||
wantedBy = lib.optional config.pxe-infra.vm.autostart "multi-user.target";
|
||||
after = [
|
||||
"pxe-infra-bridge.service"
|
||||
"dnsmasq.service"
|
||||
|
||||
Reference in new issue
Block a user