Bug 1326003

Summary: Can't update direct lun using the API
Product: [oVirt] ovirt-engine Reporter: Raz Tamir <ratamir>
Component: RestAPIAssignee: Allon Mureinik <amureini>
Status: CLOSED CURRENTRELEASE QA Contact: Raz Tamir <ratamir>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.6.5.1CC: bugs, sbonazzo, tnisan
Target Milestone: ovirt-4.0.0-betaKeywords: Automation
Target Release: 4.0.0Flags: rule-engine: ovirt-4.0.0+
rule-engine: planning_ack+
amureini: devel_ack+
acanan: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-05 07:45:18 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-04-11 14:46:59 UTC
Created attachment 1146009 [details]
engine and vdsm logs

Description of problem:
When trying to sending PUT request to /api/vms/{vm_id}/disks/{disk_id}

<disk>
  <name>new_name</name>
</disk>

and the disk_id belongs to direct lun, the returned status is 500 Internal Server Error.
From engine.log:
2016-04-11 17:39:47,901 ERROR [org.ovirt.engine.api.restapi.resource.validation.MappingExceptionMapper] (ajp-/127.0.0.1:8702-1) [] Mapping exception while processing "PUT" request for path "/vms/72bd56eb-470d-40a8-940a-06bd0ee36ea0/disks/54cb9a3a-12e0-4f95-94bd-6b787f479322"
2016-04-11 17:39:47,902 ERROR [org.ovirt.engine.api.restapi.resource.validation.MappingExceptionMapper] (ajp-/127.0.0.1:8702-1) [] Exception: org.ovirt.engine.api.restapi.utils.MappingException: java.lang.reflect.InvocationTargetException


For non direct lun the request working fine


Version-Release number of selected component (if applicable):
rhevm-3.6.5.1-0.1.el6.noarch
vdsm-4.17.25-0.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a direct lun disk
2. Attach it to vm
3. Try to update it using REST API

Actual results:
The returned status is 500 Internal Server Error.

Expected results:


Additional info:

Comment 1 Allon Mureinik 2016-04-11 16:36:25 UTC
The error comes from the rest API layer, adjusting component accordingly. What happens here is since the incoming disk does not have a lun storage section the mapper (wrongly) attempts to treat it as a DiskImage, and, of course, fails.

The solution should be to treat the incoming disk as lun if either it on the existing engine disk could be identified as LUN disks.
I've successfully reproduced the issue on the current master (commit 6abe9f037b842681e06c5fc550bad8d82344394c), patch in the works.

Comment 2 Raz Tamir 2016-06-15 20:04:20 UTC
Verification is blocked because bug https://bugzilla.redhat.com/show_bug.cgi?id=1346752

Comment 3 Raz Tamir 2016-07-03 11:20:17 UTC
Verified on rhevm-4.0.2-0.2.rc1.el7ev.noarch

Comment 4 Sandro Bonazzola 2016-07-05 07:45:18 UTC
oVirt 4.0.0 has been released, closing current release.