runtime-rs: Add support for OpenVMM - #466
Open
sprt wants to merge 11 commits into
Open
Conversation
* Adds a new backend to runtime-rs where Kata talks to the OpenVMM process via protobufs over ttrpc. * The protobufs are vendored from the OpenVMM repo via a new make target and the Rust bindings are autogenerated when `cargo build` runs, all matching prior art. * Introduced a new config file: configuration-openvmm-azure-runtime-rs.toml Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com> Original-Commit: 4caf4ea Original-Commit-Date: 2026-07-22
* Introduced 2 new CIs: * kata-containers-ci-on-push / run-k8s-tests-on-aks / run-k8s-tests (cbl-mariner, openvmm-azure-runtime-rs, normal) * kata-containers-ci-on-push / run-k8s-tests-on-aks / run-k8s-tests (cbl-mariner, openvmm-azure-runtime-rs, small) * OpenVMM is built from source following prior art. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com> Original-Commit: 92014f7 Original-Commit-Date: 2026-07-22
Remove DWARF debug information from the OpenVMM binary before packaging it. This reduces the compressed OpenVMM asset by about 87 MiB and keeps the combined release tarball below GitHub’s 2 GiB asset limit. This should be reverted when the CI allows. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com> Original-Commit: 161969b Original-Commit-Date: 2026-07-22
Represent each guest PCI path element as a device/function pair so multifunction root ports can be reported to kata-agent without losing the function number. Keep function-zero formatting and constructors compatible. Reject nonzero functions at the legacy add-swap RPC boundary instead of truncating them. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
sprt
force-pushed
the
sprt/msft-main-ovmm-oop
branch
3 times, most recently
from
July 27, 2026 19:00
086f30f to
b1aadd3
Compare
Cold-plug modern VFIO PCI devices through the external OpenVMM VM service. Discover devices through CDI or the raw OCI specification, send full host BDFs over TTRPC, and report deterministic function-aware guest PCI paths back to the agent. Reserve 16 multifunction root ports and use the GPU-sized MMIO apertures from the in-process implementation. Legacy VFIO and post-launch VFIO changes remain unsupported. Reference-Commit: f12d92d Reference-Commit: 4c19e86 Reference-Commit: 016bd39 Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
node-builder: force regenerating config files It seems the upstream makefile doesn't regenerate the config if the generated config exists, so remove it before rebuilding. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
* Onboard the new upstream configuration-clh-azure-runtime-rs.toml. * Set the new upstream IMAGENAME_AZURE to kata-containers.img (instead of kata-containers-mariner.img) to preserve fork behavior. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
sprt
force-pushed
the
sprt/msft-main-ovmm-oop
branch
from
July 27, 2026 22:32
b1aadd3 to
25f9bff
Compare
Extend node-builder to support OpenVMM. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
Replace the stale msft-preview branch references with msft-main. We forgot this follow-up when msft-main was reset to msft-preview. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
This allows fixup! commits to make future rebases easier: `git rebase --autosquash` will automatically squash such commits into the corresponding earlier commits to keep the history clean. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
sprt
force-pushed
the
sprt/msft-main-ovmm-oop
branch
from
July 27, 2026 22:38
25f9bff to
ca332cb
Compare
sprt
marked this pull request as ready for review
July 27, 2026 22:39
There was a problem hiding this comment.
Pull request overview
This PR backports upstream work to add an OpenVMM hypervisor backend to runtime-rs (implemented as an external, out-of-process VMM controlled over TTRPC), plus follow-on commits to support VFIO passthrough, align Microsoft static resource-management behavior for OpenVMM, and wire the new hypervisor into packaging, node-builder, and CI for the msft-main branch.
Changes:
- Add an OpenVMM hypervisor implementation for runtime-rs (TTRPC client/server bindings, process lifecycle wrapper, OpenVMM-specific PCIe topology/device management, config template, and feature gating).
- Extend VFIO handling (CDI/Pod Resources + raw OCI fallback), and update PCI path representation to support multifunction devices (function != 0).
- Update packaging, node-builder, and GitHub workflows to build/ship OpenVMM assets and to target
msft-maininstead ofmsft-preview.
Reviewed changes
Copilot reviewed 70 out of 71 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
versions.yaml |
Pins an OpenVMM repo + commit SHA under hypervisor assets. |
tools/testing/gatekeeper/skips.py |
Changes default gatekeeper target branch to msft-main. |
tools/packaging/static-build/openvmm/Dockerfile |
Adds a builder image for compiling OpenVMM from source. |
tools/packaging/static-build/openvmm/build.sh |
Adds a wrapper to build OpenVMM via the new container builder. |
tools/packaging/static-build/openvmm/build-static-openvmm.sh |
Implements the actual OpenVMM-from-source build, MSRV pinning, and artifact staging. |
tools/packaging/scripts/lib.sh |
Adds get_openvmm_image_name() helper for builder image tagging. |
tools/packaging/kata-deploy/shim-components.json |
Adds an openvmm-azure-runtime-rs shim component mapping. |
tools/packaging/kata-deploy/local-build/Makefile |
Adds openvmm-tarball target plumbing. |
tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh |
Adds install_openvmm() to build/install a static OpenVMM binary into kata-deploy outputs. |
tools/packaging/kata-deploy/helm-chart/kata-deploy/values.yaml |
Adds Helm values for enabling openvmm-azure-runtime-rs. |
tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/runtimeclasses.yaml |
Adds default resource requests for the OpenVMM runtimeclass. |
tools/packaging/kata-deploy/binary/src/utils/system.rs |
Adds OpenVMM shim to the rust shim list. |
tools/packaging/kata-deploy/binary/src/artifacts/install.rs |
Adds OpenVMM shim recognition and maps it to the openvmm hypervisor binary; adds tests. |
tools/osbuilder/node-builder/azure-linux/README.md |
Documents node-builder usage for OpenVMM + runtime-rs. |
tools/osbuilder/node-builder/azure-linux/package_install.sh |
Installs CLH/OpenVMM runtime-rs configs side-by-side (optionally). |
tools/osbuilder/node-builder/azure-linux/package_build.sh |
Adds OpenVMM toggles/flags and cleans up generated runtime-rs config outputs. |
tools/osbuilder/node-builder/azure-linux/Makefile |
Exports USE_OPENVMM default. |
tools/osbuilder/node-builder/azure-linux/common.sh |
Introduces OpenVMM config filenames and /usr/bin/openvmm location. |
tools/osbuilder/node-builder/azure-linux/clean.sh |
Cleans runtime-go + runtime-rs debug config outputs more precisely. |
tests/static-checks.sh |
Excludes vendored OpenVMM proto sources from license-header checks. |
tests/spellcheck/kata-dictionary.txt |
Adds OpenVMM and vmservice to the spellcheck dictionary. |
tests/hypervisor_helpers.sh |
Adds openvmm-azure-runtime-rs to the test hypervisor list. |
src/runtime-rs/Makefile |
Adds OpenVMM hypervisor option, config generation, azure image naming, kubelet root dir var, and feature joining logic. |
src/runtime-rs/crates/runtimes/virt_container/src/sandbox.rs |
Adds raw VFIO device discovery fallback + deduping + OpenVMM restore support. |
src/runtime-rs/crates/runtimes/virt_container/src/lib.rs |
Registers OpenVMM config plugin and instantiates OpenVMM hypervisor when selected. |
src/runtime-rs/crates/runtimes/virt_container/Cargo.toml |
Adds an openvmm feature wired to the hypervisor crate feature. |
src/runtime-rs/crates/runtimes/Cargo.toml |
Exposes openvmm feature at the runtimes crate level. |
src/runtime-rs/crates/resource/src/cpu_mem/swap.rs |
Validates PCI function==0 for swap PCI paths; adds unit tests. |
src/runtime-rs/crates/resource/src/cpu_mem/initial_size.rs |
Adds tests covering static sizing defaults vs explicit resources. |
src/runtime-rs/crates/hypervisor/src/utils.rs |
Adds a shared vCPU TID scanner used by CH/OpenVMM. |
src/runtime-rs/crates/hypervisor/src/openvmm/vmm_instance.rs |
Implements OpenVMM external process wrapper + TTRPC client lifecycle + tests. |
src/runtime-rs/crates/hypervisor/src/openvmm/protos/vmservice.proto |
Vendors OpenVMM vmservice proto definition. |
src/runtime-rs/crates/hypervisor/src/openvmm/protos/README.md |
Documents proto vendoring/update process for OpenVMM vmservice. |
src/runtime-rs/crates/hypervisor/src/openvmm/protos/google/protobuf/struct.proto |
Vendors protobuf dependency used by the OpenVMM proto. |
src/runtime-rs/crates/hypervisor/src/openvmm/protos/google/protobuf/empty.proto |
Vendors protobuf dependency used by the OpenVMM proto. |
src/runtime-rs/crates/hypervisor/src/openvmm/mod.rs |
Adds the OpenVMM hypervisor implementation and Persist integration. |
src/runtime-rs/crates/hypervisor/src/openvmm/inner.rs |
Adds OpenVMM internal state and hotplug port bookkeeping. |
src/runtime-rs/crates/hypervisor/src/openvmm/inner_hypervisor.rs |
Implements OpenVMM VM creation/topology, cold-plug VFIO assignment, and lifecycle RPCs. |
src/runtime-rs/crates/hypervisor/src/openvmm/inner_device.rs |
Implements OpenVMM block hotplug and VFIO lifecycle constraints; adds tests. |
src/runtime-rs/crates/hypervisor/src/lib.rs |
Wires OpenVMM module + exports OpenVMM hypervisor name behind feature flag. |
src/runtime-rs/crates/hypervisor/src/device/topology.rs |
Updates PCIe topology helper to use new PciSlot::new() API. |
src/runtime-rs/crates/hypervisor/src/device/pci_path.rs |
Refactors PciSlot/PciPath to support PCI function numbers; updates tests. |
src/runtime-rs/crates/hypervisor/src/device/driver/vfio_device/mod.rs |
Exposes DeviceAddress needed for OpenVMM VFIO handling. |
src/runtime-rs/crates/hypervisor/src/ch/inner_hypervisor.rs |
Reuses shared vCPU TID scanner for CH instead of local implementation. |
src/runtime-rs/crates/hypervisor/Makefile |
Adds update-proto target to refetch pinned OpenVMM vmservice.proto. |
src/runtime-rs/crates/hypervisor/Cargo.toml |
Adds optional protobuf dependency and openvmm feature gating. |
src/runtime-rs/crates/hypervisor/build.rs |
Generates OpenVMM TTRPC bindings when openvmm feature is enabled and patches service name. |
src/runtime-rs/crates/hypervisor/.gitignore |
Ignores generated OpenVMM binding outputs. |
src/runtime-rs/config/configuration-openvmm-azure-runtime-rs.toml.in |
Adds an OpenVMM runtime-rs Azure config template including static resource mgmt keys. |
src/runtime-rs/Cargo.toml |
Exposes openvmm feature at the runtime-rs top level. |
src/libs/kata-types/src/config/mod.rs |
Re-exports OpenVMM config and name from kata-types config module. |
src/libs/kata-types/src/config/hypervisor/openvmm.rs |
Adds OpenVMM config plugin (validation + defaults). |
src/libs/kata-types/src/config/hypervisor/mod.rs |
Wires OpenVMM module into kata-types hypervisor config. |
Cargo.lock |
Pulls protobuf into the lockfile for the new optional dependency. |
.github/workflows/static-checks.yaml |
Updates workflow env to msft-main. |
.github/workflows/scorecard.yaml |
Updates scorecard docs link and branch triggers to msft-main. |
.github/workflows/run-k8s-tests-on-aks.yaml |
Adds OpenVMM matrix entries to AKS tests. |
.github/workflows/release-s390x.yaml |
Updates branch/tag handling to msft-main. |
.github/workflows/release-ppc64le.yaml |
Updates branch/tag handling to msft-main. |
.github/workflows/release-arm64.yaml |
Updates branch/tag handling to msft-main. |
.github/workflows/release-amd64.yaml |
Updates branch/tag handling to msft-main. |
.github/workflows/push-oras-tarball-cache.yaml |
Updates branch trigger to msft-main. |
.github/workflows/payload-after-push.yaml |
Updates branch trigger to msft-main. |
.github/workflows/osv-scanner-scheduled.yaml |
Updates branch trigger to msft-main. |
.github/workflows/osv-scanner-pr.yaml |
Updates PR branch filter to msft-main. |
.github/workflows/docs.yaml |
Updates branch trigger to msft-main. |
.github/workflows/commit-message-check.yaml |
Allows fixup! commit subjects and updates contributing link to msft-main. |
.github/workflows/codeql.yml |
Updates branch filters to msft-main. |
.github/workflows/ci-on-push.yaml |
Updates PR branch filter to msft-main. |
.github/workflows/build-kubectl-image.yaml |
Updates branch trigger to msft-main. |
.github/workflows/build-kata-static-tarball-amd64.yaml |
Adds openvmm component to the static tarball build matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+97
to
+104
| ARCH_SUPPORT_OPENVMM := x86_64 aarch64 | ||
| ifneq ($(filter $(ARCH),$(ARCH_SUPPORT_OPENVMM)),) | ||
| USE_OPENVMM := true | ||
| else | ||
| USE_OPENVMM := false | ||
| $(info OpenVMM does not support ARCH $(ARCH), disabled. \ | ||
| Specify "USE_OPENVMM=true" to force enable.) | ||
| endif |
Comment on lines
+55
to
+65
| if [[ "${USE_OPENVMM}" == "yes" ]]; then | ||
| runtime_rs_make_flags+=( | ||
| "HYPERVISOR=openvmm-runtime-rs" | ||
| "USE_OPENVMM=true" | ||
| ) | ||
| else | ||
| runtime_rs_make_flags+=( | ||
| "HYPERVISOR=cloud-hypervisor" | ||
| "USE_OPENVMM=false" | ||
| ) | ||
| fi |
Comment on lines
+490
to
+494
| let comm_path = tid_path.join(&tid_str).join("comm"); | ||
|
|
||
| if !comm_path.exists() { | ||
| return Err(anyhow!("comm path was not found.")); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backport of my upstream PR into msft-main.
Commits in order:
fixup!commits so that they'll be trivial to squash during the next msft-main rebase usinggit rebase --autosquashTesting:
make -C tools/osbuilder/node-builder/azure-linux USE_OPENVMM=yes USE_RUNTIME_RS=yes clean all deployNote: When passing
BUILD_TYPE=debugto the above make command (setting all 3enable_debug=trueconfigs), pod creation fails - debugging now.