Skip to content

Commit

Permalink
Add support for user-defined network interface order to domainmgr/kvm
Browse files Browse the repository at this point in the history
Currently, when application has both virtual network interfaces
configured and some network devices directly assigned, EVE will first
attach virtual interfaces in the order that follows ACL IDs (a historical
workaround for missing interface order field), followed by directly assigned
network adapters, in the order of the AppInstanceConfig.adapters list.

To allow the user to specify the order between all application
network interfaces (across both virtual and passthrough devices), we
introduced a new boolean flag EnforceNetworkInterfaceOrder inside
the application instance config and allow the controller to pass the order
requirements for all the application network adapters.

For the KVM hypervisor, and depending on the application’s operating system,
we can influence the interface order through the PCI topology. A network
device that should appear earlier in the interface list is assigned a lower
PCI address. This ensures the desired network interface order, at least for
Linux-based operating systems with systemd (see [1]). However, there are
limitations when assigning multifunction PCI devices to applications.
Specifically, the functions of a multifunction device cannot be interleaved
with other virtual or passthrough devices. If the user configures a network
interface order that violates this constraint, EVE will report an error for
the application, and it will not be started.

[1] https://www.freedesktop.org/software/systemd/man/latest/systemd.net-naming-scheme.html

Signed-off-by: Milan Lenco <milan@zededa.com>
  • Loading branch information
milan-zededa committed Dec 3, 2024
1 parent c82f1d2 commit ff55661
Show file tree
Hide file tree
Showing 5 changed files with 531 additions and 81 deletions.
5 changes: 5 additions & 0 deletions pkg/pillar/hypervisor/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ func (ctx kubevirtContext) Setup(status types.DomainStatus, config types.DomainC

logrus.Debugf("Setup called for Domain: %s, vmmode %v", domainName, config.VirtualizationMode)

if config.EnforceNetworkInterfaceOrder {
return logError("enforcing user-defined network interface order is not supported " +
"with the KubeVirt hypervisor")
}

if config.VirtualizationMode == types.NOHYPER {
if err := ctx.CreatePodConfig(domainName, config, status, diskStatusList, aa, file); err != nil {
return logError("failed to build kube pod config: %v", err)
Expand Down
Loading

0 comments on commit ff55661

Please sign in to comment.