Repository navigation
feat(kubevirt): host_devices, the schema half of nested virtualisation - #277
Conversation
A KubeVirt guest gets its own `/dev/kvm` only through
`spec.domain.devices.hostDevices` — a CPU feature alone is not enough — and a guest without
`/dev/kvm` cannot run a VM at all. `#KubevirtDevices` had no way to express it, so no charly
kubevirt entity could.
`host_devices` is a list of `#KubevirtHostDevice` (`device_name`, optional `name`). The device
vocabulary belongs to the cluster's device plugin: on `quant-dev` it advertises
`devices.kubevirt.io/kvm`, so a nested-virt guest asks for `{device_name: "kvm", name: "kvm"}`.
Measured need (2026-10-23): the `quant-dev` hosts are ready — `nested=1`, `/dev/kvm` present,
all three nodes advertising `devices.kubevirt.io/kvm: 1k` — while every Ubuntu CI runner guest
had neither `/dev/kvm` nor `svm` in `/proc/cpuinfo`, because the rendered VMI carries
`cpu.model: host-model` and no host devices.
Assisted-by: Claude Code DeepSeek deepseek-v4.1-flash:cloud (analysed on a live system)
Review — PASSScope and correctnessThe change is exactly what the body claims: two files, additive only.
Body honesty
Tests
SecurityNo secrets, no input handling, no privilege or dependency changes. Pure schema/type addition. CommentsThere are no comments to disposition. CommitsSingle focused commit; message matches the change. No blocking findings. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSWhat the diff actually does
Body honesty
Tests
SecurityNo secrets, no input handling, no privilege or dependency changes. Pure type addition. Scope and cleanlinessSingle coherent change, no dead code, no legacy path, no duplication. The new definition is the single way to express a host device (honours the "one way" intent stated in the body). CommentsOne comment: @github-actions[bot] — an automated Non-blocking nitThe No blocking findings. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…stDevices (#43) A guest gets its own /dev/kvm only through KubeVirt host-device passthrough; a CPU feature alone is not enough. Render the authored `devices.host_devices` entries (schema half merged: opencharly/spec#277) onto `spec.template.spec.domain.devices.hostDevices`, with `deviceName` required and the optional guest `name` omitted when unset so KubeVirt's own default (deviceName) applies. Bump the lockstep module set: spec v0.2026296.1338 (the first tag carrying Host_devices) and sdk v0.2026296.1207 (the older sdk aliases spec types that were removed since v0.2026287.638, so spec could not move alone). Document the nested-virtualisation authoring in the kubevirt skill and the candy description. Test: TestRenderVirtualMachine_HostDevices fails without the renderer (`hostDevices = <nil>, want 2 entries`) and passes with it; build, vet, gofmt and the full package test suite pass on this tree. Assisted-by: Claude Code DeepSeek deepseek-v4.1-flash:cloud (analysed on a live system)
Summary
#KubevirtDevicesgainshost_devices— a list of the new#KubevirtHostDevice(
device_name, optionalname). It is the schema half of nested virtualisation: a KubeVirt guestgets its own
/dev/kvmonly throughspec.domain.devices.hostDevices, and a guest without/dev/kvmcannot run a VM at all. A CPU feature (svm) alone is not enough.Why it is needed — measured, not assumed
The
blacksmith-*-labelled Ubuntu runners stand in for real Blacksmith runners, and Blacksmithdocuments KVM / nested virtualisation as supported by default on its x64 Linux runners
(https://docs.blacksmith.sh/blacksmith-runners/overview#do-blacksmith-runners-support-kvm-or-nested-virtualization).
Our fleet does not meet that bar today.
Host side — ready, measured on a
virt-launcherpod onquant-dev:All three nodes advertise
devices.kubevirt.io/kvm: 1k.Guest side — nothing reaches the guest:
The rendered VMI explains both:
cpu: {cores: 8, model: host-model}(a migratable model, sosvmis dropped) and adevices:block with nohostDevices.cpu.modelwas alreadyexpressible;
hostDeviceswas not. This unblocks it.Shape
Typed rather than typed-open like
disks, because both fields are meaningful anddevice_nameis required. The device vocabulary stays the cluster's, not ours —
kvmtoday, anything a deviceplugin advertises tomorrow.
How tested
The regeneration touched only the two files this change is about (
schema/kubevirt.cue+14,spec/cue_types_gen.go+16), and the reproducibility check is part ofcue-genitself, so anon-idempotent edit cannot land.
Rulebook compliance
cue-genis reproducible on the committed tree (its owncheck:), and the generated Go is what the consumer will compile against.Change classification
Schema addition plus its generated Go. No consumer uses the field until the follow-up PRs land,
so nothing changes behaviour by itself.
Agent: claude-code-crabbox-ci · Assisted-by: Claude Code DeepSeek deepseek-v4.1-flash:cloud (analysed on a live system)