Using the REST API (https://access.redhat.com/site/documentation//en-US/Red_Hat_Enterprise_Virtualization/3.2/html/Developer_Guide/Virtual_Machine_CD-ROMs_Sub-Collection.html), it's possible to - change the CD used by a VM while it's running using ?current, however the change will be lost when the VM is stopped - change the CD used by a VM while it's stopped, in which case it will be persistent across VM stops/starts However, trying to persistently change the CD used by the VM while it's running is not possible: > PUT //api/vms/d14e4ddc-3dc5-4157-8e4d-f0f807856884/cdroms/00000000-0000-0000-0000-000000000000 HTTP/1.1 > Soup-Debug-Timestamp: 1380620827 > Soup-Debug: SoupSessionAsync 1 (0x6b1960), SoupMessage 4 (0xa44390), SoupSocket 5 (0x73aa80) > 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 400 Bad Request < Soup-Debug-Timestamp: 1380620828 < Soup-Debug: SoupMessage 4 (0xa44390) < Date: Tue, 01 Oct 2013 09:47:05 GMT < Content-Type: application/xml < Content-Length: 262 < Vary: Accept-Encoding < Connection: close < < <?xml version="1.0" encoding="UTF-8" standalone="yes"?> < <fault> < <reason>Operation Failed</reason> < <detail>[There was an attempt to change VM values while the VM is not down. Please shut down the VM in order to modify these properties.]</detail> < </fault> Combined with the fact that it's not possible to GET the name of the ISO that was set using ?current (I'll file a bug about that), this makes CD changing through the REST API difficult.
please also file documentation bug, 'current' is a matrix and not query param, e.g /api/vms/d14e4ddc-3dc5-4157-8e4d-f0f807856884/cdroms/00000000-0000-0000-0000-000000000000;current
This is indeed documented as a 'matrix' parameter in the rsdl description, but using ; or ? does not seem to make a difference, both seem to be working when talking to a 3.3 instance (and ?current was also working on a 3.2 instance). Should things be made more strict?
(In reply to Christophe Fergeau from comment #2) > This is indeed documented as a 'matrix' parameter in the rsdl description, > but using ; or ? does not seem to make a difference, both seem to be working > when talking to a 3.3 instance (and ?current was also working on a 3.2 > instance). Should things be made more strict? "query" (?current) is deprecated and supported in 3.3 in sake of backward comparability only, IIRC docs folks had a BZ to document that.
(In reply to Michael Pasternak from comment #1) > please also file documentation bug, 'current' is a matrix and not query > param, > e.g > /api/vms/d14e4ddc-3dc5-4157-8e4d-f0f807856884/cdroms/00000000-0000-0000-0000- > 000000000000;current Filed as bug #1014057
FailedQA in ovirt-engine-3.4.0-0.7.beta2.el6.noarch. Changing CD permanently on a running VM still returns error. Verification steps: 1. Have a running VM without CD-ROM image attached (I used Fedora 19). 2. Attach CD permanently: >>> request: PUT /api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000 <cdrom> <file id="CentOS-6.5-x86_64-minimal.iso"/> </cdrom> >>> response: <fault> <reason>Operation Failed</reason> <detail> [There was an attempt to change VM values while the VM is not down. Please shut down the VM in order to modify these properties.] </detail> </fault> The reason seems to be that none of the attached Gerrit patches was merged to ovirt-engine-3.4 branch and therefore is missing in oVirt 3.4.
Martin, please backport to 3.4.
Checking git log the 3.4 branch already contains this fix and has for a long time now. I also built the 3.4 upstream branch and verified the above flow.
Should be fixed in beta3.
Confirmed and verified in ovirt-engine-3.4.0-0.11.beta3.el6.noarch (updated Fixed In Version). Verification steps: 1. Have a running VM without CD-ROM image attached (I used VM with Fedora 19). 2. Attach CD permanently: >>> request: PUT /api/vms/5d4f3c8a-7514-400d-a0f7-5c6c51178ba8/cdroms/00000000-0000-0000-0000-000000000000 <cdrom> <file id="CentOS-6.5-x86_64-minimal.iso"/> </cdrom> >>> response: <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> The CD is not changed on-the-fly while the VM is running (which is correct), however the change is persistent and survives after the VM is stopped & started again.
Closing as part of 3.4.0