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 authored and eriknordmark committed Dec 6, 2024
1 parent 958dd60 commit 33f5e45
Show file tree
Hide file tree
Showing 5 changed files with 810 additions and 88 deletions.
6 changes: 6 additions & 0 deletions pkg/pillar/hypervisor/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ 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 {
logrus.Errorf("Enforcing user-defined network interface order is not supported "+
"with the KubeVirt hypervisor. Ignoring EnforceNetworkInterfaceOrder flag "+
"for app %s", config.DisplayName)
}

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 33f5e45

Please sign in to comment.