Bug 2061208 - Cannot delete network Interface if VM has multiqueue for networking enabled.
Summary: Cannot delete network Interface if VM has multiqueue for networking enabled.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Networking
Version: 4.9.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.11.0
Assignee: oshoval
QA Contact: awax
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-06 22:29 UTC by Germano Veit Michel
Modified: 2023-11-13 08:14 UTC (History)
3 users (show)

Fixed In Version: virt-controller v4.11.0-75
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-14 19:29:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 7432 0 None open multiqueue: Accept specs with MQ, and without interfaces at all 2022-03-23 14:49:44 UTC
Github kubevirt kubevirt pull 7684 0 None open [release-0.53] multiqueue: Accept specs with MQ, and without explicit interfaces 2022-05-05 11:29:35 UTC
Red Hat Issue Tracker CNV-16756 0 None None None 2023-11-13 08:14:32 UTC
Red Hat Product Errata RHSA-2022:6526 0 None None None 2022-09-14 19:29:25 UTC

Description Germano Veit Michel 2022-03-06 22:29:00 UTC
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

Comment 1 Petr Horáček 2022-03-10 13:57:37 UTC
Thanks for reporting this and the detailed reproducer. We will triage this issue next week on our bug scrub.

Comment 2 oshoval 2022-03-23 11:33:42 UTC
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

Comment 3 oshoval 2022-03-23 14:49:45 UTC
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.

Comment 4 Petr Horáček 2022-05-03 13:42:11 UTC
This was merged U/S. We are now waiting for it to get to M/S.

Comment 5 Petr Horáček 2022-05-05 11:29:35 UTC
Requires a backport https://github.com/kubevirt/kubevirt/pull/7684

Comment 9 errata-xmlrpc 2022-09-14 19:29:09 UTC
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


Note You need to log in before you can comment on or make changes to this bug.