Bug 879272

Summary: Adding LIO iSCSI target as storage fails because of LUN ID size being too large for DB scheme
Product: [Retired] oVirt Reporter: vmiszczak
Component: ovirt-engine-coreAssignee: Eli Mesika <emesika>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1 GACC: abaron, acathrow, amureini, dyasny, emesika, iheim, tim, ykaul
Target Milestone: ---   
Target Release: 3.3.4   
Hardware: Unspecified   
OS: Linux   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 879891 (view as bug list) Environment:
Last Closed: 2013-01-17 22:20:02 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:
Bug Depends On:    
Bug Blocks: 879891    

Description vmiszczak 2012-11-22 13:46:40 UTC
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

Comment 1 Eli Mesika 2012-11-22 16:39:39 UTC
http://gerrit.ovirt.org/#/c/9423/

Comment 2 tim 2014-04-15 11:23:25 UTC
Is it possible, that this issue has been reintroduced?

I am using oVirt 3.4 on a CentOS 6.5 host in a hosted-engine scenario.

the installed versions are:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
yum list installed | grep ovirt
otopi.noarch          1.2.0-1.el6       @ovirt-3.4-stable
ovirt-engine-sdk-python.noarch
                      3.4.0.6-1.el6     @ovirt-3.4-stable
ovirt-host-deploy.noarch
                      1.2.0-1.el6       @ovirt-3.4-stable
ovirt-hosted-engine-ha.noarch
                      1.1.2-1.el6       @ovirt-3.4-stable
ovirt-hosted-engine-setup.noarch
                      1.1.2-1.el6       @ovirt-3.4-stable
ovirt-release.noarch  11.1.0-1          @/ovirt-release.noarch
vdsm.x86_64           4.14.6-0.el6      @ovirt-3.4-stable
vdsm-cli.noarch       4.14.6-0.el6      @ovirt-3.4-stable
vdsm-python.x86_64    4.14.6-0.el6      @ovirt-3.4-stable
                      4.14.6-0.el6      @ovirt-3.4-stable
vdsm-xmlrpc.noarch    4.14.6-0.el6      @ovirt-3.4-stable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When I try to add an iSCSI target, I get the following errors in the engines log (they are in German and mean the same as "ERROR: value too long for type character varying(50)"):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-04-15 11:44:01,165 ERROR [org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand] (ajp--127.0.0.1-8702-6) [7e93f718] Command org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand throw exception: org.springframework.dao.DataIntegrityViolationException: CallableStatementCallback; SQL [{call insertstorage_server_connections(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; FEHLER: Wert zu lang für Typ character varying(50)
  Where: SQL-Anweisung »INSERT INTO storage_server_connections(connection, id, iqn, port,portal, password, storage_type, user_name,mount_options,vfs_type,nfs_version,nfs_timeo,nfs_retrans) VALUES( $1 ,  $2 ,  $3 , $4 , $5 ,  $6 ,  $7 ,  $8 , $9 , $10 , $11 , $12 , $13 )«
PL/pgSQL function "insertstorage_server_connections" line 2 at SQL-Anweisung; nested exception is org.postgresql.util.PSQLException: FEHLER: Wert zu lang für Typ character varying(50)
  Where: SQL-Anweisung »INSERT INTO storage_server_connections(connection, id, iqn, port,portal, password, storage_type, user_name,mount_options,vfs_type,nfs_version,nfs_timeo,nfs_retrans) VALUES( $1 ,  $2 ,  $3 , $4 , $5 ,  $6 ,  $7 ,  $8 , $9 , $10 , $11 , $12 , $13 )«
PL/pgSQL function "insertstorage_server_connections" line 2 at SQL-Anweisung
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Comment 3 tim 2014-04-15 12:25:02 UTC
I am sorry - this one would fit to the following bug: 1052839
Could someone move or simply delete my comments?

Although: The bug 1052839 doesn't seem to be fully fixed, as I'm not an upgrade-user but did a complete fresh install...