Bug 890951

Summary: [ovirt-engine-backend] Can not import exported VM
Product: Red Hat Enterprise Virtualization Manager Reporter: Kiril Nesenko <knesenko>
Component: ovirt-engineAssignee: Liron Aravot <laravot>
Status: CLOSED CURRENTRELEASE QA Contact: Haim <hateya>
Severity: urgent Docs Contact:
Priority: high    
Version: 3.2.0CC: abaron, dfediuck, dyasny, eedri, iheim, laravot, lnatapov, lpeer, myakove, oramraz, Rhev-m-bugs, sgrinber, vvyazmin, yeylon, ykaul
Target Milestone: ---Keywords: Regression, TestBlocker
Target Release: 3.2.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: SF6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 908648, 910667    
Bug Blocks: 862303, 872100, 885459    
Attachments:
Description Flags
logs none

Description Kiril Nesenko 2012-12-31 11:38:48 UTC
Created attachment 670775 [details]
logs

Description of problem:
Can not import exported VM

2012-12-30 21:25:23,384 INFO  [org.ovirt.engine.core.bll.LoginUserCommand] (ajp-/127.0.0.1:8702-14) Checking if user vdcadmin is an admin, result true
2012-12-30 21:25:23,766 ERROR [org.ovirt.engine.core.bll.ImportVmTemplateCommand] (ajp-/127.0.0.1:8702-14) [522] Command org.ovirt.engine.core.bll.ImportVmTemplateCommand throw exception: org.springframework.dao.DuplicateKeyException: CallableStatementCallback; SQL [{call insertvmtemplate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "vm_ovf_generations_pkey"
  Where: SQL statement "INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id) VALUES ( $1 , (SELECT storage_pool_id FROM vds_groups vg WHERE vg.vds_group_id =  $2 ))"
PL/pgSQL function "insertvmtemplate" line 81 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "vm_ovf_generations_pkey"
  Where: SQL statement "INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id) VALUES ( $1 , (SELECT storage_pool_id FROM vds_groups vg WHERE vg.vds_group_id =  $2 ))"
PL/pgSQL function "insertvmtemplate" line 81 at SQL statement
	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1030) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1064) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:388) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:351) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:181) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:124) [engine-dal.jar:]
	at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeModification(SimpleJdbcCallsHandler.java:37) [engine-dal.jar:]
	at org.ovirt.engine.core.dao.VmTemplateDAODbFacadeImpl.save(VmTemplateDAODbFacadeImpl.java:125) [engine-dal.jar:]
	at org.ovirt.engine.core.dao.VmTemplateDAODbFacadeImpl.save(VmTemplateDAODbFacadeImpl.java:27) [engine-dal.jar:]
	at org.ovirt.engine.core.bll.ImportVmTemplateCommand.addVmTemplateToDb(ImportVmTemplateCommand.java:328) [engine-bll.jar:]
	at org.ovirt.engine.core.bll.ImportVmTemplateCommand$1.runInTransaction(ImportVmTemplateCommand.java:247) [engine-bll.jar:]
	at org.ovirt.engine.core.bll.ImportVmTemplateCommand$1.runInTransaction(ImportVmTemplateCommand.java:242) [engine-bll.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [engine-utils.jar:]
	at org.ovirt.engine.core.bll.ImportVmTemplateCommand.executeCommand(ImportVmTemplateCommand.java:242) [engine-bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:997) [engine-bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1082) [engine-bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1463) [engine-bll.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:166) [engine-utils.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:108) [engine-utils.jar:]
	at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:1100) [engine-bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:302) [engine-bll.jar:]
	at org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:358) [engine-bll.jar:]
	at org.ovirt.engine.core.bll.Backend.RunAction(Backend.java:304) [engine-bll.jar:]
	at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source) [:1.7.0_09-icedtea]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09-icedtea]
	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09-icedtea]

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 4 Liron Aravot 2013-01-06 07:28:32 UTC
Ayal, indeed.
Kiril, just to be sure that there's no scenario that we aren't aware of -  did it happend when doing one of the following (both scenarios- not as Clone)? or different flow?
1. export the vm template, delete it and then import it
2. try to import vm template, having a failure and then attempt to import it again

thanks.

Comment 5 Liron Aravot 2013-01-06 14:30:43 UTC
http://gerrit.ovirt.org/#/c/10684/

Comment 6 Kiril Nesenko 2013-01-08 09:27:11 UTC
(In reply to comment #4)
> Ayal, indeed.
> Kiril, just to be sure that there's no scenario that we aren't aware of - 
> did it happend when doing one of the following (both scenarios- not as
> Clone)? or different flow?
> 1. export the vm template, delete it and then import it
Eyal can you post a link to the job to check if this is the scenario ?

> 2. try to import vm template, having a failure and then attempt to import it
> again

We can not do it. It a jenkins job.
> 
> thanks.

Comment 8 Liron Aravot 2013-01-14 15:28:35 UTC
*** Bug 892645 has been marked as a duplicate of this bug. ***

Comment 9 Omer Frenkel 2013-02-10 08:54:42 UTC
*** Bug 895563 has been marked as a duplicate of this bug. ***

Comment 10 Leonid Natapov 2013-02-13 11:48:27 UTC
SF6. template and VMs can be successfully imported from export domain.

Comment 11 Itamar Heim 2013-06-11 09:03:23 UTC
3.2 has been released

Comment 12 Itamar Heim 2013-06-11 09:03:24 UTC
3.2 has been released

Comment 13 Itamar Heim 2013-06-11 09:03:27 UTC
3.2 has been released

Comment 14 Itamar Heim 2013-06-11 09:04:10 UTC
3.2 has been released

Comment 15 Itamar Heim 2013-06-11 09:33:15 UTC
3.2 has been released