Description of problem: The way to remove iso images is a rest-api call with DELETE. This works to change the VM properties (UpdateVmCommand). The problem is it cannot update it dynamically (UpdateVmDynamicDataVDSCommand), seems to just ignore the current=true parameter. This parameter works perfectly fine with PUT or GET to modify the vm's cdrom on the fly, but fails in this regard. This is the equivalent of Change CD->Eject in the Web UI. Version-Release number of selected component (if applicable): ovirt-engine-restapi-3.5.0-0.0.master.20140821064931.gitb794d66.el6.noarch ovirt-engine-3.5.0-0.0.master.20140821064931.gitb794d66.el6.noarch How reproducible: 100% Steps to Reproduce: 1. DELETE api/vms/e0ba3f7d-b376-453d-813f-2d6817d77be8/cdroms/00000000-0000-0000-0000-000000000000;current=true Actual results: Call UpdateVmCommand in the backend. iso file is removed. Expected results: UpdateVmDynamicDataVDSCommand is called, ejecting "dynamically" the cdrom (or at least there's a way to do this, like the eject functionality in the web ui) Additional info: I don't know if this is the proper way to handle this calls for consistency DELETE should delete the cdrom object like any other object in a collection. Eject a cdrom (iso) should be done via PUT and in a way to pass a null file property, something like this: <cdrom><file id=''/></cdrom>
Blocking our tests to check if storage domains can be deactivated after cdroms are ejected.
Moving to ovirt (as it should have been)
So what is the solution implemented: 1) calling delete with current=true? DELETE api/vms/e0ba3f7d-b376-453d-813f-2d6817d77be8/cdroms/00000000-0000-0000-0000-000000000000;current=true 2) sending <cdrom><file id=''/></cdrom> ?
The 2) one
The solution is to allow an empty file identifier to the update operation: #!/bin/sh -ex url="https://ovirt.example.com/ovirt-engine/api" user="admin@internal" password="******" curl \ --verbose \ --insecure \ --request PUT \ --user "${user}:${password}" \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' <cdrom> <file id=""/> </cdrom> ' \ "${url}/vms/e0ba3f7d-b376-453d-813f-2d6817d77be8/cdroms/00000000-0000-0000-0000-000000000000;current=true"
*** Bug 1145035 has been marked as a duplicate of this bug. ***
oVirt 3.5 has been released and should include the fix for this issue.
Verified on rhevm vt12. Marking as Triaged.