Bug 1358860 - Api v3 error return null in disk search
Summary: Api v3 error return null in disk search
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ovirt-4.0.2
: 4.0.2.1
Assignee: Juan Hernández
QA Contact: Eyal Shenitzky
URL:
Whiteboard:
Depends On:
Blocks: 1356649
TreeView+ depends on / blocked
 
Reported: 2016-07-21 15:39 UTC by Clesio Santos
Modified: 2017-03-28 10:00 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-12 14:23:56 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)
API V3 ovirt 3.6 (149.41 KB, image/jpeg)
2016-07-21 17:39 UTC, Clesio Santos
no flags Details
API V3 ovirt 4.0 (98.91 KB, image/jpeg)
2016-07-21 17:40 UTC, Clesio Santos
no flags Details
Foreman Integration oVirt (278.87 KB, application/pdf)
2016-07-22 19:16 UTC, Clesio Santos
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 61229 0 master MERGED restapi: Fix V3 VM and template disks collection links 2016-07-26 07:23:09 UTC
oVirt gerrit 61260 0 master MERGED restapi: Add V3 support for disks detail 2016-07-26 07:23:22 UTC
oVirt gerrit 61368 0 ovirt-engine-4.0 MERGED restapi: Fix V3 VM and template disks collection links 2016-07-26 08:05:10 UTC
oVirt gerrit 61369 0 ovirt-engine-4.0 MERGED restapi: Add V3 support for disks detail 2016-07-26 08:05:22 UTC
oVirt gerrit 61372 0 ovirt-engine-4.0.2 MERGED restapi: Fix V3 VM and template disks collection links 2016-07-26 08:23:00 UTC
oVirt gerrit 61373 0 ovirt-engine-4.0.2 MERGED restapi: Add V3 support for disks detail 2016-07-26 08:28:49 UTC

Description Clesio Santos 2016-07-21 15:39:59 UTC
Description of problem:


Version-Release number of selected component (if applicable): Versão 4.0.2-0.0.master.20160719143217.git36eaeca.el7.centos


How reproducible:
acess the API V3 


Steps to Reproduce:
1.https://<server>/ovirt-engine/api/v3/vms/{:id}/disks
2.
3.

Actual results:
the result the XML is 
<disks>
<disk href="/ovirt-engine/api/v3/vms/{:id}/null/{:diskID}" id="DiskID">
<actions>


Expected results:


Additional info:

Please look the path after {:id} return "null". i´m reproduce in oVirt 3.6 and show me after {:id} "disk"

Comment 1 Clesio Santos 2016-07-21 17:39:46 UTC
Created attachment 1182638 [details]
API V3 ovirt 3.6

Comment 2 Clesio Santos 2016-07-21 17:40:26 UTC
Created attachment 1182639 [details]
API V3 ovirt 4.0

Comment 3 Red Hat Bugzilla Rules Engine 2016-07-21 20:40:55 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 4 Juan Hernández 2016-07-21 20:43:45 UTC
Clesio, you are right, this a regression that we introduced when we replaced the "disks" collection with "diskattachments". We will try to fix it in the next 4.0.z release.

Please consider using version 4 of the API.

Comment 5 Clesio Santos 2016-07-21 21:08:12 UTC
Thanks Juan but i´m using the ovirt integrations with foreman.
After update foreman no works.

Thanks for reponse i´m waiting release.

Comment 6 Juan Hernández 2016-07-22 07:34:51 UTC
Clesio, can you elaborate a bit? What part of the integration with Foreman isn't working? What version of Foreman?

Comment 7 Clesio Santos 2016-07-22 19:16:13 UTC
Created attachment 1182932 [details]
Foreman Integration oVirt

show de error of integration Foreman-oVirt

Comment 8 Clesio Santos 2016-07-22 19:45:31 UTC
(In reply to Juan Hernández from comment #6)
> Clesio, can you elaborate a bit? What part of the integration with Foreman
> isn't working? What version of Foreman?

Juan,

I may have expressed myself wrong, I use the foreman to provision the oVirt through the API.

the error is the attach.

Tks

Comment 9 Juan Hernández 2016-07-22 20:26:15 UTC
I understand. Thanks for the additional information Clesio, it is very useful. The problem that you are having with Foreman is not caused by the incorrect URL, but by a different problem. In version 3 of the engine we used to support an undocumented parameter to request additional detail. For example, to request the VM together with its disks one could use the following request:

  GET /ovirt-engine/api/vms
  Accept: application/xml; detail=disks

The result of this should be something like this:

  <vms>
    <vm id="..." href="...">
      <disks>
        <disk id="..." href="...">
          <name>mydisk</name>
          ...
        </disk>
        ...
      </disks>
      ...
    </vm>
    ...
  </vms>

Note the presence of the "disks" element, which isn't normally present.

This has been removed completely in version 4 of the API, but it was preserved in version 3 for backwards compatibility. Unfortunately it isn't working correctly, because the "disks" collection has also been removed from version 4 of the API.

When Foreman requests the list of virtual machines uses the Ruby gem `rbovirt`, and that gem uses this undocumented mechanism, and fails.

We will fix this in the API.

Comment 10 Clesio Santos 2016-07-22 20:38:54 UTC
Juan,

that exellent news ...

I'm hoping the fix, if you are interested, I can test the fix.
I am currently with my foreman standing room waiting for the fix; (

You can count on me to what is necessary.

Hugs

Comment 11 Eyal Shenitzky 2016-08-01 13:32:38 UTC
 Verified with the following code:
------------------------------------------ 

rhevm-
4.0.2.3-0.1.el7ev

Steps to reproduce:
------------------------------------------
https://<server>/ovirt-engine/api/v3/vms/{:id}/disks


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