Bug 1356649 - Template's & VMs disks link is wrongly calculated in rest API V3
Summary: Template's & VMs disks link is wrongly calculated in rest API V3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.0.1
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: ovirt-4.0.2
: 4.0.2
Assignee: Juan Hernández
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On: 1358860
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-14 14:58 UTC by Petr Balogh
Modified: 2016-08-23 20:44 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-23 20:44:00 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Logs from engine, hosts, art (968.00 KB, application/x-gzip)
2016-07-14 14:58 UTC, Petr Balogh
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:1743 0 normal SHIPPED_LIVE Red Hat Virtualization Manager 4.0 GA Enhancement (ovirt-engine) 2016-09-02 21:54:01 UTC
oVirt gerrit 60901 0 master MERGED restapi: Fix VMs/Templates disks link 2016-07-18 09:47:59 UTC
oVirt gerrit 60906 0 ovirt-engine-4.0 MERGED restapi: Fix VMs/Templates disks link 2016-07-18 10:29:21 UTC
oVirt gerrit 61292 0 master ABANDONED restapi: bug fix in Vms and Templates disks links 2016-07-25 08:49:42 UTC

Description Petr Balogh 2016-07-14 14:58:27 UTC
Created attachment 1179888 [details]
Logs from engine, hosts, art

Description of problem:

You can see links from V3 api:
<link href="/ovirt-engine/api/v3/templates/03035598-bde1-460c-81ee-9f473c11d416/cdroms" rel="cdroms"/>
<link href="/ovirt-engine/api/v3/templates/03035598-bde1-460c-81ee-9f473c11d416/graphicsconsoles" rel="graphicsconsoles"/>
<link href="/ovirt-engine/api/v3/templates/03035598-bde1-460c-81ee-9f473c11d416/nics" rel="nics"/>
<link href="/ovirt-engine/api/v3/templates/03035598-bde1-460c-81ee-9f473c11d416/permissions" rel="permissions"/>
<link href="/ovirt-engine/api/v3/templates/03035598-bde1-460c-81ee-9f473c11d416/tags" rel="tags"/>
<link href="/ovirt-engine/api/v3/templates/03035598-bde1-460c-81ee-9f473c11d416/watchdogs" rel="watchdogs"/>
<link href="/ovirt-engine/api/v3/templates/03035598-bde1-460c-81ee-9f473c11d416//03035598-bde1-460c-81ee-9f473c11d416/disks" rel="disks"/>

disks link is bad. And our automation failed when we adding template and copy disk to SDs



Version-Release number of selected component (if applicable):
4.0.1-2


How reproducible:

Steps to Reproduce:
1. add template
2. copy template disk to another SD with rest API V3

Comment 1 Petr Balogh 2016-07-17 10:19:07 UTC
Impact on automation: When we build our GEs, we are using the template from which we copy disk to all SDs, and then we create some VMs depend on this template and template's disk. So if we have bed link in API, our code cannot work with it and our GE-builder job cannot build GE and the whole job is failing cause of this bug.  We have also builder for V4 api, but there was change with disks -> diskattachments so we didn't align with this change yet(in progress).. so we cannot also build GE with V4 API. So when we don't have right built our GEs we cannot run our Tier tests on them.

Comment 2 Yaniv Kaul 2016-07-17 13:04:15 UTC
Is this Infra or Storage?

Comment 3 Allon Mureinik 2016-07-17 14:23:01 UTC
(In reply to Yaniv Kaul from comment #2)
> Is this Infra or Storage?

The starting point should be Storage.
Each vertical is in charge of its own REST APIs (in this case - disks belong to Storage).
If we dig around and find there's something wrong with the infrastructure, we can always move it.

Tal - can you take a look please? This looks suspiciously like it's related to commit 88eb98dd6d67a7fac003cd737d466866c865c130, but I'm not sure.
Thanks!

Comment 4 Tal Nisan 2016-07-18 09:26:10 UTC
Not related to this commit, the problem lies within the V3TemplateHelper/V3VMHelper links calculation.

Note for the QE contact who will test it - this also occurs for VMs so please check it there as well

Comment 5 Nelly Credi 2016-07-18 10:47:15 UTC
We also see 'null' instead of 'disks' in this request:

GET request content is --  url:/ovirt-engine/api/templates/03035598-bde1-460c-81ee-9f473c11d416/disks 
 
Response body for GET request is: 
<disks>
    <disk href="/ovirt-engine/api/templates/03035598-bde1-460c-81ee-9f473c11d416/null/c04ad884-7329-476d-8abd-9b838233cce0" id="c04ad884-7329-476d-8abd-9b838233cce0">
        <actions>
            <link href="/ovirt-engine/api/templates/03035598-bde1-460c-81ee-9f473c11d416/null/c04ad884-7329-476d-8abd-9b838233cce0/export" rel="export"/>
            <link href="/ovirt-engine/api/templates/03035598-bde1-460c-81ee-9f473c11d416/null/c04ad884-7329-476d-8abd-9b838233cce0/copy" rel="copy"/>
        </actions>


i assume it will be covered in the fix, but wanted to make sure

Comment 6 Petr Balogh 2016-07-22 10:54:06 UTC
We still see null in template's disk links in 4.0.2 :
<disk href="/ovirt-engine/api/v3/templates/ee54ddf7-f8e5-4345-876f-9538900d8642/null/8abfcc70-849b-4afb-9c56-44b0db685c74" id="8abfcc70-849b-4afb-9c56-44b0db685c74">
http://pastebin.test.redhat.com/395036

Comment 7 Nelly Credi 2016-07-22 20:10:53 UTC
see comment #6

Comment 8 Yaniv Kaul 2016-07-24 07:01:59 UTC
(In reply to Petr Balogh from comment #6)
> We still see null in template's disk links in 4.0.2 :
> <disk
> href="/ovirt-engine/api/v3/templates/ee54ddf7-f8e5-4345-876f-9538900d8642/
> null/8abfcc70-849b-4afb-9c56-44b0db685c74"
> id="8abfcc70-849b-4afb-9c56-44b0db685c74">
> http://pastebin.test.redhat.com/395036

Build information, complete engine log are usually needed.
Nelly - can we ensure this is indeed not fixed in 4.0.2? (is it reproduced elsewhere as well?)

Comment 9 Nelly Credi 2016-07-24 07:36:10 UTC
as Petr wrote it is still failing in 4.0.2
build:
rhevm-4.0.2-0.1.rc.el7ev.noarch

and we see it in 2 environments which were provisioned

i can attach the logs again, but probably wont be different than the previous logs

Comment 10 Nelly Credi 2016-07-24 14:48:58 UTC
adding more info:

the patch which was supposed to fix it causes the following:
passing /ovirt-engine/api/v3/templates/
results in 
<link href="/ovirt-engine/api/v3/templates//00000000-0000-0000-0000-000000000000/disks" rel="disks"/>
(double slash) 

passing /ovirt-engine/api/v3/templates
results in 
<link href="/ovirt-engine/api/v3/templates/00000000-0000-0000-0000-000000000000/disks" rel="disks"/>


while in vms its the opposite:
/ovirt-engine/api/v3/vms
results in
<link href="/ovirt-engine/api/v3/vms9b9cab84-3624-4f4b-9aee-fe4bf2400361/disks" rel="disks"/>
(missing slash) 

and passing
/ovirt-engine/api/v3/vms/
results in
<link href="/ovirt-engine/api/v3/vms/9b9cab84-3624-4f4b-9aee-fe4bf2400361/disks" rel="disks"/>

so the behavior is inconsistent 

in addition to this issue, the related problem mentioned in comment #5 & comment #6 - null link when entering template/UUID/disks wasnt fixed

Comment 11 Idan Shaby 2016-07-25 05:36:28 UTC
Patch 61292 should solve the double/no slashes before the disks part of the link.
The nulls issue still needs to be solved.

Comment 12 Idan Shaby 2016-07-25 10:26:56 UTC
Juan is already working on a solution for it on a different thread.
Marking as depend on 1358860 (not closing since this bug is a RHEV bug and 1358860 is an ovirt bug).
Juan, do you want to take it from here?

Comment 13 Juan Hernández 2016-07-25 10:29:28 UTC
Yes, I take it, thanks Idan.

Comment 14 Allon Mureinik 2016-07-26 07:35:36 UTC
Juan - is there anything else missing here, or can this one be moved to MODIFIED too?

Comment 15 Juan Hernández 2016-07-26 08:02:49 UTC
Can't move to MODIFIED yet, the patches still need to be merged to the 4.0 and 4.0.2 branches. We can also close as duplicated of bug 1358860.

Comment 16 Juan Hernández 2016-07-26 08:33:08 UTC
All the required changes are now merged to the 4.0.2 branch, so this is now MODIFIED.

Comment 17 Raz Tamir 2016-07-28 08:16:43 UTC
Verified on ovirt-engine-4.0.2.1-0.1.el7ev.noarch

The link to disks collection under vms and templates is now correct

Comment 19 errata-xmlrpc 2016-08-23 20:44:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-1743.html


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