Bug 1350708 - Hot unplug disk using REST API returns "Internal Server Error"
Summary: Hot unplug disk using REST API returns "Internal Server Error"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: ovirt-4.0.1
: 4.0.1.1
Assignee: Tal Nisan
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-28 08:06 UTC by Raz Tamir
Modified: 2016-07-19 06:25 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-07-19 06:25:31 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
tnisan: testing_plan_complete?
ylavi: planning_ack+
tnisan: devel_ack+
acanan: testing_ack+


Attachments (Terms of Use)
engine and vdsm logs (1.40 MB, application/x-gzip)
2016-06-28 08:06 UTC, Raz Tamir
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 59926 0 master MERGED core: Fix detach a disk from VM while the VM is running 2016-06-29 12:20:46 UTC
oVirt gerrit 59928 0 ovirt-engine-4.0 MERGED core: Fix detach a disk from VM while the VM is running 2016-06-29 12:21:34 UTC

Description Raz Tamir 2016-06-28 08:06:31 UTC
Created attachment 1173297 [details]
engine and vdsm logs

Description of problem:
When trying to hot unplug vm's disk using REST API, I get:
Status: 500
Reason: Internal Server Error
Detail: [General command validation failure.]


Version-Release number of selected component (if applicable):
ovirt-engine-4.0.0.6-0.1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with 1 disk with OS
2. Attache second disk to vm
3. Start the vm
4. send DELETE request to /api/vms/{vm:id}/disks/{disk:id}
body:

<action>
    <detach>true</detach>
</action>


Actual results:


Expected results:


Additional info:

Comment 1 Raz Tamir 2016-06-28 08:07:50 UTC
It was tested with API v3

Comment 2 Juan Hernández 2016-06-28 08:14:33 UTC
I think that the relevant log message is this one:

  ERROR [org.ovirt.engine.core.bll.storage.disk.DetachDiskFromVmCommand] (default task-8) [30d0c59c] Error during ValidateFailure.: java.lang.NullPointerException
	at org.ovirt.engine.core.bll.VmCommand.isDiskSupportedForPlugUnPlug(VmCommand.java:395)

Apparently the code is assuming that "getDiskInterface" will always return something, but it returns null in this case:

  if (CollectionUtils.isEmpty(diskHotpluggableInterfaces)
      || !diskHotpluggableInterfaces.contains(diskVmElement.getDiskInterface().name())) {
    return failValidation(EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED);
  }

This may be related to the recent change that moves disk interface and bootable properties from the disk to the disk element.

Tal, can you take a look, please?

Comment 3 Red Hat Bugzilla Rules Engine 2016-06-28 09:03:16 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 4 Raz Tamir 2016-07-03 11:25:08 UTC
Verified on rhevm-4.0.2-0.2.rc1.el7ev.noarch

Comment 5 Sandro Bonazzola 2016-07-19 06:25:31 UTC
Since the problem described in this bug report should be
resolved in oVirt 4.0.1 released on July 19th 2016, it has been closed with a
resolution of CURRENT RELEASE.

For information on the release, and how to update to this release, follow the link below.

If the solution does not work for you, open a new bug report.

http://www.ovirt.org/release/4.0.1/


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