Bug 1497614 - RESTAPI- PUT request to update DC from 4.0->4.1 fails with REST response 'Cannot migrate MACs to another MAC pool, because that action would create duplicates in target MAC pool, which are not allowed. Problematic MACs are 00:1a:4a:16:25:b2'
Summary: RESTAPI- PUT request to update DC from 4.0->4.1 fails with REST response 'Can...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network
Version: 4.1.7.1
Hardware: Unspecified
OS: Unspecified
medium
urgent
Target Milestone: ovirt-4.1.7
: 4.1.7.3
Assignee: Martin Mucha
QA Contact: Avihai
URL:
Whiteboard:
Depends On: 1480238
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-02 07:56 UTC by Lukas Svaty
Modified: 2019-04-28 13:56 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: invalid equality comparison in code caused, that updating dc/cluster 'thought' that their macpools are different although they were not. That caused migrating macs from A to A, which failed. Consequence: inability to update dc/cluster. Fix: fixed equality comparison
Clone Of: 1480238
Environment:
Last Closed: 2017-11-13 12:27:36 UTC
oVirt Team: Network
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: ovirt-4.2+
rule-engine: blocker+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 80539 0 None None None 2017-10-02 07:56:52 UTC
oVirt gerrit 82513 0 ovirt-engine-4.1 MERGED core: invalid equality comparison 2017-10-03 12:25:29 UTC

Description Lukas Svaty 2017-10-02 07:56:52 UTC
+++ This bug was initially created as a clone of Bug #1480238 +++

Description of problem:
Update DC from 4.0->4.1 fails ONLY with RESTAPI - Manually upgrading DC works.

REST response is:
'Cannot migrate MACs to another MAC pool, because that action would create duplicates in target MAC pool, which are not allowed. Problematic MACs are 	00:1a:4a:16:25:b2'

00:1a:4a:16:25:b2 is the MAC of the VM that is created on the new 4.0 DC/cluster

Many of my automated runs on storage_qcow2_v3 TP has the similar flow that fails when upgrading DC to 4.1 , so this is an automation blocker for me.

Version-Release number of selected component (if applicable):
Engine - > 4.2.0-0.0.master.20170809175855.git1082d9d.el7.centos
VDSM   -> 4.20.2-50.gitb718903

How reproducible:
100%

Steps to Reproduce:

Done Manually/RESTAPI:
1) Create 4.0 DC + cluster with a matching host
2) Create VM with NIC + a thin disk (1G)+ snapshot.
3) Upgrade cluster to 4.1 

Done ONLY VIA RESTAPI:
4) upgrade DC to 4.1 

Actual results:
REST request:
2017-08-10 15:34:17,016 - MainThread - datacenters - DEBUG - PUT request

url:/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c 

body:

<data_center>
    <version>
        <major>4</major>
        <minor>1</minor>
    </version>
</data_center>

Response is :
Cannot migrate MACs to another MAC pool, because that action would create duplicates in target MAC pool, which are not allowed. Problematic MACs are 	00:1a:4a:16:25:b2

This problematic MAC is the newly created VM MAC. (00:1a:4a:16:25:b2)


Expected results:
Upgrade succeeds.

Additional info:

Engine:
2017-08-10 15:34:17,132+03 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-5) [] Operation Failed: [Cannot migrate MACs to another MAC pool, because that action would create duplicates in target MAC pool, which are not allowed. Problematic MACs are 	00:1a:4a:16:25:b2]

REST REQUEST:
2017-08-10 15:34:17,016 - MainThread - datacenters - DEBUG - PUT request content is --  

url:/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c 


body:

<data_center>
    <version>
        <major>4</major>
        <minor>1</minor>
    </version>
</data_center>


REST RESPONSE:
2017-08-10 15:34:17,138 - MainThread - api_utils - ERROR - Failed to update element NOT as expected:
	Status: 409
	Reason: Conflict
	Detail: [Cannot migrate MACs to another MAC pool, because that action would create duplicates in target MAC pool, which are not allowed. Problematic MACs are 	00:1a:4a:16:25:b2]




-REST GET DC before Upgrade the get to the going to be upgraded DC  :

2017-08-10 15:34:17,013 - MainThread - datacenters - DEBUG - Response body for GET request is: 
<data_centers>
    <data_center href="/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c" id="ad59c7c8-05a6-4290-ad71-3b6103b1207c">
        <name>dc_upgrade_4_0_to_4_1</name>
        <link href="/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c/clusters" rel="clusters"/>
        <link href="/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c/networks" rel="networks"/>
        <link href="/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c/storagedomains" rel="storagedomains"/>
        <link href="/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c/permissions" rel="permissions"/>
        <link href="/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c/quotas" rel="quotas"/>
        <link href="/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c/qoss" rel="qoss"/>
        <link href="/ovirt-engine/api/datacenters/ad59c7c8-05a6-4290-ad71-3b6103b1207c/iscsibonds" rel="iscsibonds"/>
        <local>false</local>
        <quota_mode>disabled</quota_mode>
        <status>up</status>
        <storage_format>v3</storage_format>
        <supported_versions>
            <version>
                <major>4</major>
                <minor>1</minor>
            </version>
            <version>
                <major>4</major>
                <minor>0</minor>
            </version>
        </supported_versions>
        <version>
            <major>4</major>
            <minor>0</minor>
        </version>
        <mac_pool href="/ovirt-engine/api/macpools/58ca604b-017d-0374-0220-00000000014e" id="58ca604b-017d-0374-0220-00000000014e"/>

--- Additional comment from Dan Kenigsberg on 2017-08-10 10:07:08 EDT ---

Could you please check if you see the same bug in recent 4.1 builds?

--- Additional comment from Avihai on 2017-08-13 03:58:47 EDT ---

Hi Dan , Issue does not occur on latest 4.1 . 

Tested on ovirt-engine-4.1.5.2-0.1.el7.noarch

--- Additional comment from Martin Mucha on 2017-08-13 05:30:20 EDT ---

just to give some specific info:

error got into master: Aug 9 2:39 PM
error was fixed in master: Aug 13 11:10 AM

So it was (luckily) very short period of time, thanks to the reporter(s) of this bug.

--- Additional comment from Avihai on 2017-08-13 07:44:13 EDT ---

Verified at 4.2.0-0.0.master.20170811144920.gita423008.el7.centos

--- Additional comment from Avihai on 2017-08-13 10:41:53 EDT ---

My bad , running automation again I still see the same issue in latest master.
It appears I did not add a VM when I verified this issue so the upgrade worked.

The Same setup (as above) is your's for further debug.

please ping me when done.

Engine log:
2017-08-13 17:18:14,409+03 INFO  [org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand] (default task-8) [5a71d545] Running command: CreateUserSessionCommand internal: false.
2017-08-13 17:18:14,471+03 WARN  [org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommand] (default task-8) [cca7ce5f-8055-469b-b877-1b27402b5da2] Validation of action 'UpdateStoragePool' failed for user
 admin@internal-authz. Reasons: VAR__TYPE__STORAGE__POOL,VAR__ACTION__UPDATE,ACTION_TYPE_FAILED_CANNOT_MIGRATE_MACS_DUE_TO_DUPLICATES,$ACTION_TYPE_FAILED_CANNOT_MIGRATE_MACS_DUE_TO_DUPLICATES_LIST         00:1a:
4a:16:25:ad,$ACTION_TYPE_FAILED_CANNOT_MIGRATE_MACS_DUE_TO_DUPLICATES_LIST_COUNTER 1
2017-08-13 17:18:14,481+03 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-8) [] Operation Failed: [Cannot migrate MACs to another MAC pool, because that action would create d
uplicates in target MAC pool, which are not allowed. Problematic MACs are    00:1a:4a:16:25:ad]

--- Additional comment from Avihai on 2017-08-13 10:44:10 EDT ---

DC name = dc1
ID = 80ef202f-2454-483d-a1f0-beedb57e21c7

See print screen of the issue with postman app .

--- Additional comment from Avihai on 2017-08-13 10:45 EDT ---



--- Additional comment from Avihai on 2017-08-13 12:30:48 EDT ---

build was wrong , waiting for fixed build.

--- Additional comment from Avihai on 2017-08-14 10:50:01 EDT ---

verified on 4.2.0-0.0.master.20170813134654.gitaee967b.el7.centos

--- Additional comment from Martin Mucha on 2017-08-15 12:04:24 EDT ---

Comment 1 Red Hat Bugzilla Rules Engine 2017-10-02 07:57:02 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 2 Sandro Bonazzola 2017-10-11 11:12:29 UTC
Should be in oVirt 4.1.7 RC3

Comment 3 Avihai 2017-10-17 08:57:22 UTC
verified on ovirt-engine-4.1.7.3-0.1.el7.noarch


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