Trying to change the CD of a VM that is down triggers a NPE. The problem is that we are trying to calculate the actual path to the CD image before verifying the state of the VM and of the storage domain. It can be reproduces as follows: curl \ -k \ -X PUT \ -H "Accept: application/xml" \ -H "Content-Type: application/xml" \ -d ' <cdrom id="00000000-0000-0000-0000-000000000000"> <file id="the_name_of_the_iso_file"/> </cdrom> ' \ -u admin@internal:redhat123 \ 'https://rhel.example.com/api/vms/the_id_of_the_vm/cdroms/00000000-0000-0000-0000-000000000000;current=true' The result of this currently is the following: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <fault> <reason>Operation Failed</reason> <detail>[General command validation failure.]</detail> </fault> And the following exception in the attached engine.log file. The expected result is this one: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <fault> <reason>Operation Failed</reason> <detail>[Cannot Change CD VM because it is in Down status.]</detail> </fault>
Created attachment 865487 [details] Exception in engine.log
Note that this issue was detected while working on the Java SDK bug 1060672, but it is a different issue.
Verified on vt8: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <fault> <reason>Operation Failed</reason> <detail>[Cannot Change CD VM because the VM is in Down status.]</detail> </fault>
oVirt 3.5.1 has been released. If problems still persist, please make note of it in this bug report.