Bug 1067407 - Changing the CD of a VM that is down generates a NPE
Summary: Changing the CD of a VM that is down generates a NPE
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.5.1
Assignee: Martin Betak
QA Contact: Ilanit Stein
URL:
Whiteboard: virt
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-20 12:20 UTC by Juan Hernández
Modified: 2016-02-10 19:49 UTC (History)
8 users (show)

Fixed In Version: ovirt-3.5.0_rc2
Clone Of:
Environment:
Last Closed: 2015-01-21 16:03:34 UTC
oVirt Team: Virt
Embargoed:


Attachments (Terms of Use)
Exception in engine.log (12.90 KB, text/x-c)
2014-02-20 12:21 UTC, Juan Hernández
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 31614 0 master MERGED core: Fix NPE on ChangeCD with 'Down' VM Never
oVirt gerrit 31927 0 ovirt-engine-3.5 MERGED core: Fix NPE on ChangeCD with 'Down' VM Never

Description Juan Hernández 2014-02-20 12:20:34 UTC
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>

Comment 1 Juan Hernández 2014-02-20 12:21:33 UTC
Created attachment 865487 [details]
Exception in engine.log

Comment 2 Juan Hernández 2014-02-20 12:24:21 UTC
Note that this issue was detected while working on the Java SDK bug 1060672, but it is a different issue.

Comment 3 Ilanit Stein 2014-11-02 08:24:16 UTC
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>

Comment 4 Sandro Bonazzola 2015-01-21 16:03:34 UTC
oVirt 3.5.1 has been released. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.