This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 879891 - Adding LIO iSCSI target as storage fails because of LUN ID size being too large for DB scheme
Adding LIO iSCSI target as storage fails because of LUN ID size being too lar...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
unspecified
Unspecified Linux
unspecified Severity medium
: ---
: 3.2.0
Assigned To: Eli Mesika
Leonid Natapov
storage
: TestOnly
Depends On: 879272
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-25 03:10 EST by Ayal Baron
Modified: 2016-02-10 13:24 EST (History)
10 users (show)

See Also:
Fixed In Version: sf3
Doc Type: Bug Fix
Doc Text:
Cause: Current Lun Id size was 50 characters which does not support LIO iSCSI targets. Consequence: Fix: Adding LIO iSCSI target as storage fails because of LUN ID size being too large for DB scheme Extending LunId in luns and lun_storage_server_connection_map tables to 255 Result: LIO iSCSI can be added
Story Points: ---
Clone Of: 879272
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Ayal Baron 2012-11-25 03:10:04 EST
+++ This bug was initially created as a clone of Bug #879272 +++

Hi guys,

I was trying to add an LIO iSCSI target as data domain into ovirt and it failed.

The GUI reported :
Error: A Request to the Server failed with the following Status Code: 503

And the engine log reports :
2012-11-22 10:05:10,154 INFO  [org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand] (ajp--0.0.0.0-8009-3) [7ff25919] Running command: AddSANStorageDomainCommand internal: false. Entities affected :  ID: aaa00000-0000-0000-0000-123456789aaa Type: System
2012-11-22 10:05:10,177 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVGVDSCommand] (ajp--0.0.0.0-8009-3) [7ff25919] START, CreateVGVDSCommand(vdsId = 936326ca-3482-11e2-a6fc-6f050df067da, storageDomainId=6e93ed9e-1dd7-42b7-9e93-dc0187cc6fde, deviceList=[50103ff106001405db2776165d33492091bde115a020100344c494f2d4f52470049424c4f434b3a64623237373631362d356433332d343932302d393162642d]), log id: 7bbd158c
2012-11-22 10:05:10,904 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVGVDSCommand] (ajp--0.0.0.0-8009-3) [7ff25919] FINISH, CreateVGVDSCommand, return: LvKD1i-L68S-ix09-OYcr-Ytzd-93wh-8XFe8e, log id: 7bbd158c
2012-11-22 10:05:10,913 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStorageDomainVDSCommand] (ajp--0.0.0.0-8009-3) [7ff25919] START, CreateStorageDomainVDSCommand(vdsId = 936326ca-3482-11e2-a6fc-6f050df067da, storageDomain=org.ovirt.engine.core.common.businessentities.storage_domain_static@cd3431b, args=LvKD1i-L68S-ix09-OYcr-Ytzd-93wh-8XFe8e), log id: 56c4cbde
2012-11-22 10:05:17,332 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStorageDomainVDSCommand] (ajp--0.0.0.0-8009-3) [7ff25919] FINISH, CreateStorageDomainVDSCommand, log id: 56c4cbde
2012-11-22 10:05:17,338 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand] (ajp--0.0.0.0-8009-3) [7ff25919] START, GetStorageDomainStatsVDSCommand(vdsId = 936326ca-3482-11e2-a6fc-6f050df067da, storageDomainId=6e93ed9e-1dd7-42b7-9e93-dc0187cc6fde), log id: 5142061
2012-11-22 10:05:17,654 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand] (ajp--0.0.0.0-8009-3) [7ff25919] FINISH, GetStorageDomainStatsVDSCommand, return: org.ovirt.engine.core.common.businessentities.storage_domains@68e03e79, log id: 5142061
2012-11-22 10:05:17,674 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVGInfoVDSCommand] (ajp--0.0.0.0-8009-3) [7ff25919] START, GetVGInfoVDSCommand(vdsId = 936326ca-3482-11e2-a6fc-6f050df067da, VGID=LvKD1i-L68S-ix09-OYcr-Ytzd-93wh-8XFe8e), log id: 52756b80
2012-11-22 10:05:17,739 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVGInfoVDSCommand] (ajp--0.0.0.0-8009-3) [7ff25919] FINISH, GetVGInfoVDSCommand, return: [org.ovirt.engine.core.common.businessentities.LUNs@53a8c83f], log id: 52756b80
2012-11-22 10:05:17,758 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (ajp--0.0.0.0-8009-3) [7ff25919] transaction rolled back
2012-11-22 10:05:17,759 ERROR [org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand] (ajp--0.0.0.0-8009-3) [7ff25919] Command org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand throw exception: org.springframework.dao.DataIntegrityViolationException: CallableStatementCallback; SQL [{call insertluns(?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: value too long for type character varying(50)
  Where: SQL statement "INSERT INTO LUNs(LUN_id, physical_volume_id, volume_group_id, serial, lun_mapping, vendor_id, product_id, device_size) VALUES( $1 ,  $2 ,  $3 ,  $4 ,  $5 ,  $6 ,  $7 ,  $8 )"
PL/pgSQL function "insertluns" line 2 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(50)
  Where: SQL statement "INSERT INTO LUNs(LUN_id, physical_volume_id, volume_group_id, serial, lun_mapping, vendor_id, product_id, device_size) VALUES( $1 ,  $2 ,  $3 ,  $4 ,  $5 ,  $6 ,  $7 ,  $8 )"



Having fixed both "LUNs" and "LUN_storage_server_connection_map" tables varchar sizes (to 256), adding my LIO storage is OK as expected.

create_tables.sql script should be fixed.

What’s more, when the error happened, ovirt got in inconsistent state : 
-the LUN appeared in ovirt but was locked. Trying to destroy it did nothing in the GUI. Engine logged “Failed to Acquire Lock to object EngineLock”. After a while, the LUN disappeared by itself.

Ovirt should handle the exception correctly (by totally refusing the LUN registration) and outputting an explicit message (instead of “error 503”) could be nice.


My configuration : 
oVirt Engine Version: 3.1.0-3.19.el6 (Dreyou repo) running on stock Centos6.3
LIO Target running on Centos6.3/3.6.3-1.el6.elrepo.x86_64 kernel
Ovirt node running on latest Fedora17

Regards

--- Additional comment from Eli Mesika on 2012-11-22 11:39:39 EST ---

http://gerrit.ovirt.org/#/c/9423/
Comment 1 Leonid Natapov 2013-01-21 08:18:40 EST
sf3. fixed.

Table "public.luns"
lun_id             | character varying(255)  | not null


Table "public.lun_storage_server_connection_map"
lun_id                    | character varying(255) | not null
Comment 3 Itamar Heim 2013-06-11 05:40:38 EDT
3.2 has been released
Comment 4 Itamar Heim 2013-06-11 05:41:07 EDT
3.2 has been released
Comment 5 Itamar Heim 2013-06-11 05:53:58 EDT
3.2 has been released

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