Bug 1371024

Summary: [v4 REST-API only] VM in export domain has disks collection and not diskattachments collection
Product: [oVirt] ovirt-engine Reporter: Eyal Shenitzky <eshenitz>
Component: BLL.StorageAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Carlos Mestre González <cmestreg>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.0.3CC: amureini, bugs, ratamir, tnisan
Target Milestone: ovirt-4.0.5Keywords: Automation
Target Release: 4.0.5Flags: amureini: ovirt-4.0.z?
eshenitz: planning_ack?
amureini: devel_ack+
rule-engine: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-24 09:39:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1383264    

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.