Hello everyone,
I'm currently struggling with MACVTAP feature on a RKE2 cluster
I followed all the steps in the doc in order to use macvtap binding but when I launch the VM, the virt-launcher is crashing and here is the logs:
{"component":"virt-launcher","level":"error","msg":"failed to get a link for interface: ","pos":"generators.go:83","reason":"Link not found","timestamp":"2024-09-20T15:48:12.708583Z"}
{"component":"virt-launcher","level":"fatal","msg":"failed to create libvirt configuration","pos":"podnic.go:95","reason":"Link not found","timestamp":"2024-09-20T15:48:12.708598Z"}
panic: failed to create libvirt configuration
goroutine 70 [running]:
kubevirt.io/client-go/log.FilteredLogger.Critical({{0x21147a0, 0xc000475f20}, {0x1e15e5e, 0xd}, 0x0, 0x0, 0x2, 0x2, {0x2116b20, 0xc0004ff9c0}}, ...)
staging/src/
kubevirt.io/client-go/log/log.go:342 +0x18c
kubevirt.io/kubevirt/pkg/network/setup.(*podNIC).PlugPhase2(0xc0006582d0, 0x2?)
pkg/network/setup/podnic.go:95 +0xfd
kubevirt.io/kubevirt/pkg/network/setup.(*VMNetworkConfigurator).SetupPodNetworkPhase2(0xc0002aa008?, 0xc000399088, {0xc000387c40?, 0xc0006e8cf8?, 0x1?})
pkg/network/setup/network.go:88 +0x145
kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap.(*LibvirtDomainManager).preStartHook(0xc0001ee1c0, 0xc0002aa008, 0xc000399088, 0x0, 0xc000572480)
pkg/virt-launcher/virtwrap/manager.go:779 +0xdf7
kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap.(*LibvirtDomainManager).lookupOrCreateVirDomain(0xc0001ee1c0, 0xc000399088, 0xc0002aa008, 0xc000572480)
pkg/virt-launcher/virtwrap/manager.go:1275 +0x1cd
kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap.(*LibvirtDomainManager).SyncVMI(0xc0001ee1c0, 0xc0002aa008, 0x0, 0xc000572480)
pkg/virt-launcher/virtwrap/manager.go:1090 +0x65f
kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/cmd-server.(*Launcher).SyncVirtualMachine(0xc000012120, {0x1d8cc20?, 0xc0000aeab8?}, 0xc00056e280)
pkg/virt-launcher/virtwrap/cmd-server/server.go:201 +0x82
kubevirt.io/kubevirt/pkg/handler-launcher-com/cmd/v1._Cmd_SyncVirtualMachine_Handler({0x1d8cc20, 0xc000012120}, {0x2132a70, 0xc0005488d0}, 0xc000530380, 0x0)
bazel-out/k8-fastbuild/bin/pkg/handler-launcher-com/cmd/v1/v1_go_proto_/
kubevirt.io/kubevirt/pkg/handler-launcher-com/cmd/v1/cmd.pb.go:3281 +0x1a9
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000228000, {0x213b6a0, 0xc0002ce4e0}, 0xc000464480, 0xc000114f00, 0x31727e0, 0x0)
external/org_golang_google_grpc/server.go:1318 +0xaea
google.golang.org/grpc.(*Server).handleStream(0xc000228000, {0x213b6a0, 0xc0002ce4e0}, 0xc000464480, 0x0)
external/org_golang_google_grpc/server.go:1659 +0x9da
google.golang.org/grpc.(*Server).serveStreams.func1.2() external/org_golang_google_grpc/server.go:955 +0x8d
created by
google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 100
external/org_golang_google_grpc/server.go:953 +0x226
{"component":"virt-launcher-monitor","level":"info","msg":"Reaped pid 12 with status 512","pos":"virt-launcher-monitor.go:198","timestamp":"2024-09-20T15:48:12.712608Z"}
Here the VM:
apiVersion:
kubevirt.io/v1kind: VirtualMachine
metadata:
name: tiny11
namespace: kubevirt
spec:
running: false
template:
metadata:
labels:
kubevirt.io/domain: tiny11
spec:
domain:
cpu:
cores: 4
devices:
interfaces:
- name: pod
masquerade: {}
- name: wan
binding:
name: macvtap
disks:
- bootOrder: 1
cdrom:
bus: sata
name: cdromiso
- bootOrder: 2
disk:
bus: virtio
name: harddrive
- bootOrder: 3
cdrom:
bus: sata
name: virtiocontainerdisk
machine:
type: q35
resources:
requests:
memory: 8G
networks:
- name: pod
pod: {} # Pod To Pod network
- name: wan
multus: # Secondary multus network
networkName: macvtapnetwork
volumes:
- name: cdromiso
persistentVolumeClaim:
claimName: tiny11-iso-pvc
- name: harddrive
persistentVolumeClaim:
claimName: tiny11-disk-pvc
- containerDisk:
image:
quay.io/kubevirt/virtio-container-disk name: virtiocontainerdisk
and here the macvlan pods logs:
Container: macvtap-cni
Connected
I0920 14:33:00.763596 148344 manager.go:42] Starting device plugin manager
I0920 14:33:00.763644 148344 manager.go:46] Registering for system signal notifications
I0920 14:33:00.763846 148344 manager.go:52] Registering for notifications of filesystem changes in device plugin directory
I0920 14:33:00.764301 148344 manager.go:60] Starting Discovery on new plugins
I0920 14:33:00.764311 148344 manager.go:66] Handling incoming signals
I0920 14:33:00.764383 148344 lister.go:67] Read configuration map[]
I0920 14:33:00.766072 148344 manager.go:71] Received new list of plugins: [ens3 ens4 ens5 ens6]
I0920 14:33:00.766106 148344 manager.go:110] Adding a new plugin "ens6"
I0920 14:33:00.766139 148344 manager.go:110] Adding a new plugin "ens4"
I0920 14:33:00.766126 148344 lister.go:167] Creating device plugin with config {Name:ens6 LowerDevice:ens6 Mode:bridge Capacity:100}
I0920 14:33:00.766157 148344 plugin.go:64] ens6: Starting plugin server
I0920 14:33:00.766161 148344 plugin.go:94] ens6: Starting the DPI gRPC server
I0920 14:33:00.766154 148344 lister.go:167] Creating device plugin with config {Name:ens4 LowerDevice:ens4 Mode:bridge Capacity:100}
I0920 14:33:00.766183 148344 plugin.go:64] ens4: Starting plugin server
I0920 14:33:00.766189 148344 plugin.go:94] ens4: Starting the DPI gRPC server
I0920 14:33:00.766230 148344 manager.go:110] Adding a new plugin "ens5"
I0920 14:33:00.766247 148344 manager.go:110] Adding a new plugin "ens3"
I0920 14:33:00.766261 148344 lister.go:167] Creating device plugin with config {Name:ens5 LowerDevice:ens5 Mode:bridge Capacity:100}
I0920 14:33:00.766277 148344 plugin.go:64] ens5: Starting plugin server
I0920 14:33:00.766279 148344 plugin.go:94] ens5: Starting the DPI gRPC server
I0920 14:33:00.766267 148344 lister.go:167] Creating device plugin with config {Name:ens3 LowerDevice:ens3 Mode:bridge Capacity:100}
I0920 14:33:00.766285 148344 plugin.go:64] ens3: Starting plugin server
I0920 14:33:00.766288 148344 plugin.go:94] ens3: Starting the DPI gRPC server
I0920 14:33:00.766409 148344 plugin.go:112] ens6: Serving requests...
I0920 14:33:00.766411 148344 plugin.go:112] ens3: Serving requests...
I0920 14:33:00.766494 148344 plugin.go:112] ens5: Serving requests...
I0920 14:33:00.766494 148344 plugin.go:112] ens4: Serving requests...
I0920 14:33:10.767876 148344 plugin.go:128] ens6: Registering the DPI with Kubelet
I0920 14:33:10.767916 148344 plugin.go:128] ens4: Registering the DPI with Kubelet
I0920 14:33:10.767947 148344 plugin.go:128] ens5: Registering the DPI with Kubelet
I0920 14:33:10.767936 148344 plugin.go:128] ens3: Registering the DPI with Kubelet
I0920 14:33:10.768245 148344 plugin.go:140] ens6: Registration for endpoint macvtap.network.kubevirt.io_ens6
I0920 14:33:10.768273 148344 plugin.go:140] ens4: Registration for endpoint macvtap.network.kubevirt.io_ens4
I0920 14:33:10.768276 148344 plugin.go:140] ens3: Registration for endpoint macvtap.network.kubevirt.io_ens3
I0920 14:33:10.768302 148344 plugin.go:140] ens5: Registration for endpoint macvtap.network.kubevirt.io_ens5
I0920 14:33:10.771414 148344 manager.go:71] Received new list of plugins: [ens3 ens4 ens5 ens6]
I0920 14:33:10.772405 148344 plugin.go:72] LowerDevice exists, sending ListAndWatch response with available devices
I0920 14:33:10.772446 148344 plugin.go:72] LowerDevice exists, sending ListAndWatch response with available devices
I0920 14:33:10.772398 148344 plugin.go:72] LowerDevice exists, sending ListAndWatch response with available devices
I0920 14:33:10.772535 148344 plugin.go:72] LowerDevice exists, sending ListAndWatch response with available devices
Any idea ?
Thanks for your help ! :)