summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-02-25 04:38:28 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-02-26 01:05:02 +0000
commit506d5af230f0b41809dfe754e84d5611b75c6585 (patch)
treedfa2cc520f6fe1ecb867c0373d6eb353e89977d4
parentefccccda627426319d4ced3b8c8467962a69e30c (diff)
downloadmeta-virtualization-506d5af230f0b41809dfe754e84d5611b75c6585.tar.gz
xen: update documentation with vxn/containerd integration and runtime tests
README-xen.md: - Add vxn and containerd integration section describing all execution paths (containerd, vxn standalone, vdkr/vpdmn, native Docker/Podman) - Add memory requirements section explaining QB_MEM_VALUE=1024 is insufficient for vxn/vctr and documenting qemuparams="-m 4096" - Add runtime tests section with build prerequisites, test commands, and skip behavior - Fix x86-64 runqemu command to include qemuparams="-m 4096" vxn/README.md: - Add testing section referencing the pytest runtime test suite Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-core/vxn/README.md26
-rw-r--r--recipes-extended/images/README-xen.md93
2 files changed, 118 insertions, 1 deletions
diff --git a/recipes-core/vxn/README.md b/recipes-core/vxn/README.md
index 35802e31..2c0ca0ec 100644
--- a/recipes-core/vxn/README.md
+++ b/recipes-core/vxn/README.md
@@ -139,6 +139,32 @@ VM isolation.
139- `vctr`/`ctr` (containerd) — CNI is separate and opt-in 139- `vctr`/`ctr` (containerd) — CNI is separate and opt-in
140- `vdkr`/`vpdmn` — Handle networking independently via xenbr0 140- `vdkr`/`vpdmn` — Handle networking independently via xenbr0
141 141
142## Testing
143
144Automated runtime tests boot xen-image-minimal and verify vxn end-to-end:
145
146```bash
147pip install pytest pexpect
148
149# All Xen runtime tests (requires built image + KVM)
150cd meta-virtualization
151pytest tests/test_xen_runtime.py -v --machine qemux86-64
152
153# vxn/containerd tests only
154pytest tests/test_xen_runtime.py -v -k "Vxn or Containerd"
155
156# Skip network-dependent tests
157pytest tests/test_xen_runtime.py -v -m "boot and not network"
158```
159
160The tests boot the image with `qemuparams="-m 4096"` to provide enough
161memory for Dom0 + bundled guests + vxn/vctr guests. Tests detect
162available features inside Dom0 and skip gracefully when components are
163not installed.
164
165See `tests/README.md` for full test documentation and `recipes-extended/images/README-xen.md`
166for build prerequisites at each test tier.
167
142## Debugging 168## Debugging
143 169
144```bash 170```bash
diff --git a/recipes-extended/images/README-xen.md b/recipes-extended/images/README-xen.md
index e5b4ca4a..3fe490a3 100644
--- a/recipes-extended/images/README-xen.md
+++ b/recipes-extended/images/README-xen.md
@@ -220,7 +220,7 @@ The xen-image-minimal recipe includes x86-64 specific configuration:
220 % MACHINE=qemux86-64 bitbake xen-guest-image-minimal 220 % MACHINE=qemux86-64 bitbake xen-guest-image-minimal
221 % MACHINE=qemux86-64 bitbake xen-image-minimal 221 % MACHINE=qemux86-64 bitbake xen-image-minimal
222 222
223 % runqemu qemux86-64 nographic slirp kvm 223 % runqemu qemux86-64 nographic slirp kvm qemuparams="-m 4096"
224 224
225qemux86-64 login: root 225qemux86-64 login: root
226 226
@@ -240,3 +240,94 @@ containerd test:
240root@qemux86-64:~# ctr image pull docker.io/library/alpine:latest 240root@qemux86-64:~# ctr image pull docker.io/library/alpine:latest
241root@qemux86-64:~# vctr run --rm docker.io/library/alpine:latest test1 echo hello 241root@qemux86-64:~# vctr run --rm docker.io/library/alpine:latest test1 echo hello
242hello 242hello
243
244vxn and containerd integration
245------------------------------
246
247vxn runs OCI containers as Xen DomU guests. The VM IS the container —
248no Docker daemon runs inside the guest. The guest boots a minimal Linux,
249mounts the container's filesystem, and directly executes the entrypoint.
250
251There are multiple execution paths, all coexisting on the same Dom0:
252
253| Path | CLI | How it works |
254|------|-----|-------------|
255| containerd | `vctr run`, `ctr run` | containerd → shim → vxn-oci-runtime → xl create |
256| vxn standalone | `vxn run` | OCI pull on host → xl create → guest exec |
257| vdkr/vpdmn | `vdkr run`, `vpdmn run` | Docker/Podman-like CLI, no daemon, auto-detects Xen |
258| Native Docker | `docker run --network=none` | dockerd → containerd → vxn-oci-runtime |
259| Native Podman | `podman run --network=none` | conmon → vxn-oci-runtime |
260
261To enable vxn and containerd on a Dom0 image, add to local.conf:
262
263 DISTRO_FEATURES:append = " virtualization vcontainer vxn"
264 IMAGE_INSTALL:append:pn-xen-image-minimal = " vxn"
265 BBMULTICONFIG = "vruntime-aarch64 vruntime-x86-64"
266
267See recipes-core/vxn/README.md for full package and build details.
268
269Memory requirements
270-------------------
271
272The recipe sets QB_MEM_VALUE = "1024" (1 GB total QEMU memory). This is
273sufficient for Dom0 + one bundled guest, but not enough for vxn/vctr
274which need to create additional Xen domains at runtime.
275
276For vxn/containerd testing, pass extra memory via qemuparams:
277
278 % runqemu qemux86-64 nographic slirp kvm qemuparams="-m 4096"
279
280Memory budget at 4 GB total:
281
282 | Component | Memory |
283 |-----------|--------|
284 | Domain-0 | 512 MB (dom0_mem=512M) |
285 | Alpine guest (bundled) | 256 MB |
286 | vxn/vctr guest | 256 MB |
287 | Free for additional guests | ~3 GB |
288
289Runtime tests
290-------------
291
292The pytest suite in tests/test_xen_runtime.py boots xen-image-minimal
293via runqemu and verifies the Xen environment end-to-end:
294
295 | Test Class | What It Checks |
296 |------------|---------------|
297 | TestXenDom0Boot | xl list shows Domain-0, dmesg has Xen messages, memory cap |
298 | TestXenGuestBundleRuntime | Bundled guests visible in xl list, xendomains service |
299 | TestXenVxnStandalone | vxn binary present, vxn run --rm alpine echo hello |
300 | TestXenContainerd | containerd active, ctr pull + vctr run |
301
302Build prerequisites (cumulative — each tier adds to the previous):
303
304 # Tier 1: Dom0 boot tests
305 DISTRO_FEATURES:append = " xen systemd"
306 bitbake xen-image-minimal
307
308 # Tier 2: Guest bundling tests
309 IMAGE_INSTALL:append:pn-xen-image-minimal = " alpine-xen-guest-bundle"
310
311 # Tier 3: vxn/containerd tests
312 DISTRO_FEATURES:append = " virtualization vcontainer vxn"
313 IMAGE_INSTALL:append:pn-xen-image-minimal = " vxn"
314 BBMULTICONFIG = "vruntime-aarch64 vruntime-x86-64"
315
316Running the tests:
317
318 % cd meta-virtualization
319 % pip install pytest pexpect
320
321 # All tests (requires KVM and built image)
322 % pytest tests/test_xen_runtime.py -v --machine qemux86-64
323
324 # Core hypervisor tests only (skip network-dependent vxn/containerd)
325 % pytest tests/test_xen_runtime.py -v -m "boot and not network"
326
327 # With custom timeout or no KVM
328 % pytest tests/test_xen_runtime.py -v --boot-timeout 180 --no-kvm
329
330Tests detect available features inside Dom0 and skip gracefully when
331optional components (vxn, containerd, bundled guests) are not installed.
332The vxn/vctr tests also check Xen free memory and skip if insufficient
333for creating new domains.