Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-27448

[2182006] Rename of Network Interface duplicates it, breaks VM start

XMLWordPrintable

    • Moderate
    • None

      +++ This bug was initially created as a clone of Bug #2168749 +++

      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

      — Additional comment from Guohua Ouyang on 2023-02-10 03:34:31 UTC —

      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

      — Additional comment from Germano Veit Michel on 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.

      — Additional comment from Guohua Ouyang on 2023-02-10 03:49:34 UTC —

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

      — Additional comment from Germano Veit Michel on 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.

      — Additional comment from Germano Veit Michel on 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.

      — Additional comment from Guohua Ouyang on 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.

      — Additional comment from Germano Veit Michel on 2023-02-10 04:32:19 UTC —

      Exactly, it seems to try to create a new NIC, triggering all these problems.

      Thanks

      — Additional comment from Germano Veit Michel on 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.

      — Additional comment from Ugo Palatucci on 2023-03-20 08:57:41 UTC —

      @gouyang@redhat.com we've completely refactored the network interface modal.

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

      — Additional comment from Guohua Ouyang on 2023-03-20 09:27:33 UTC —

      (In reply to Ugo Palatucci from comment #9)
      > @gouyang@redhat.com 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.

      — Additional comment from Guohua Ouyang on 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?

      — Additional comment from Germano Veit Michel on 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?

      — Additional comment from Guohua Ouyang on 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?

      — Additional comment from Ugo Palatucci on 2023-03-22 12:05:56 UTC —

      Yes we can do that

              upalatuc@redhat.com Ugo Palatucci
              upalatuc@redhat.com Ugo Palatucci
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: