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:
https://github.com/k8snetworkplumbingwg/kubemacpool/pull/358
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
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