diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-25 04:38:28 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-26 01:05:02 +0000 |
| commit | 506d5af230f0b41809dfe754e84d5611b75c6585 (patch) | |
| tree | dfa2cc520f6fe1ecb867c0373d6eb353e89977d4 | |
| parent | efccccda627426319d4ced3b8c8467962a69e30c (diff) | |
| download | meta-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.md | 26 | ||||
| -rw-r--r-- | recipes-extended/images/README-xen.md | 93 |
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 | |||
| 144 | Automated runtime tests boot xen-image-minimal and verify vxn end-to-end: | ||
| 145 | |||
| 146 | ```bash | ||
| 147 | pip install pytest pexpect | ||
| 148 | |||
| 149 | # All Xen runtime tests (requires built image + KVM) | ||
| 150 | cd meta-virtualization | ||
| 151 | pytest tests/test_xen_runtime.py -v --machine qemux86-64 | ||
| 152 | |||
| 153 | # vxn/containerd tests only | ||
| 154 | pytest tests/test_xen_runtime.py -v -k "Vxn or Containerd" | ||
| 155 | |||
| 156 | # Skip network-dependent tests | ||
| 157 | pytest tests/test_xen_runtime.py -v -m "boot and not network" | ||
| 158 | ``` | ||
| 159 | |||
| 160 | The tests boot the image with `qemuparams="-m 4096"` to provide enough | ||
| 161 | memory for Dom0 + bundled guests + vxn/vctr guests. Tests detect | ||
| 162 | available features inside Dom0 and skip gracefully when components are | ||
| 163 | not installed. | ||
| 164 | |||
| 165 | See `tests/README.md` for full test documentation and `recipes-extended/images/README-xen.md` | ||
| 166 | for 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 | ||
| 225 | qemux86-64 login: root | 225 | qemux86-64 login: root |
| 226 | 226 | ||
| @@ -240,3 +240,94 @@ containerd test: | |||
| 240 | root@qemux86-64:~# ctr image pull docker.io/library/alpine:latest | 240 | root@qemux86-64:~# ctr image pull docker.io/library/alpine:latest |
| 241 | root@qemux86-64:~# vctr run --rm docker.io/library/alpine:latest test1 echo hello | 241 | root@qemux86-64:~# vctr run --rm docker.io/library/alpine:latest test1 echo hello |
| 242 | hello | 242 | hello |
| 243 | |||
| 244 | vxn and containerd integration | ||
| 245 | ------------------------------ | ||
| 246 | |||
| 247 | vxn runs OCI containers as Xen DomU guests. The VM IS the container — | ||
| 248 | no Docker daemon runs inside the guest. The guest boots a minimal Linux, | ||
| 249 | mounts the container's filesystem, and directly executes the entrypoint. | ||
| 250 | |||
| 251 | There 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 | |||
| 261 | To 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 | |||
| 267 | See recipes-core/vxn/README.md for full package and build details. | ||
| 268 | |||
| 269 | Memory requirements | ||
| 270 | ------------------- | ||
| 271 | |||
| 272 | The recipe sets QB_MEM_VALUE = "1024" (1 GB total QEMU memory). This is | ||
| 273 | sufficient for Dom0 + one bundled guest, but not enough for vxn/vctr | ||
| 274 | which need to create additional Xen domains at runtime. | ||
| 275 | |||
| 276 | For vxn/containerd testing, pass extra memory via qemuparams: | ||
| 277 | |||
| 278 | % runqemu qemux86-64 nographic slirp kvm qemuparams="-m 4096" | ||
| 279 | |||
| 280 | Memory 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 | |||
| 289 | Runtime tests | ||
| 290 | ------------- | ||
| 291 | |||
| 292 | The pytest suite in tests/test_xen_runtime.py boots xen-image-minimal | ||
| 293 | via 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 | |||
| 302 | Build 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 | |||
| 316 | Running 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 | |||
| 330 | Tests detect available features inside Dom0 and skip gracefully when | ||
| 331 | optional components (vxn, containerd, bundled guests) are not installed. | ||
| 332 | The vxn/vctr tests also check Xen free memory and skip if insufficient | ||
| 333 | for creating new domains. | ||
