The platform's VM provisioner (giantswarm/vm-manager)
in the lab: KVM virtual machines with an instance metadata service, a vTPM
with measured boot, an immutable image and attestation, exposed to muster and
the agents as x_vm-manager_<tool> and to the portal as one more server of
the Agent Platform group. vm-manager is the sibling of agent-manager (agents)
and model-manager (models) — the write surface for VMs — and runs the way they
do: as a pod, the agent-platform chart's components.vm-manager. The kind
node is a privileged docker container, so the host's /dev/kvm and
/dev/vhost-vsock are in it, and the runtime hands them to the privileged pod
(nothing is mounted from the node; the chart has no hostPath); QEMU and swtpm
are the pod's children. The guest image the pod boots is an OCI artifact its
init container fetches into the pod's state volume: the one every vm-manager
release publishes (gsoci.azurecr.io/giantswarm/vm-manager-guest-image:<version>,
the chart default), or a local build the lab pushes into its registry.
platform.vmManager in agentlab.yaml:
platform:
vmManager:
enabled: true
imageDir: /home/you/projects/giantswarm/vm-manager/images/build # optional: a local guest image build (`make -C images`); empty boots the release's
devImages:
vm-manager: vm-manager:dev # optional: a build of the checkout's binary (`make docker-build`)agentlab configurereports whether this machine has the KVM devices (KVM /dev/kvm and /dev/vhost-vsock present — platform.vmManager on, the release's guest imageor… a local guest image build from …). A machine without them turns the key off with the reason; a machine with them keeps what the file says — the pod is a heavier piece of the lab than a model server, so it is never turned on by itself.--vm-manager[=false]pins it,--vm-manager-image-dir <dir>names a local build.agentlab up/agentlab platformrefuse the key on a node without the devices, with the fix. WithimageDirset,platformpushes the build into the guest image registry asvm-manager-guest-image:devwithvm-manager image push— the same code the release pipeline runs — signed with this machine's build key, and records the manifest digest instate/vm-manager-guest-image.json. A rebuilt image is a new digest: the nextplatformrolls the pod, whose init container replaces the directory.- vm-manager reaches no registry over plain HTTP and accepts no unsigned
guest image, so a local build is signed and served over TLS. The guest
image registry is a zot container of its own,
<cluster>-guest-registry:5000on the kind network, at the release the lab registry runs (nothing new to pull). It serves HTTPS only, under a CA of its own instate/guest-registry/: the lab CA's name constraints admit the platform domain alone. The CA goes to the pod as the ConfigMapvm-manager-guest-registry-ca. The lab registry keeps everything else (charts, the Harness dev image). - The build key is the one
make dev-signing-keymakes in the vm-manager checkout ($XDG_STATE_HOME/vm-manager/dev-signing.key, orVM_MANAGER_GUEST_IMAGE_SIGNING_KEY). Only a vm-manager built from source with it (make docker-build) trusts it; a released one trusts its release's signature alone. So a local build needsplatform.devImages.vm-manager, andplatformchecks withvm-manager image trustthat the dev image trusts the key before it pushes, and refuses with the fix otherwise. - The chart that takes
guestImage.registryCAis vm-manager 0.30 or newer: an older chart's closedguestImageblock refuses the values, and the render says so.
- vm-manager reaches no registry over plain HTTP and accepts no unsigned
guest image, so a local build is signed and served over TLS. The guest
image registry is a zot container of its own,
agentlab platformturnscomponents.vm-manageron in the chart's values: the meta chart's ownvm-manager:block brings the pinned Service name, OAuth againstglobal.identity(the lab Dex; vm-manager has no anonymous mode and no switch for one from 0.30) and the musterMCPServerwith theagent-platformtool group and forward-token auth; the lab addsguestImage(the guest image registry, by digest, its CA asregistryCA) when a local build is configured and a state claim (persistence.create: true, the node's local-path storage) so the fetched image, its golden PCR values and the lab's VM records survive a pod restart. The pull always verifies the signature: the release's on the release's own guest image, the build key's on a local build. A vm-manager whose own NetworkPolicy is always on admits on its API port only the callers its values name and lets out only DNS, the in-cluster peers its values name and every public address (its guests share the pod's egress), never the cluster's networks. The lab names its own (networkPolicyin the values): muster and the probe pods ofvm-manager-testas callers, the lab Prometheus's namespace while it scrapes, the lab Dex as a peer and, for a local guest image, the guest image registry's address on the kind network. It sets them when the chart takes them, which it finds out by rendering the vm-manager release once more with the probe pods as a caller (an older chart, whose policy is off by default, refuses the key). Aplatform.devImages.vm-managerbuild is side-loaded into the node and swapped in like model-manager's (both containers of the pod run it). The run waits until muster reports the registration reachable.- The release's guest image download is sized before the install. The
pod's init container downloads the artifact (1,677 MiB for 0.24.10) with
vm-manager's own client before the pod is Ready, and Flux's default
5-minute timeout does not fit that on a home uplink: the install would time
out, be uninstalled and download from zero again
(giantswarm/vm-manager#240).
agentlab platformreads the reference off the vm-manager render, sizes the artifact from its manifest and setscomponents.vm-manager.timeoutto 5 minutes plus the download at 1 MiB/s (33mfor 0.24.10); its own install wait grows by as much. Unless the running pod already holds that image, it samples the link on the artifact's largest file (8 MiB or 8 s) and refuses a link too slow for that bound before anything is installed, with the measured rate, the estimate and the fixes. A local build (imageDir) comes from the guest image registry and is not sized. agentlab vm-manager-testis the proof (below).
An agentlab before 0.44 registered a vm-manager running on the host
(state/vm-manager.env, a lab-created MCPServer); agentlab platform
removes that registration before the install — the chart renders one of the
same name — and the environment file with it.
A released guest image artifact (vm-manager 0.23.0 and later, the pod's
default when platform.vmManager.imageDir is unset) carries the golden
values its release pipeline recorded for the same release's firmware
(golden.sha256 and golden_firmware in its policy.json): the pod
verifies both quotes of its first VM, nothing to record. vm-manager attests
every VM and has no mode that accepts a boot without golden values (0.30 and
later): a VM of an image without them is killed at its first quote, and
vm-manager-test refuses to boot one, naming the image.
A local build (imageDir) carries PCR 11 (the UKI) and PCR 13 (the
Kubernetes sysext) but no golden values for the firmware PCRs. Record them
the way the release pipeline does, before the lab pushes the build, in the
vm-manager checkout and with the vm-manager image the pod runs: the firmware
is the pod's OVMF (Ubuntu 26.04's, inside the vm-manager image), not the
host's, and values recorded for another firmware fail every quote (golden mismatch on PCRs 0 and 7, naming the build they were recorded for).
# in the vm-manager checkout, on a KVM host with no other vm-manager running
# (vsock CIDs are host-global); <vm-manager image> is the pod's
hack/guest-image-golden.sh <vm-manager image> <image dir>The script boots a reference VM of the image in a container of that
vm-manager image, writes the PCRs of its ready quote and the firmware build
into the directory's policy.json, and verifies a fresh VM against them.
The values then travel inside the artifact the lab pushes: list_images
reports them and agentlab vm-manager-test reads both quotes verified. A
rebuilt local build, or a vm-manager release that moves the firmware, is
recorded again.
The firmware PCRs follow the vm-manager release, not the guest image.
PCRs 0, 2, 3 and 7 measure the OVMF the pod boots with: ovmf-generic of the
vm-manager image, pinned in its Dockerfile since vm-manager 0.22.12. A
release that moves the pin is a pull request and a release note of its own,
update OVMF to <version>, re-record golden PCRs. It changes PCR 0 while the
guest image, its digest and the values on the state claim stay as they
were, and every quote then fails with golden mismatch: pcr 0
(vm-manager-test names this when the VM fails, with this recipe as the
fix). get_host reports the build the pod boots with as firmware (the
code image's SHA-256, the package and version), and vm-manager-test prints
it next to the host. A release that moves the pin ships values for the new
build in its guest image artifact; a local build's values are recorded again
after every change of it.
Before the pin, 0.20.2 → 0.21.0 moved the unpinned ovmf from
2025.11-3ubuntu7 to 2025.11-3ubuntu7.2 and changed PCR 0 alone (PCRs 2,
3, 4, 7 and 13 kept their values).
agentlab vm-manager-test [email] [--skip-vm] [--vm-timeout 6m]
- The identity boundary, against the pod's Service from inside the
cluster (a probe pod, the way muster dials it).
GET /api/v1/hostandGET /metricswithout a token answer 401; with the person's Dex id_token — the very token muster forwards — the host answers the capability report (ready,missing, the kernel, CPUs, memory). A vm-manager that answers anonymously (a release before 0.30), or refuses the lab's token (another issuer, CA or audience), fails here with the fix. Withplatform.observabilitythe lab Prometheus reports the vm-manager target up: its ServiceMonitor presents the chart's scrape token (Secretvm-manager-metrics), the only credential besides an OAuth token that/metricstakes. - Through muster as the person. The
x_vm-manager_*tools are aggregated — the core set of nineteen — with vm-manager's annotations intact (get_hostread-only,delete_vmdestructive: what a model reads before it calls);get_hostnames the same host as the direct call;list_imagesandlist_networksanswer (an image without golden PCR values is reported as such). - The registration. The chart's
MCPServercarries the agent-platform tool group and reads Connected. - The lifecycle (unless
--skip-vm, and only on a host that reportsreadywith an image):create_vmon the newest image (1 CPU, 1 GiB, an 8 GiB disk,wait_for: none), the states followed withget_vm— the installer boot, the installed boot,READY=1over vsock — untilready, with the install and boot durations;get_vm_attestationwith both stages verified (an image without golden values is refused beforecreate_vm: vm-manager would kill its VM at the first quote); on a signed image (one whose artifact carries its certificate,<id>_<version>.crt, whichcreate_vmenrolls into the VM's UEFI db — vm-manager 0.28 and later)exec_vmreads the guest's IPE state as root, one file per call (the kernel writes each flag without a newline):/sys/kernel/security/ipe/policies/giantswarm-vm/activeand/sys/kernel/security/ipe/enforceboth1; the last console lines;delete_vm, andlist_vmswithout it. A failed boot carries vm-manager'slastError(a refused attestation names the quote and the verifier's reason, a golden mismatch what changed) and the console tail. A leftover of an interrupted run (agentlab-vm-test-*) is removed first.
The lab's platform-test keeps its tool-group check: the chart's servers
(agent-manager, model-manager, vm-manager) carry the platform group from their
templates; nothing lab-created may claim it (the lab's family members carry
infrastructure from their charts, the OAuth fixture no label).
Through the lab muster as an MCP server (https://muster.127.0.0.1.nip.io/mcp):
x_vm-manager_get_host first, then x_vm-manager_list_images and
x_vm-manager_list_networks, then x_vm-manager_create_vm — the server's
own instructions say the order. In the portal, the MCP servers page lists
vm-manager under Agent Platform; an agent with a toolset that admits it can
provision VMs as the person who asked. agentlab logs vm-manager follows the
pod (--verbose is on in the lab's values for a dev image).
The pod's VMs end with the pod: a agentlab platform that rolls the
Deployment (a new dev image, a new guest image digest, changed values) stops
every VM; their records and disks stay on the state claim for the next
start_vm. The pod's policy is the chart's own (above); the connectivity
chart's vm-manager policies join it only with platform.networkPolicy.