Bug 2060485

Summary: virtualMachine with duplicate interfaces name causes MACs to be rejected by Kubemacpool
Product: Container Native Virtualization (CNV) Reporter: Ram Lavi <ralavi>
Component: NetworkingAssignee: Petr Horáček <phoracek>
Status: CLOSED ERRATA QA Contact: Ruth Netser <rnetser>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.10.0CC: cnv-qe-bugs
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: v4.11.0-156 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-14 19:28:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ram Lavi 2022-03-03 15:36:15 UTC
Description of problem:
When applying a VM with multiple interfaces with the same name, the VM is rejected but kubemacpool is mishandling the MACs, causing a side effect where that MAC is no longer usable (it is "taken" by the ghost VM).



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


How reproducible:


Steps to Reproduce:
1. deploy kubemacpool
2. apply a VM with multiple duplicate interface names. For example
3. try to apply a new VM with the MACs given to the rejected VM.

Actual results:


Expected results:


Additional info:

Comment 2 Adi Zavalkovsky 2022-04-04 08:58:21 UTC
Verified.
OCP 4.11.0-0.nightly-2022-04-01-172551.
CNV bundle - v4.11.0-187

Attempted to deploy a vm with duplicate ifaces:
---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: samplevm
spec:
  running: true
  template:
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            name: rootfs
          - disk:
              bus: virtio
            name: cloudinit
          interfaces:
          - name: default
            masquerade: {}
          - bridge: {}
            name: br1
          - bridge: {}
            name: br1
        resources:
          requests:
            memory: 64M
      networks:
      - name: default
        pod: {}
      - multus:
          networkName: br1
        name: br1
      - multus:
          networkName: br1
        name: br1
      volumes:
        - name: rootfs
          containerDisk:
            image: kubevirt/cirros-registry-disk-demo
        - name: cloudinit
          cloudInitNoCloud:
            userDataBase64: SGkuXG4=

Kubemacpool didn't allocate MAC addresses:

[adi@fedora kubeconf]$ oc apply -f ~/Gerrit/bugs/bz2060485 
networkattachmentdefinition.k8s.cni.cncf.io/br1 created
Error from server: error when creating "***/bz2060485": admission webhook "mutatevirtualmachines.kubemacpool.io" denied the request: Failed to create virtual machine allocation error: Failed to allocate mac to the vm object: Failed to mutate virtual machine: every interface must have a unique name

Comment 6 errata-xmlrpc 2022-09-14 19:28:43 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