Bug 911348

Summary: REST-API: Allow copy/move disk from disks collection
Product: Red Hat Enterprise Virtualization Manager Reporter: Daniel Erez <derez>
Component: ovirt-engine-restapiAssignee: Sergey Gotliv <sgotliv>
Status: CLOSED CURRENTRELEASE QA Contact: Meital Bourvine <mbourvin>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: acathrow, amureini, bazulay, derez, iheim, jkt, lpeer, nlevinki, oramraz, Rhev-m-bugs, sgotliv
Target Milestone: ---Flags: sgotliv: needinfo+
dyasny: Triaged+
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: ovirt-3.4.0-alpha1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Bug Depends On:    
Bug Blocks: 1078909, 1142926    

Description Daniel Erez 2013-02-14 19:48:30 UTC
REST-API: Disks collection should support copy/move disk.
I.e:
/api/disks/{disk:id}/copy
/api/disks/{disk:id}/move

Comment 1 Michael Pasternak 2013-04-25 12:21:25 UTC
*** Bug 956661 has been marked as a duplicate of this bug. ***

Comment 3 Sandro Bonazzola 2014-01-14 08:44:54 UTC
ovirt 3.4.0 alpha has been released

Comment 4 Meital Bourvine 2014-02-02 12:11:57 UTC
I can see that the copy and move exist, but I'm not sure what should be the body of copy/move requests.

<disk href= "/api/disks/3b88ab6e-82e7-41bc-99ab-985cda686089" id="3b88ab6e-82e7-41bc-99ab-985cda686089">
<actions>
<link href= "/api/disks/3b88ab6e-82e7-41bc-99ab-985cda686089/export" rel="export"/>
<link href= "/api/disks/3b88ab6e-82e7-41bc-99ab-985cda686089/move" rel="move"/>
<link href= "/api/disks/3b88ab6e-82e7-41bc-99ab-985cda686089/copy" rel="copy"/>
</actions>
<name>mbourvin</name>
<link href= "/api/disks/3b88ab6e-82e7-41bc-99ab-985cda686089/permissions" rel="permissions"/>
<link href= "/api/disks/3b88ab6e-82e7-41bc-99ab-985cda686089/statistics" rel="statistics"/>
<alias>mbourvin</alias>
<image_id>61218b42-a5ae-4c7f-88e5-5b4550c0cfa0</image_id>
<storage_domains>
<storage_domain id="46485cb0-fcb5-43e7-9143-329f669da75f"/>
</storage_domains>
<size>1073741824</size>
<provisioned_size>1073741824</provisioned_size>
<actual_size>1073741824</actual_size>
<status>
<state>ok</state>
</status>
<interface>virtio</interface>
<format>raw</format>
<sparse>false</sparse>
<bootable>false</bootable>
<shareable>false</shareable>
<wipe_after_delete>false</wipe_after_delete>
<propagate_errors>false</propagate_errors>
</disk>

Comment 5 Sergey Gotliv 2014-02-02 12:18:47 UTC
You trying to copy/move the disk from one storage domain to another, so you have to provide the id of the target storage domain, for example:

<action>
<storage_domain id="e0d636c4-10c3-44be-a0ce-26cb59c1631b"/>
</action>

Comment 6 Meital Bourvine 2014-02-02 13:24:00 UTC
Verified:


URL: https://10.35.163.52/api/disks/3b88ab6e-82e7-41bc-99ab-985cda686089/move

BODY:
<action>
<storage_domain id="d024b726-afa7-4b52-b5d1-b2f51ef3b5fc"/>
</action>

RESPONSE:
<action>
<storage_domain id="d024b726-afa7-4b52-b5d1-b2f51ef3b5fc"/>
<status>
<state>complete</state>
</status>
</action>



URL: https://10.35.163.52/api/disks/9ba595ff-aa24-4f72-a9d9-795206a3c85f/copy

BODY:
<action>
<storage_domain id="d024b726-afa7-4b52-b5d1-b2f51ef3b5fc"/>
</action>

RESPONSE:
<action href= "/api/disks/9ba595ff-aa24-4f72-a9d9-795206a3c85f/copy/f2ab732b-6531-4641-8076-1f952eaa5eb8" id="f2ab732b-6531-4641-8076-1f952eaa5eb8">
<link href= "/api/disks/9ba595ff-aa24-4f72-a9d9-795206a3c85f" rel="parent"/>
<link href= "/api/disks/9ba595ff-aa24-4f72-a9d9-795206a3c85f/copy" rel="replay"/>
<async>true</async>
<storage_domain id="d024b726-afa7-4b52-b5d1-b2f51ef3b5fc"/>
<job href= "/api/jobs/1abed289-fd30-49f2-980c-2a55d8222905" id="1abed289-fd30-49f2-980c-2a55d8222905"/>
<status>
<state>pending</state>
</status>
</action>

Comment 7 Itamar Heim 2014-06-12 14:11:29 UTC
Closing as part of 3.4.0