Bug 1421434 - [REST-API] <mac_pool href= is missing under /api/datacenters/
Summary: [REST-API] <mac_pool href= is missing under /api/datacenters/
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network
Version: 4.1.0.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.1.2
: 4.1.2
Assignee: Yevgeny Zaspitsky
QA Contact: Meni Yakove
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-12 10:26 UTC by Meni Yakove
Modified: 2017-05-23 08:12 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-23 08:12:51 UTC
oVirt Team: Network
rule-engine: ovirt-4.1+
ylavi: blocker-
ylavi: exception+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 73161 0 master MERGED engine: populate macPoolId on DC in queries 2017-03-01 17:09:08 UTC
oVirt gerrit 73402 0 ovirt-engine-4.1 MERGED engine: populate macPoolId on DC in queries 2017-03-14 09:28:00 UTC

Description Meni Yakove 2017-02-12 10:26:16 UTC
Description of problem:
<mac_pool href= is missing under /api/datacenters/

In 4.1 API V3 <mac_pool href> is missing from /api/datacenters/

The <mac_pool href> is available when accessing specific dc /api/datacenters/<datacenter_id>


Version-Release number of selected component (if applicable):
rhevm-4.1.0.4-0.1.el7.noarch



Steps to Reproduce:
1. 
2.
3.


From 4.1 API V3:
<data_centerhref="/ovirt-engine/api/datacenters/54959610-289f-4f8c-96b3-03d3665b3f93"id="54959610-289f-4f8c-96b3-03d3665b3f93">
<name>mac_pool_dc_1</name>
<linkhref="/ovirt-engine/api/datacenters/54959610-289f-4f8c-96b3-03d3665b3f93/permissions"rel="permissions"/>
<linkhref="/ovirt-engine/api/datacenters/54959610-289f-4f8c-96b3-03d3665b3f93/clusters"rel="clusters"/>
<linkhref="/ovirt-engine/api/datacenters/54959610-289f-4f8c-96b3-03d3665b3f93/networks"rel="networks"/>
<linkhref="/ovirt-engine/api/datacenters/54959610-289f-4f8c-96b3-03d3665b3f93/storagedomains"rel="storagedomains"/>
<linkhref="/ovirt-engine/api/datacenters/54959610-289f-4f8c-96b3-03d3665b3f93/qoss"rel="qoss"/>
<linkhref="/ovirt-engine/api/datacenters/54959610-289f-4f8c-96b3-03d3665b3f93/quotas"rel="quotas"/>
<linkhref="/ovirt-engine/api/datacenters/54959610-289f-4f8c-96b3-03d3665b3f93/iscsibonds"rel="iscsibonds"/>
<local>false</local>
<quota_mode>disabled</quota_mode>
<status>uninitialized</status>
<supported_versions>
<version>
<major>4</major>
<minor>1</minor>
</version>
</supported_versions>
<version>
<major>4</major>
<minor>1</minor>
</version>
</data_center>
</data_centers>


From 4.0 API V3:
<data_centerhref="/ovirt-engine/api/datacenters/7bc6f043-6890-445e-8bf1-fcf1baa73902"id="7bc6f043-6890-445e-8bf1-fcf1baa73902">
<name>golden_env_mixed</name>
<linkhref="/ovirt-engine/api/datacenters/7bc6f043-6890-445e-8bf1-fcf1baa73902/storagedomains"rel="storagedomains"/>
<linkhref="/ovirt-engine/api/datacenters/7bc6f043-6890-445e-8bf1-fcf1baa73902/clusters"rel="clusters"/>
<linkhref="/ovirt-engine/api/datacenters/7bc6f043-6890-445e-8bf1-fcf1baa73902/networks"rel="networks"/>
<linkhref="/ovirt-engine/api/datacenters/7bc6f043-6890-445e-8bf1-fcf1baa73902/permissions"rel="permissions"/>
<linkhref="/ovirt-engine/api/datacenters/7bc6f043-6890-445e-8bf1-fcf1baa73902/quotas"rel="quotas"/>
<linkhref="/ovirt-engine/api/datacenters/7bc6f043-6890-445e-8bf1-fcf1baa73902/qoss"rel="qoss"/>
<linkhref="/ovirt-engine/api/datacenters/7bc6f043-6890-445e-8bf1-fcf1baa73902/iscsibonds"rel="iscsibonds"/>
<local>false</local>
<storage_format>v3</storage_format>
<versionmajor="4"minor="0"/>
<supported_versions>
<versionmajor="4"minor="0"/>
</supported_versions>
<status>
<state>up</state>
</status>
<mac_poolhref="/ovirt-engine/api/macpools/5899d284-0047-02cc-015c-0000000002dc"id="5899d284-0047-02cc-015c-0000000002dc"/>
<quota_mode>disabled</quota_mode>
</data_center>
</data_centers>

Comment 1 Juan Hernández 2017-02-13 09:14:52 UTC
This happens will all versions of the API, not just with version 3.

The reason is that when using search the backend doesn't return the identifier of the MAC pool. The API uses search to retrieve the collection (SearchType.StoragePool) and a query (VdcQueryType.GetStoragePoolById) to retrieve a specific data center. The expectation is that be backedn will return the same type of object, and the same set of attributes, for both things. In this case that expectation is broken.

Comment 2 Red Hat Bugzilla Rules Engine 2017-02-14 10:29:31 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 3 Martin Mucha 2017-02-15 11:13:52 UTC
pwd
/home/mmucha/projects/ovirt-engine/packaging/dbscripts/upgrade

git co ovirt-engine-4.1
Switched to branch 'ovirt-engine-4.1'

ls 04_01_0010_add_mac_pool_id_to_vds_group.sql
04_01_0010_add_mac_pool_id_to_vds_group.sql

git co ovirt-engine-4.0
Switched to branch 'ovirt-engine-4.0'

ls 04_01_0010_add_mac_pool_id_to_vds_group.sql
ls: cannot access 04_01_0010_add_mac_pool_id_to_vds_group.sql: No such file or directory

==> between these two version this script were introduced. With it was introduced new logic: MacPool is not property of datacenter, but cluster. It will be reported on DC in 'best-effort' way. If we can calculate single mac pool value for whole DC, this will be reported. If we cannot do that, we won't report mac pool for DC. We can report single mac pool for whole DC, if every cluster in that DC has same mac pool.

So I believe, that here must be difference in your setups. The 4.1 one has 2 or more clusters with different mac pool assigned.

Is it like that? Please confirm. If so, then CLOSE->NOTABUG I believe.

Comment 4 Meni Yakove 2017-02-22 11:48:04 UTC
I have a DC with two clusters that use 'Default' MAC pool and I still don't have it under /api/datacenters

<data_centerhref="/ovirt-engine/api/datacenters/18a899cb-9a51-45a3-99fd-eca0e3770e77"id="18a899cb-9a51-45a3-99fd-eca0e3770e77">
<name>golden_env_mixed</name>
<linkhref="/ovirt-engine/api/datacenters/18a899cb-9a51-45a3-99fd-eca0e3770e77/permissions"rel="permissions"/>
<linkhref="/ovirt-engine/api/datacenters/18a899cb-9a51-45a3-99fd-eca0e3770e77/networks"rel="networks"/>
<linkhref="/ovirt-engine/api/datacenters/18a899cb-9a51-45a3-99fd-eca0e3770e77/storagedomains"rel="storagedomains"/>
<linkhref="/ovirt-engine/api/datacenters/18a899cb-9a51-45a3-99fd-eca0e3770e77/clusters"rel="clusters"/>
<linkhref="/ovirt-engine/api/datacenters/18a899cb-9a51-45a3-99fd-eca0e3770e77/quotas"rel="quotas"/>
<linkhref="/ovirt-engine/api/datacenters/18a899cb-9a51-45a3-99fd-eca0e3770e77/iscsibonds"rel="iscsibonds"/>
<linkhref="/ovirt-engine/api/datacenters/18a899cb-9a51-45a3-99fd-eca0e3770e77/qoss"rel="qoss"/>
<local>false</local>
<storage_format>v4</storage_format>
<versionmajor="4"minor="1"/>
<supported_versions>
<versionmajor="4"minor="1"/>
</supported_versions>
<status>
<state>up</state>
</status>
<quota_mode>disabled</quota_mode>
</data_center>
</data_centers>

Comment 5 Yevgeny Zaspitsky 2017-02-26 11:30:02 UTC
FYI, from my test on master (4.2) the mac_pool element appears in both versions (v3 and v4).

Comment 6 Yevgeny Zaspitsky 2017-02-26 13:23:53 UTC
same result on the latest 4.1 branch

Comment 7 Mor 2017-04-26 15:15:33 UTC
Verified on:
Red Hat Virtualization Manager Version: 4.1.2-0.1.el7

See output:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<data_centers>
    <data_center href="/ovirt-engine/api/datacenters/00000001-0001-0001-0001-000000000311" id="00000001-0001-0001-0001-000000000311">
        <name>Default</name>
        <description>The default Data Center</description>
        <link href="/ovirt-engine/api/datacenters/00000001-0001-0001-0001-000000000311/networks" rel="networks"/>
        <link href="/ovirt-engine/api/datacenters/00000001-0001-0001-0001-000000000311/storagedomains" rel="storagedomains"/>
        <link href="/ovirt-engine/api/datacenters/00000001-0001-0001-0001-000000000311/permissions" rel="permissions"/>
        <link href="/ovirt-engine/api/datacenters/00000001-0001-0001-0001-000000000311/clusters" rel="clusters"/>
        <link href="/ovirt-engine/api/datacenters/00000001-0001-0001-0001-000000000311/quotas" rel="quotas"/>
        <link href="/ovirt-engine/api/datacenters/00000001-0001-0001-0001-000000000311/iscsibonds" rel="iscsibonds"/>
        <link href="/ovirt-engine/api/datacenters/00000001-0001-0001-0001-000000000311/qoss" rel="qoss"/>
        <local>false</local>
        <quota_mode>disabled</quota_mode>
        <status>uninitialized</status>
        <supported_versions>
            <version>
                <major>4</major>
                <minor>1</minor>
            </version>
        </supported_versions>
        <version>
            <major>4</major>
            <minor>1</minor>
        </version>
        <mac_pool href="/ovirt-engine/api/macpools/58dbbb44-02cf-0122-00e1-00000000014e" id="58dbbb44-02cf-0122-00e1-00000000014e"/>
    </data_center>
    <data_center href="/ovirt-engine/api/datacenters/a9174c01-08de-4674-8def-6e142fe0209c" id="a9174c01-08de-4674-8def-6e142fe0209c">
        <name>golden_env_mixed</name>
        <link href="/ovirt-engine/api/datacenters/a9174c01-08de-4674-8def-6e142fe0209c/networks" rel="networks"/>
        <link href="/ovirt-engine/api/datacenters/a9174c01-08de-4674-8def-6e142fe0209c/storagedomains" rel="storagedomains"/>
        <link href="/ovirt-engine/api/datacenters/a9174c01-08de-4674-8def-6e142fe0209c/permissions" rel="permissions"/>
        <link href="/ovirt-engine/api/datacenters/a9174c01-08de-4674-8def-6e142fe0209c/clusters" rel="clusters"/>
        <link href="/ovirt-engine/api/datacenters/a9174c01-08de-4674-8def-6e142fe0209c/quotas" rel="quotas"/>
        <link href="/ovirt-engine/api/datacenters/a9174c01-08de-4674-8def-6e142fe0209c/iscsibonds" rel="iscsibonds"/>
        <link href="/ovirt-engine/api/datacenters/a9174c01-08de-4674-8def-6e142fe0209c/qoss" rel="qoss"/>
        <local>false</local>
        <quota_mode>disabled</quota_mode>
        <status>up</status>
        <storage_format>v4</storage_format>
        <supported_versions>
            <version>
                <major>4</major>
                <minor>1</minor>
            </version>
        </supported_versions>
        <version>
            <major>4</major>
            <minor>1</minor>
        </version>
        <mac_pool href="/ovirt-engine/api/macpools/58dbbb44-02cf-0122-00e1-00000000014e" id="58dbbb44-02cf-0122-00e1-00000000014e"/>
    </data_center>
</data_centers>


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