Description of problem: After A CD is changed from the rest API: PUT api/vms/xxx/cdroms/yyy;current=True <cdrom id="xxx"> <file id="zzz.iso"/> </cdrom> and getting status 200, trying to verify the change, and senging PUT api/vms/xxx/cdroms/yyy I'm getting <cdrom id="xxx"> <file id="from_config.iso"/> --- instead of zzz.iso </cdrom> Version-Release number of selected component (if applicable): - Found on si24.1 How reproducible: every time Steps to Reproduce: 1. see above 2. 3. Actual results: Getting file from the config: psql -U postgres -d engine -c "select spec_params from vm_device where vm_id = 'd7fc1f3c-8933-4fc6-987b-ef36e40b5199' and device = 'cdrom';" | less -S Expected results: to get the new CD Additional info:
(In reply to comment #0) > Description of problem: > After A CD is changed from the rest API: > PUT api/vms/xxx/cdroms/yyy;current=True > > <cdrom id="xxx"> > <file id="zzz.iso"/> > </cdrom> > > and getting status 200, > > trying to verify the change, and senging PUT api/vms/xxx/cdroms/yyy PUT is update, did you mean GET? > > I'm getting > <cdrom id="xxx"> > <file id="from_config.iso"/> --- instead of zzz.iso > </cdrom> > > > Version-Release number of selected component (if applicable): > - Found on si24.1 > > How reproducible: > every time > > Steps to Reproduce: > 1. see above > 2. > 3. > > Actual results: > Getting file from the config: > psql -U postgres -d engine -c "select spec_params from vm_device where vm_id > = 'd7fc1f3c-8933-4fc6-987b-ef36e40b5199' and device = 'cdrom';" | less -S > > Expected results: > to get the new CD this is by design, new cd is for current session only and does not saved in the db (only passed to vdsm) > > Additional info:
(In reply to comment #1) > (In reply to comment #0) > > Description of problem: > > After A CD is changed from the rest API: > > PUT api/vms/xxx/cdroms/yyy;current=True > > > > <cdrom id="xxx"> > > <file id="zzz.iso"/> > > </cdrom> > > > > and getting status 200, > > > > trying to verify the change, and senging PUT api/vms/xxx/cdroms/yyy > > PUT is update, did you mean GET? > Yes that what I ment: trying to verify the change, and senging GET api/vms/xxx/cdroms/yyy > > > > I'm getting > > <cdrom id="xxx"> > > <file id="from_config.iso"/> --- instead of zzz.iso > > </cdrom> > > > > > > Version-Release number of selected component (if applicable): > > - Found on si24.1 > > > > How reproducible: > > every time > > > > Steps to Reproduce: > > 1. see above > > 2. > > 3. > > > > Actual results: > > Getting file from the config: > > psql -U postgres -d engine -c "select spec_params from vm_device where vm_id > > = 'd7fc1f3c-8933-4fc6-987b-ef36e40b5199' and device = 'cdrom';" | less -S > > > > Expected results: > > to get the new CD > > this is by design, new cd is for current session only and does not > saved in the db (only passed to vdsm) > > > > > Additional info:
The problem is that there is no way to know which cdrom is currently attached to the VM. I have a VM which defined to use CD as second device and attach rhev-tools-setup.iso to it . After running the VM and changing the CD to another one ( with successful event: CD WindowsXP-sp2-vlk.iso was inserted to VM vm1 by vdcadmin ) I still get the original CD which attached to it , even when the VM is still up: https://aqua-rhel.qa.lab.tlv.redhat.com/api/vms/d7fc1f3c-8933-4fc6-987b-ef36e40b5199/cdroms <cdroms><cdrom href="/api/vms/d7fc1f3c-8933-4fc6-987b-ef36e40b5199/cdroms/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"><vm href="/api/vms/d7fc1f3c-8933-4fc6-987b-ef36e40b5199" id="d7fc1f3c-8933-4fc6-987b-ef36e40b5199"/><file id="rhev-tools-setup.iso"/></cdrom></cdroms> The behavior should be same as display type or other dynamic fields.
*** Bug 877003 has been marked as a duplicate of this bug. ***
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.
The bug is still there, could be nice if it is fixed in the near future.
michael - is this in api or in backend in your view?
(In reply to Itamar Heim from comment #9) > michael - is this in api or in backend in your view? both, we need to make the engine being able differentiating between the runtime and config representation of the entity, vm is a good example cause it has RunOnce where config is not persistent (cdrom is a part of vm btw) and api to be able showing both of them (in a generic form of course by adding extra url param).
*** This bug has been marked as a duplicate of bug 1014039 ***