Bug 1295742 - Duplicate storage domains in REST API
Duplicate storage domains in REST API
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
Unspecified Unspecified
unspecified Severity urgent
: ovirt-3.6.2
: 3.6.2
Assigned To: Eli Mesika
Petr Matyáš
Depends On:
  Show dependency treegraph
Reported: 2016-01-05 06:36 EST by Christophe Fergeau
Modified: 2016-04-19 21:36 EDT (History)
18 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-04-19 21:36:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 51438 None None None 2016-01-06 10:45 EST
oVirt gerrit 51599 ovirt-engine-3.6 MERGED core: show data once on ISO shared from multi DCs 2016-01-10 11:56 EST
oVirt gerrit 51600 ovirt-engine-3.6.2 MERGED core: show data once on ISO shared from multi DCs 2016-01-10 11:59 EST

  None (edit)
Description Christophe Fergeau 2016-01-05 06:36:07 EST
While looking at dumps of the XML REST API communication between
remote-viewer and the RHEV instance, I've noticed this:

> GET /ovirt-engine/api/storagedomains HTTP/1.1

< <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
< <storage_domains>
<     <storage_domain href="/ovirt-engine/api/storagedomains/b85e609a-c9dc-4d14-bfd9-03b6c2c93fba" id="b85e609a-c9dc-4d14-bfd9-03b6c2c93fba">
<         <name>iso</name>
<         <type>iso</type>
<     </storage_domain>
<     <storage_domain href="/ovirt-engine/api/storagedomains/b85e609a-c9dc-4d14-bfd9-03b6c2c93fba" id="b85e609a-c9dc-4d14-bfd9-03b6c2c93fba">
<         <name>iso</name>
<         <type>iso</type>
<     </storage_domain>

There are 2 ISO domains with the same UUID, which do not seem

I'm told that this RHEV setup has 2 different DCs, each one with the same ISO storage domain attached to it.

Excerpt from an email thread about this with Juan Hernandez and Eli Mesika:
> I believe that this is a bug, as the RESTAPI shouldn't list twice the
> same object, with the same identifier. You may workaround it making
> sure that each ISO domain is attached to only one data center. That is
> kind of limiting, but it is the only solution that I can offer at the
> moment.
> The root cause of this is that the RESTAPI calls the
> "GetAllStorageDomains" query, that calls the
> "getallfromstorage_domains" stored procedure. This stored procedure
> does a "select * from storage_domains". The "storage_domains" view is
> constructed joining the storage domain tables and the
> "storage_pool_iso_map" table, using a left outer join. Thus if an ISO
> domain is attached N times then the result will contain it N times,
> two in this particular case.
> Eli, any suggestion on what is the best way to address this issue?

Since currently we have no limitation on attaching the same ISO to multiple DCs (and I think we shouldn't limit that), I think that this is a bug that can be resolved by adding a DISTINCT directive to the query which will maybe make the code less efficient (since this requires an implicit sorting based on all columns by the database), but , in this case , because this query is called from API on demand , I think that its impact on performance is minor

So, I suggest opening a BZ on that and assign it to me , we will decide if to address it only to 4.0 or also to 3.6.z
Comment 1 Petr Matyáš 2016-01-21 05:52:51 EST
Verified on 3.6.2-10

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