Description of problem: Validation fails when trying to delete the last network interface of a VM and multiqueue is enabled. 1. For example, create a VM from the rhel8 template, it comes up with this: interfaces: - macAddress: '02:aa:c2:00:00:00' masquerade: {} name: default networkInterfaceMultiqueue: true 2. Console -> Workloads -> Virtual Machines -> RHEL8 -> Network Interfaces -> NIC -> Delete Error "virtio-net multiqueue request, but there are no virtio interfaces defined" for field "spec.template.spec.domain.devices.networkInterfaceMultiqueue". 3. Edit the yaml, removing just the interface from the list, but keeping 'networkInterfaceMultiqueue', same: Error "virtio-net multiqueue request, but there are no virtio interfaces defined" for field "spec.template.spec.domain.devices.networkInterfaceMultiqueue". 4. Edit the yaml, remove 'networkInterfaceMultiqueue' and save. Now the user can delete the NIC via web console and also editing yaml manually. Number of queues is per interface, if there are no interfaces just don't set the number of queues when passing the XML to libvirt, no need to make the user disable this just to manage interfaces (i.e. removing all pod interfaces and changing to multus bridge), then have to enable again at the end. Version-Release number of selected component (if applicable): 4.9.3 How reproducible: Always Actual results: * Cannot remove a network interface from a VM just created from builtin template. Expected results: * User able to remove network interface without editing yaml and figuring out errors
Thanks for reporting this and the detailed reproducer. We will triage this issue next week on our bug scrub.
Thanks for the report. If a user tries to remove all the interfaces from a stopped VM with enabled MQ, he will fail because at least one virtio interface should exist (but the admitter validating webhook). Since kubevirt automatically adds virtio interface if no interfaces exist, we are safe to allow also this case. WIP - https://github.com/kubevirt/kubevirt/pull/7432
Rephrasing https://bugzilla.redhat.com/show_bug.cgi?id=2061208#c2 Currently, for a stopped VM with MQ enabled, a user that will try to remove all the interfaces, will fail due to "virtio-net multiqueue request, but there are no virtio interfaces defined". The reason is that when MQ is enabled, at least one virtio interface must exist. Since kubevirt implicitly adds a virtio bridge interface if no interfaces exist at all in the spec, it is safe to remove all the interfaces even when MQ is enabled. In this case, we can allow removal of all the interfaces due to the reasons above, so this is the change we suggest. There is no need to change the XML, it is a stopped VM. Moreover we should always make sure we keep the completeness of the validation, both for VM and VMI. Which means that we don't save unrunnable configurations. Note that, for example, if all the interfaces but one is removed, and this one is a non virtio interface, it will still be blocked. Because otherwise it will break the completeness of the validation, because no virtio interface would be added implicitly.
This was merged U/S. We are now waiting for it to get to M/S.
Requires a backport https://github.com/kubevirt/kubevirt/pull/7684
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Virtualization 4.11.0 Images security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:6526