Bug 1371024 - [v4 REST-API only] VM in export domain has disks collection and not diskattachments collection
Summary: [v4 REST-API only] VM in export domain has disks collection and not diskatta...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.0.5
: 4.0.5
Assignee: Tal Nisan
QA Contact: Carlos Mestre González
URL:
Whiteboard:
Depends On:
Blocks: 1383264
TreeView+ depends on / blocked
 
Reported: 2016-08-29 07:55 UTC by Eyal Shenitzky
Modified: 2016-11-24 09:39 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-11-24 09:39:55 UTC
oVirt Team: Storage
Embargoed:
amureini: ovirt-4.0.z?
eshenitz: planning_ack?
amureini: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 63390 0 master MERGED Add disk attachments collection to a VM on export domain 2016-09-06 12:58:50 UTC
oVirt gerrit 63394 0 master MERGED restapi: Add disk attachments collection to a VM in export domain 2016-09-08 09:30:58 UTC
oVirt gerrit 63417 0 model_4.0 MERGED Add disk attachments collection to a VM on export domain 2016-09-06 13:31:22 UTC
oVirt gerrit 63428 0 ovirt-engine-4.0 MERGED restapi: Update to model 4.0.34 2016-09-06 15:49:30 UTC
oVirt gerrit 63449 0 ovirt-engine-4.0.4 MERGED restapi: Update to model 4.0.34 2016-09-07 06:40:23 UTC
oVirt gerrit 63518 0 ovirt-engine-4.0 MERGED restapi: Add disk attachments collection to a VM in export domain 2016-09-13 08:51:20 UTC

Description Eyal Shenitzky 2016-08-29 07:55:13 UTC
Description of problem:

When export a VM to an export domain, VM holds disks and not diskattachments as it should - 
api/storagedomains/{export-domain-id}/vms/{vm-id}/disks

Instead of - 
api/storagedomains/{export-domain-id}/vms/{vm-id}/diskattachments


Version-Release number of selected component (if applicable):
Engine - 4.0.3-0.1.el7ev

How reproducible:
100%

Steps to Reproduce:
1.Create a VM with disk
2.Export the VM to an export domain
3.GET /ovirt-engine/api/storagedomains/{export-domain-id}/vms/{vm-id}

Actual results:
VM has disks collection

Expected results:
VM should has diskattachments collection

Additional info:
v4 REST-API only

Comment 1 Allon Mureinik 2016-09-12 07:33:09 UTC
I see a bunch of merged patches and a draft. Tal, can you update on the status here? Are we still waiting for the draft?

Comment 2 Carlos Mestre González 2016-10-07 14:28:36 UTC
There a missing link for this bug, the diskattachments collection is accessible under 
api/storagedomains/{export-domain-id}/vms/{vm-id}/diskattachments

but is not linked under the vms as a link (only disks):

<vms>
<vm href= "/ovirt-engine/api/v4/storagedomains/6c493f95-daeb-42aa-bab7-93b36d28ee83/vms/1f25080a-7ad9-4baf-aa62-2f7dadb20eff" id="1f25080a-7ad9-4baf-aa62-2f7dadb20eff">
<actions>
<link href= "/ovirt-engine/api/v4/storagedomains/6c493f95-daeb-42aa-bab7-93b36d28ee83/vms/1f25080a-7ad9-4baf-aa62-2f7dadb20eff/import" rel="import"/>
<link href= "/ovirt-engine/api/v4/storagedomains/6c493f95-daeb-42aa-bab7-93b36d28ee83/vms/1f25080a-7ad9-4baf-aa62-2f7dadb20eff/register" rel="register"/>
</actions>
<name>test_live_merge</name>
<link href= "/ovirt-engine/api/v4/storagedomains/6c493f95-daeb-42aa-bab7-93b36d28ee83/vms/1f25080a-7ad9-4baf-aa62-2f7dadb20eff/disks" rel="disks"/>

So issues:
1. diskattachments should be added as link in /api/storagedomains/[id]/vms/[id]

and I have a question:
2. /api/storagedomains/[id]/vms/[id]/disk is also there.. but should be removed the same way /api/vms/[vm]/disk is a 404 and that info should only be accessible via /api/storagedomains/[id]/disks ? Seems maybe inconsistent with how vms/disks in the env work.

Comment 3 Tal Nisan 2016-10-09 08:02:50 UTC
Hi Carlos,
As for 1, please open a separate bug.
As for 2, you are right but unfortunately the diskattachments of a /storagedomains/... was introduced later in the development cycle of 4.0 at which point removing the /disks would have break the API backwards compatibility (as an upstream of 4.0 was already released)

Comment 4 Allon Mureinik 2016-11-24 09:39:55 UTC
4.0.5 has been released, closing.


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