Bug 1277967 - MAC address - Wrong MAC address appears in the warning message when importing VM with NICs that have MAC addresses in use
MAC address - Wrong MAC address appears in the warning message when importing...
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network (Show other bugs)
3.6.0
x86_64 Linux
low Severity medium (vote)
: ovirt-3.6.1
: 3.6.1.1
Assigned To: Martin Mucha
Michael Burman
network
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-04 07:42 EST by Michael Burman
Modified: 2016-02-10 14:17 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-22 08:29:20 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Network
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
danken: ovirt‑3.6.z?
mburman: planning_ack?
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)
screenshot (95.66 KB, image/png)
2015-11-04 07:42 EST, Michael Burman
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 47899 master MERGED core: 'revert' of 2f471d83d145d7bc6674c6039bf7f8d1ba9ed137 Never

  None (edit)
Description Michael Burman 2015-11-04 07:42:57 EST
Created attachment 1089669 [details]
screenshot

Description of problem:
MAC address - Wrong MAC address appears in the warning message when importing VM with NICs that has MAC addresses in use.

When importing VM with NICs from export domain, i will get a warning message about NICs that have MAC addresses in use and therefore it's being unplugged from VM.
"Network Interface nic1 has MAC address 00:00:00:00:00:4b which is in use, therefore it is being unplugged from VM yyyyy77"

But, the MAC address in the warning message is not the MAC address that is in use, it is the newly assigned MAC address for the vNIC from engine. 
Therefore this warning message is wrong and misleading.

Version-Release number of selected component (if applicable):
3.6.0.3-0.1.el6

How reproducible:
100

Steps to Reproduce:
1. Create new VM with 3 vNICs 
2. Export VM to export domain
3. Import VM 

Actual results:
Warning message is displayed while VM being imported.
"Network Interface nic1 has MAC address 00:00:00:00:00:4b which is in use, therefore it is being unplugged from VM yyyyy77"

00:00:00:00:00:4b is the new MAC address that the vNIC will get.
00:00:00:00:00:45 is the used one.

Expected results:
Warning message should display the right MAC address which is in use.
Comment 1 Martin Mucha 2015-11-06 08:12:01 EST
I do not understand this flow sufficiently — I'm not aware of fact, that when nic has duplicate mac address when plugging, the new one will be generated instead of it. Maybe it works like that, I just don't see it in code. Can you confirm it and maybe provide some details how this work?

But prior to doing that, can you reverify, that you used correct host? From provided screen shot it seems, that messages are related to host "yyyy77", while network interfaces tab relates to host "yyyy". Could this be the reason why nics has different macs than in warning message? (since it's different nics?).
Comment 2 Michael Burman 2015-11-08 01:04:56 EST
Hi Martin,

I think you are a bit confused here. 'yyyy' and 'yyyy77' are VMs and not servers.
My screen shot here i trying to show you the wrong MAC address in the warning message. 
'yyyy' is a VM that was exported to export domain with 3 MAC addresses:
00:00:00:00:00:45 
00:00:00:00:00:46
00:00:00:00:00:47 

'yyyy7' and 'yyyy77' are both VMs that were imported from export domain based on VM 'yyyy' ^^ 
In the warning message you expect to see that :
"Network Interface nic1 has MAC address 00:00:00:00:00:45 which is in use, therefore it is being unplugged from VM yyyyy77"
"Network Interface nic2 has MAC address 00:00:00:00:00:46 which is in use, therefore it is being unplugged from VM yyyyy77"
"Network Interface nic1 has MAC address 00:00:00:00:00:47 which is in use, therefore it is being unplugged from VM yyyyy77"
Cause they are the used MAC addresses by VM 'yyyy', but instead of that, the MAC addresses in the warning message are the ones the engine assign to the newly imported VMs.
And this is why the warning message is wrong..

And yes, that is the behavior when importing VMs from export domain that have NICs. This is the warning message that you will get, and the NICs are being unplugged and will get new MACs from the range.
Comment 3 Martin Mucha 2015-11-09 07:25:39 EST
to me it seems as a different bug; this message should not be presented at all, since new mac was assigned, thus there cannot be duplicity. If, on the other hand, we're not assigning new mac, and using existing, we will endup with "mac used" or duplicate mac in pool, which is suprisingly not dependant on pool setting. It seems to me, that error was introduced here: 2f471d83d145d7bc6674c6039bf7f8d1ba9ed137
I'll try to discuss it to be sure about it and fix it if it's this cause.



Some more detail:
looking at the code, I cannot see such thing. Maybe there's some logic in UI I did not saw, but talking about backend only now, it's more controlled via 'importAsNewEntity' flag in ImportVmParameters. 

1. ImportVmParameters#importAsNewEntity = true —> new MAC addresses are assigned and stored no matter what. And due to flow, regardless they were unused before call, and were just assigned for the first time, there's complaint, that they're used and thus because of that, we have to unplug nic. This seems as a bug.

2. ImportVmParameters#importAsNewEntity = false —> MAC addresses of NICs from imported vm are preserved. Depending on hotplug support:

FeatureSupported.hotPlug(clusterCompatibilityVersion) && getOsRepository().hasNicHotplugSupport(osId, clusterCompatibilityVersion)

2.1 are these MACs added into pool regardless of whether they are there or not, resp.
2.2 are these MACs addes into pool only if they aren't there yet and MAC_ADDRESS_IS_IN_USE is generated otherwise.
Comment 4 Red Hat Bugzilla Rules Engine 2015-12-03 08:21:58 EST
Bug tickets that are moved to testing must have target release set to make sure tester knows what to test. Please set the correct target release before moving to ON_QA.
Comment 5 Michael Burman 2015-12-09 05:07:06 EST
Hi Dan , Martin

Is the fix for this bug is that the error message won't be displayed/presented any more when importing the VM from export domain ?
Comment 6 Dan Kenigsberg 2015-12-16 07:42:35 EST
If there is no problem importing VMs (a fresh mac address is allocated per vnic, and not duplication exist) we should be happy and mark the bug as verified.
Comment 7 Michael Burman 2015-12-17 02:27:14 EST
VM imported with new/fresh MAC addresses for the vNICs and they are plugged.
Warning message isn't appears any more.

Verified on - 3.6.1.3-0.1.el6
Comment 8 Sandro Bonazzola 2015-12-22 08:29:20 EST
oVirt 3.6.1 has been released and bz verified, moving to closed current release

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