Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1350708

Summary: Hot unplug disk using REST API returns "Internal Server Error"
Product: [oVirt] ovirt-engine Reporter: Raz Tamir <ratamir>
Component: BLL.StorageAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Raz Tamir <ratamir>
Severity: urgent Docs Contact:
Priority: high    
Version: 4.0.0CC: acanan, amureini, bugs, gklein, juan.hernandez, tnisan, ylavi
Target Milestone: ovirt-4.0.1Keywords: Automation, Regression
Target Release: 4.0.1.1Flags: rule-engine: ovirt-4.0.z+
rule-engine: blocker+
tnisan: testing_plan_complete?
ylavi: planning_ack+
tnisan: devel_ack+
acanan: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 06:25:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine and vdsm logs none

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/