Bug 2168749 - Rename of Network Interface duplicates it, breaks VM start
Summary: Rename of Network Interface duplicates it, breaks VM start
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 4.12.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.14.0
Assignee: Ugo Palatucci
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks: 2182006
TreeView+ depends on / blocked
 
Reported: 2023-02-10 00:09 UTC by Germano Veit Michel
Modified: 2023-11-08 14:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2182006 (view as bug list)
Environment:
Last Closed: 2023-11-08 14:05:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
admission webhook error on UI (159.89 KB, image/png)
2023-02-10 03:34 UTC, Guohua Ouyang
no flags Details
rename nic with VM is down (148.85 KB, image/png)
2023-02-10 03:49 UTC, Guohua Ouyang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt-ui kubevirt-plugin pull 1185 0 None open Bug 2168749: disable network renaming on already created vm 2023-03-23 10:52:03 UTC
Red Hat Issue Tracker CNV-25332 0 None None None 2023-02-10 00:11:20 UTC
Red Hat Product Errata RHSA-2023:6817 0 None None None 2023-11-08 14:05:33 UTC

Description Germano Veit Michel 2023-02-10 00:09:25 UTC
Description of problem:

Renaming a NIC causes a new one to be created and the old one is not deleted, so the VM gets an extra NIC.

Version-Release number of selected component (if applicable):
4.12.2

How reproducible:
Always

Steps to Reproduce:
1. Go to Virtualization -> Virtual Machines -> VM XYZ -> Network Interfaces
2. Pick a NIC from the list and click Edit
3. Write a new name at the top and click Save.

Actual results:
* A new NIC is created with the new name
* VM may fail to start because of duplicate MAC

Expected results:
* No duplicate NIC, single existing NIC with new name.

Additional info:
* VM may fail to start because of duplicate MAC due to duplicate NIC.

admission webhook "mutatevirtualmachines.kubemacpool.io" denied the request: Failed to update virtual machine allocation error: failed to allocate requested mac address

Comment 1 Guohua Ouyang 2023-02-10 03:34:31 UTC
Created attachment 1943205 [details]
admission webhook error on UI

I could see the error is displaying on UI while rename the Nic Name on CNV 4.12.1-25:
admission webhook "mutatevirtualmachines.kubemacpool.io" denied the request: Failed to update virtual machine allocation error: failed to allocate requested mac address

Comment 2 Germano Veit Michel 2023-02-10 03:40:09 UTC
(In reply to Guohua Ouyang from comment #1)
> Created attachment 1943205 [details]
> admission webhook error on UI
> 
> I could see the error is displaying on UI while rename the Nic Name on CNV
> 4.12.1-25:
> admission webhook "mutatevirtualmachines.kubemacpool.io" denied the request:
> Failed to update virtual machine allocation error: failed to allocate
> requested mac address

Yup. And I see your VM is running in the screenshot. If you do with the VM down then it does not try to allocate mac and you will get the duplicate NIC.

But later VM will fail to start, with same mac address error.

Comment 3 Guohua Ouyang 2023-02-10 03:49:34 UTC
Created attachment 1943207 [details]
rename nic with VM is down

Could still see the admission webhook error denied the request while VM is down.

Comment 4 Germano Veit Michel 2023-02-10 03:58:48 UTC
(In reply to Guohua Ouyang from comment #3)
> Created attachment 1943207 [details]
> rename nic with VM is down
> 
> Could still see the admission webhook error denied the request while VM is
> down.

My bad. Do it in the VM customisation dialog, while creating the VM. There it will go duplicate, but the problem is the same.

Comment 5 Germano Veit Michel 2023-02-10 04:02:57 UTC
Also same problem when trying to rename the Pod NIC on VM customisation. It will try to create duplicate and then fail as only 1 Pod network is allowed.

Comment 6 Guohua Ouyang 2023-02-10 04:18:50 UTC
I could reproduce the issue while creating the VM via customize mode, the problem is editing a NIC is not saved to the original NIC but created a new NIC. It looks #2158063 and this bug are caused by the this problem.

Comment 7 Germano Veit Michel 2023-02-10 04:32:19 UTC
Exactly, it seems to try to create a new NIC, triggering all these problems.

Thanks

Comment 8 Germano Veit Michel 2023-02-10 04:57:23 UTC
(In reply to Guohua Ouyang from comment #6)
> It looks #2158063 and this bug are caused by the this problem.

Actually I did some more testing and I think they are different. Because the error on that bug is the error when 2 POD network NICs are attached, but there the Edit changes the 2nd NIC to Bridge. If the edit was just doing a copy/duplicate and changing to Bridge it would not hit that error, because the original NIC would be Pod Net and the copy would be Bridge.

The maintainers will know better.

Comment 9 Ugo Palatucci 2023-03-20 08:57:41 UTC
@gouyang we've completely refactored the network interface modal.

I can't reproduce this issue and i think we resolved that with the refactor

Comment 10 Guohua Ouyang 2023-03-20 09:27:33 UTC
(In reply to Ugo Palatucci from comment #9)
> @gouyang we've completely refactored the network interface modal.
> 
> I can't reproduce this issue and i think we resolved that with the refactor

Could not reproduce on 4.13 too.

Comment 11 Guohua Ouyang 2023-03-20 09:29:57 UTC
While renaming the nic will see the error from backend, but it's not the UI issue and I guess it's not supported by the backend.
admission webhook "mutatevirtualmachines.kubemacpool.io" denied the request: Failed to update virtual machine allocation error: failed to allocate requested mac address

@Germano, wdyt?

Comment 12 Germano Veit Michel 2023-03-20 22:08:38 UTC
(In reply to Guohua Ouyang from comment #11)
> While renaming the nic will see the error from backend, but it's not the UI
> issue and I guess it's not supported by the backend.
> admission webhook "mutatevirtualmachines.kubemacpool.io" denied the request:
> Failed to update virtual machine allocation error: failed to allocate
> requested mac address
> 
> @Germano, wdyt?

Is this on editing an already created VM, or in the VM customization dialog?

Both were sort of broken...

Also, for best user experience, I think:
* If it cannot be renamed for already created NIC/VM, then don't let the user try to rename it in the UI.
* But in customization dialog, it should allow to rename it, the VM is not created yet.

What you you think?

Comment 13 Guohua Ouyang 2023-03-21 01:41:33 UTC
(In reply to Germano Veit Michel from comment #12)
> (In reply to Guohua Ouyang from comment #11)

> 
> Is this on editing an already created VM, or in the VM customization dialog?
> 
> Both were sort of broken...
> 
> Also, for best user experience, I think:
> * If it cannot be renamed for already created NIC/VM, then don't let the
> user try to rename it in the UI.

Ugo, do you like to disable the name field while editing the existing Nic?

> * But in customization dialog, it should allow to rename it, the VM is not
> created yet.

Checked on 4.13, it allow to rename the nic name in customization dialog.

> 
> What you you think?

Comment 14 Ugo Palatucci 2023-03-22 12:05:56 UTC
Yes we can do that

Comment 15 Guohua Ouyang 2023-03-28 23:21:12 UTC
verified on upstream latest

Comment 18 errata-xmlrpc 2023-11-08 14:05:04 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.14.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-2023:6817


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