This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 906360 - [rest-api] created direct lun has missing values in db
[rest-api] created direct lun has missing values in db
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
x86_64 Linux
unspecified Severity urgent
: ---
: 3.2.0
Assigned To: Liron Aravot
Katarzyna Jachim
: Regression, TestBlocker
Depends On:
  Show dependency treegraph
Reported: 2013-01-31 08:56 EST by Jakub Libosvar
Modified: 2016-02-10 14:19 EST (History)
12 users (show)

See Also:
Fixed In Version: sf10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
engine.log (44.84 KB, text/x-log)
2013-01-31 08:56 EST, Jakub Libosvar
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 10630 None None None Never
oVirt gerrit 11807 None None None Never

  None (edit)
Description Jakub Libosvar 2013-01-31 08:56:14 EST
Created attachment 690914 [details]

Description of problem:
Lun was created by sending POST to api/disks with body
        <logical_unit id="360014055ff2afd2a4474cc2b44d65b0e">

Obtained response:
<disk href="/api/disks/85887360-4458-4536-9269-a2822b722cd9" id="85887360-4458-4536-9269-a2822b722cd9">
    <link href="/api/disks/85887360-4458-4536-9269-a2822b722cd9/permissions" rel="permissions"/>
    <link href="/api/disks/85887360-4458-4536-9269-a2822b722cd9/statistics" rel="statistics"/>
    <lun_storage id="360014055ff2afd2a4474cc2b44d65b0e">
        <logical_unit id="360014055ff2afd2a4474cc2b44d65b0e">

Luns table content:
[root@jl-rhevm32 ~]# psql  engine postgres -c "select * from luns;"
           physical_volume_id           |              lun_id               |            volume_group_id             |                             serial    
                         | lun_mapping | vendor_id | product_id | device_size 
                                        |360014055ff2afd2a4474cc2b44d65b0e   |                                        |                                       
                         |             |           |            |           0

When user wants to remove this lun, it fails and NPE is thrown:
2013-01-31 14:56:32,697 ERROR [org.ovirt.engine.core.bll.RemoveDiskCommand] (ajp-/ [688166c0] Command org.ovirt.engine.core.bll.RemoveDiskCommand throw exception: java.lang.NullPointerException
	at [engine-bll.jar:]
	at org.ovirt.engine.core.bll.ImagesHandler.removeLunDisk( [engine-bll.jar:]
	at org.ovirt.engine.core.bll.RemoveDiskCommand$1.runInTransaction( [engine-bll.jar:]
	at org.ovirt.engine.core.bll.RemoveDiskCommand$1.runInTransaction( [engine-bll.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction( [engine-utils.jar:]
	at org.ovirt.engine.core.bll.RemoveDiskCommand.removeLunDisk( [engine-bll.jar:]
	at org.ovirt.engine.core.bll.RemoveDiskCommand.executeCommand( [engine-bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction( [engine-bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope( [engine-bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.runInTransaction( [engine-bll.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed( [engine-utils.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope( [engine-utils.jar:]
	at org.ovirt.engine.core.bll.CommandBase.execute( [engine-bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeAction( [engine-bll.jar:]
	at org.ovirt.engine.core.bll.Backend.runActionImpl( [engine-bll.jar:]
	at org.ovirt.engine.core.bll.Backend.RunAction( [engine-bll.jar:]
	at sun.reflect.GeneratedMethodAccessor192.invoke(Unknown Source) [:1.7.0_11-icedtea]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke( [rt.jar:1.7.0_11-icedtea]
	at java.lang.reflect.Method.invoke( [rt.jar:1.7.0_11-icedtea]

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create direct lun via API
2. Remove direct lun

Additional info:
We had similar (same?) issue on 3.1: bug 863101
Backend log attached
Comment 2 Liron Aravot 2013-02-06 07:33:20 EST

solved by this patch, basically the luns are getting with "" in the volume group id from gui and with null from REST -
this patch solved another issue, but solves this one as well..
will backport it.
Comment 3 Liron Aravot 2013-02-06 08:15:01 EST
forgot to mention - in addition, a db script should be introduced to update previous luns volume group value to avoid the problem from occuring with previously added luns.
Comment 4 Katarzyna Jachim 2013-04-08 06:11:07 EDT
Verified manually on 3.2.0-10.17.master.el6ev that adding disks with REST API works correctly.
Comment 5 Itamar Heim 2013-06-11 05:07:53 EDT
3.2 has been released
Comment 6 Itamar Heim 2013-06-11 05:07:53 EDT
3.2 has been released
Comment 7 Itamar Heim 2013-06-11 05:07:54 EDT
3.2 has been released
Comment 8 Itamar Heim 2013-06-11 05:36:29 EDT
3.2 has been released

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