Bug 1014039

Summary: Cannot read name of 'current' CD image through the REST API
Product: Red Hat Enterprise Virtualization Manager Reporter: Christophe Fergeau <cfergeau>
Component: ovirt-engine-restapiAssignee: Martin Betak <mbetak>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Novotny <pnovotny>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, amureini, bazulay, bdagan, iheim, mavital, mbetak, michal.skrivanek, mlipchuk, oramraz, Rhev-m-bugs, scohen, yeylon
Target Milestone: ---   
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: ovirt-3.4.0-beta2 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: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 969641, 1025376, 1078909, 1142926    

Description Christophe Fergeau 2013-10-01 09:58:17 UTC
As described in https://access.redhat.com/site/documentation//en-US/Red_Hat_Enterprise_Virtualization/3.2/html/Developer_Guide/sect-Sub-Collections-2.html , it's possible to change the CD image used by a running VM through the REST API using ?current. However after changing it, it's not possible to read back this value, a GET on api/vms/d14e4ddc-3dc5-4157-8e4d-f0f807856884/cdroms/00000000-0000-0000-0000-000000000000 or api/vms/d14e4ddc-3dc5-4157-8e4d-f0f807856884/cdroms/00000000-0000-0000-0000-000000000000?current
always return the name of the ISO that was used by the VM when it was started.

> PUT //api/vms/d14e4ddc-3dc5-4157-8e4d-f0f807856884/cdroms/00000000-0000-0000-0000-000000000000?current= HTTP/1.1
> Soup-Debug-Timestamp: 1380621345
> Soup-Debug: SoupSessionAsync 1 (0x6b1960), SoupMessage 4 (0xa84b90), SoupSocket 5 (0x7fa400)
> Host: rhevm33.spice.lab.eng.brq.redhat.com
> Content-Type: application/xml
> Filter: true
> Connection: Keep-Alive
> Authorization: Basic [teuf.eng.brq.redhat.com:*********]
>
> <cdrom>
>       <file id="10Zig.iso"/>
> </cdrom>

< HTTP/1.1 200 OK
< Soup-Debug-Timestamp: 1380621346
< Soup-Debug: SoupMessage 4 (0xa84b90)
< Date: Tue, 01 Oct 2013 09:55:43 GMT
< Pragma: No-cache
< Cache-Control: no-cache
< Expires: Thu, 01 Jan 1970 01:00:00 CET
< Content-Type: application/xml
< Content-Length: 100
< Vary: Accept-Encoding
< Connection: close
<
< <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
< <cdrom>
<     <file id="10Zig.iso"/>
< </cdrom>

Comment 2 Martin Betak 2014-01-30 10:00:30 UTC
*** Bug 876994 has been marked as a duplicate of this bug. ***

Comment 3 Allon Mureinik 2014-02-04 20:07:26 UTC
Martin, both patches in the external tracker are merged. Can this bug be moved to MODIFIED, or is there still something missing?

Comment 4 Martin Betak 2014-02-05 11:25:43 UTC
seems automation failed to move the status

Comment 5 Pavel Novotny 2014-02-27 17:21:19 UTC
Verified in ovirt-engine-3.4.0-0.11.beta3.el6.noarch.

Verification steps:

1. Create a VM with attached CD "CentOS-6.5-x86_64-minimal.iso" at boot time. Check the CD:
-~-
GET /ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000

<cdrom href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
  <vm href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8" id="5d4f3c8a-7514-400d-a0f7-5c6c51178ba8"/>
  <file id="CentOS-6.5-x86_64-minimal.iso"/>
</cdrom>
-~-

2. Run the VM and check the current CD (should be the same):
-~-
GET /ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000;current

<cdrom href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
  <vm href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8" id="5d4f3c8a-7514-400d-a0f7-5c6c51178ba8"/>
  <file id="CentOS-6.5-x86_64-minimal.iso"/>
</cdrom>
-~-

3. Eject the CD (in GUI: VM -> Change CD -> [Eject]) and check the current CD again (should be empty):
-~-
GET /ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000;current

<cdrom href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
  <vm href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8" id="5d4f3c8a-7514-400d-a0f7-5c6c51178ba8"/>
</cdrom>
-~-

4. Change CD to "debian-6.0.6-amd64-netinst.iso" and yet check the current CD (now there should be the new one):
-~-
GET /ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000;current

<cdrom href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
  <vm href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8" id="5d4f3c8a-7514-400d-a0f7-5c6c51178ba8"/>
  <file id="debian-6.0.6-amd64-netinst.iso"/>
</cdrom>
-~-

5. Finally, check again the CD attached at every boot time (should be the CD defined in step 1):
-~-
GET /ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000

<cdrom href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
  <vm href="/ovirt-engine/api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8" id="5d4f3c8a-7514-400d-a0f7-5c6c51178ba8"/>
  <file id="CentOS-6.5-x86_64-minimal.iso"/>
</cdrom>
-~-

Comment 6 Itamar Heim 2014-06-12 14:09:26 UTC
Closing as part of 3.4.0