On Mon, Nov 12, 2012 at 7:49 AM, Daniel Rowe <span dir="ltr"><<a href="mailto:daniel.fathom13@gmail.com" target="_blank">daniel.fathom13@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi<br><br>I was able to import one VM from libvirt. I am able to get the VM into the export storage fine.<br>
<br>Any VMs I try and import after the first one fails and I get below in the logs any way to work around this?<br>
<br>2012-11-12 07:44:56,366 ERROR [org.ovirt.engine.core.bll.ImportVmCommand] (pool-3-thread-46) [7c3538ee] Command org.ovirt.engine.core.bll.ImportVmCommand throw exception: org.springframework.dao.DataIntegrityViolationException: CallableStatementCallback; SQL [{call insertsnapshot(?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "pk_snapshots"<br>
Detail: Key (snapshot_id)=(00000000-0000-0000-0000-000000000000) already exists.<br> Where: SQL statement "INSERT INTO snapshots(<br> snapshot_id,<br> status,<br> vm_id,<br> snapshot_type,<br>
description,<br> creation_date,<br> app_list,<br> vm_configuration)<br> VALUES(<br> v_snapshot_id,<br> v_status,<br> v_vm_id,<br> v_snapshot_type,<br> v_description,<br>
v_creation_date,<br> v_app_list,<br> v_vm_configuration)"<br>PL/pgSQL function "insertsnapshot" line 3 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_snapshots"<br>
Detail: Key (snapshot_id)=(00000000-0000-0000-0000-000000000000) already exists.<br> Where: SQL statement "INSERT INTO snapshots(<br> snapshot_id,<br> status,<br> vm_id,<br> snapshot_type,<br>
description,<br> creation_date,<br> app_list,<br> vm_configuration)<br> VALUES(<br> v_snapshot_id,<br> v_status,<br> v_vm_id,<br> v_snapshot_type,<br> v_description,<br>
v_creation_date,<br> v_app_list,<br> v_vm_configuration)"<br>PL/pgSQL function "insertsnapshot" line 3 at SQL statement<br> at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:228) [spring-jdbc-2.5.6.SEC02.jar:2.5.6.SEC02]<br>
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) [spring-jdbc-2.5.6.SEC02.jar:2.5.6.SEC02]<br> at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:952) [spring-jdbc-2.5.6.SEC02.jar:2.5.6.SEC02]<br>
at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:985) [spring-jdbc-2.5.6.SEC02.jar:2.5.6.SEC02]<br> at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:368) [spring-jdbc-2.5.6.SEC02.jar:2.5.6.SEC02]<br>
at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:342) [spring-jdbc-2.5.6.SEC02.jar:2.5.6.SEC02]<br> at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:164) [spring-jdbc-2.5.6.SEC02.jar:2.5.6.SEC02]<br>
at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:124) [engine-dal.jar:]<br> at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeModification(SimpleJdbcCallsHandler.java:37) [engine-dal.jar:]<br>
at org.ovirt.engine.core.dao.DefaultGenericDaoDbFacade.save(DefaultGenericDaoDbFacade.java:93) [engine-dal.jar:]<br> at org.ovirt.engine.core.bll.ImportVmCommand.addVmImagesAndSnapshots(ImportVmCommand.java:615) [engine-bll.jar:]<br>
at org.ovirt.engine.core.bll.ImportVmCommand.access$200(ImportVmCommand.java:76) [engine-bll.jar:]<br> at org.ovirt.engine.core.bll.ImportVmCommand$4.runInTransaction(ImportVmCommand.java:501) [engine-bll.jar:]<br>
at org.ovirt.engine.core.bll.ImportVmCommand$4.runInTransaction(ImportVmCommand.java:497) [engine-bll.jar:]<br> at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:204) [engine-utils.jar:]<br>
at org.ovirt.engine.core.bll.ImportVmCommand.processImages(ImportVmCommand.java:497) [engine-bll.jar:]<br> at org.ovirt.engine.core.bll.ImportVmCommand.executeCommand(ImportVmCommand.java:477) [engine-bll.jar:]<br>
at org.ovirt.engine.core.bll.CommandBase.ExecuteWithoutTransaction(CommandBase.java:804) [engine-bll.jar:]<br> at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:896) [engine-bll.jar:]<br>
at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1203) [engine-bll.jar:]<br> at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:168) [engine-utils.jar:]<br>
at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:107) [engine-utils.jar:]<br> at org.ovirt.engine.core.bll.CommandBase.Execute(CommandBase.java:911) [engine-bll.jar:]<br>
at org.ovirt.engine.core.bll.CommandBase.ExecuteAction(CommandBase.java:268) [engine-bll.jar:]<br> at org.ovirt.engine.core.bll.MultipleActionsRunner.executeValidatedCommands(MultipleActionsRunner.java:182) [engine-bll.jar:]<br>
at org.ovirt.engine.core.bll.MultipleActionsRunner.RunCommands(MultipleActionsRunner.java:162) [engine-bll.jar:]<br> at org.ovirt.engine.core.bll.MultipleActionsRunner$1.run(MultipleActionsRunner.java:84) [engine-bll.jar:]<br>
at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:64) [engine-utils.jar:]<br> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_09-icedtea]<br>
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_09-icedtea]<br> at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_09-icedtea]<br> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09-icedtea]<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09-icedtea]<br> at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]<br>Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_snapshots"<br>
Detail: Key (snapshot_id)=(00000000-0000-0000-0000-000000000000) already exists.<br> Where: SQL statement "INSERT INTO snapshots(<br> snapshot_id,<br> status,<br> vm_id,<br> snapshot_type,<br>
description,<br> creation_date,<br> app_list,<br> vm_configuration)<br> VALUES(<br> v_snapshot_id,<br> v_status,<br> v_vm_id,<br> v_snapshot_type,<br> v_description,<br>
v_creation_date,<br> v_app_list,<br> v_vm_configuration)"<br>PL/pgSQL function "insertsnapshot" line 3 at SQL statement<br> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)<br>
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)<br> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)<br> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)<br>
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)<br> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:381)<br> at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.execute(CachedPreparedStatement.java:297)<br>
at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:404)<br> at org.springframework.jdbc.core.JdbcTemplate$5.doInCallableStatement(JdbcTemplate.java:987) [spring-jdbc-2.5.6.SEC02.jar:2.5.6.SEC02]<br>
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:936) [spring-jdbc-2.5.6.SEC02.jar:2.5.6.SEC02]<br> ... 31 more<br><br>Regards<span class=""><font color="#888888"><br>Daniel<br></font></span></blockquote>
<div> </div></div>Doing a select * from snapshots; there is indeed a snapshot with that ID. I took a punt and and did a delete from snapshots where snapshot_id = '00000000-0000-0000-0000-000000000000'; and I can now import VMs again.<br>
</div>