Bug 1145035
Summary: | Cannot remove 'current' CD image through REST API | ||
---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Christophe Fergeau <cfergeau> |
Component: | ovirt-engine-restapi | Assignee: | Juan Hernández <juan.hernandez> |
Status: | CLOSED DUPLICATE | QA Contact: | Shai Revivo <srevivo> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 3.5.0 | CC: | bazulay, ecohen, gklein, iheim, lsurette, oramraz, rbalakri, Rhev-m-bugs, yeylon |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-09-22 10:02:38 UTC | 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: |
Description
Christophe Fergeau
2014-09-22 09:03:47 UTC
The way to eject the CD is to update it (not delete) using an empty file identifier: #!/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" This used to fail due to bug 1135970, but it should work now. *** This bug has been marked as a duplicate of bug 1135970 *** Hmm but DELETEing the !current image was removing the CD when I tested this, has this changed in fixed versions? Is calling DELETE on such resources returning an error now rather than doing nothing? Last but not least, the example in https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.5-Beta/html/Technical_Guide/Virtual_Machine_CD-ROMs_Sub-Collection.html is wrong then The vms/{vm:id}/cdroms/{cdrom:id} resource represents the CD reader device, not the CD disk inside the device. Changing/ejecting the CD disk inside the CD reader device should be implemented by updating (using the PUT method) the "file.id" property of the device. The DELETE method should be used only to actually remove the device from the VM. Unfortunately we initially implemented this in such a way that DELETE means the same that PUT, and we can't change it now, as it would break backwards compatibility. The previous behavior, without the "current" parameter, is preserved. The documentation is wrong. I openend bug 1145074 to track the issue in the documentation. Thanks for opening the documentation bug! One more question, this bug was filed against RHEV, the duplicate one is an oVirt bug, I assume this bug will be / is fixed as well in RHEV? Yes, it is fixed in RHEV as well. |