Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1994467

Summary: Check for MAC address conflict before creating a target VM
Product: Migration Toolkit for Virtualization Reporter: Maayan Hadasi <mguetta>
Component: GeneralAssignee: Sam Lucidi <slucidi>
Status: CLOSED ERRATA QA Contact: Maayan Hadasi <mguetta>
Severity: high Docs Contact: Avital Pinnick <apinnick>
Priority: high    
Version: 2.1.0CC: apinnick, fbladilo, fdupont, istein, slucidi
Target Milestone: ---   
Target Release: 2.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-09 19:20:56 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 Maayan Hadasi 2021-08-17 10:44:53 UTC
Description of problem:
Cannot migrate VMware VM to a different target namespace once the VM was already migrated and created in another namespace

Migration plan failed with this error (in UI):
Error while creating virtual machine mguetta/v2v-migration-rhel8-2disks2nics: 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 allocate requested mac address


Version-Release number of selected component (if applicable):
mtv-operator-bundle-container-2.1.0-44


How reproducible:
100%


Steps to Reproduce:
1. Have 2 plans that include the same source VM but a different target namespace value
2. Start the plans one after the other


Actual results:
VM migration of one plan fails with the above error


Expected results:


Additional info:

Comment 1 Sam Lucidi 2021-10-13 19:28:40 UTC
This problem was caused by preserving the mac address of vSphere VMs in VMIO. In 2.2.0, MTV does not preserve mac addresses, so this problem should be resolved.

Comment 2 Fabien Dupont 2021-10-19 13:12:27 UTC
After discussing this issue, we concluded that the MAC address should be kept during the migration.
However, we should catch any potential MAC address conflict during the VM CR creation, by checking if another VM or pod exists with the same MAC address.

I've updated the BZ title accordingly. Moving back to ASSIGNED.

Comment 6 Maayan Hadasi 2021-11-16 15:48:33 UTC
Verified as fixed.

'Initialize migration' stage fails with an error:
"Source VM has a mac address conflict with one or more destination VMs: [openshift-mtv/mini-rhel7-mguetta]"

Versions:
MTV 2.2.0-84 / iib:133381
CNV 4.9.1-23 /iib: 133012

Comment 9 errata-xmlrpc 2021-12-09 19:20:56 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 (MTV 2.2.0 Images), 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/RHEA-2021:5066