Bug 788172 - ovirt-engine-core: force remove of DC fails if storage domain has template residing on it
Summary: ovirt-engine-core: force remove of DC fails if storage domain has template re...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: unspecified
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: 3.3.4
Assignee: Nobody's working on this, feel free to take it
QA Contact:
URL:
Whiteboard: storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-07 16:09 UTC by Dafna Ron
Modified: 2016-02-10 17:06 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-12 07:36:28 UTC
oVirt Team: Storage


Attachments (Terms of Use)
log (28.17 KB, application/x-gzip)
2012-02-07 16:09 UTC, Dafna Ron
no flags Details

Description Dafna Ron 2012-02-07 16:09:10 UTC
Created attachment 559997 [details]
log

Description of problem:

force remove DC will fail when there are template on storage domain. 

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

ovirt-engine-backend-3.0.0_0001-1.4.fc16.x86_64

How reproducible:

100%

Steps to Reproduce:
1. create DC with one domain+vm+template on it
2. put domain in maintenance 
3. try to force remove the DC
  
Actual results:

remove will fail

Expected results:

we should be able to remove

Additional info: full log attached

2012-02-07 18:02:16,402 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (http--0.0.0.0-8080-5) transaction rolled back
2012-02-07 18:02:16,402 ERROR [org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand] (http--0.0.0.0-8080-5) Command org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand throw exception: org.springframework.dao.DataIntegrityVi
olationException: CallableStatementCallback; SQL [{call force_delete_storage_domain(?)}]; ERROR: update or delete on table "image_templates" violates foreign key constraint "image_templates_vm_template_image_map" on table "vm_template_im
age_map"
  Detail: Key (it_guid)=(00000000-0000-0000-0000-000000000000) is still referenced from table "vm_template_image_map".
  Where: SQL statement "delete FROM image_templates where it_guid in(select it_guid from tt_TEMPTEMPLATEIMAGESTABLE)"
PL/pgSQL function "force_delete_storage_domain" line 45 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "image_templates" violates foreign key constraint "image_templates_vm_templ
ate_image_map" on table "vm_template_image_map"
  Detail: Key (it_guid)=(00000000-0000-0000-0000-000000000000) is still referenced from table "vm_template_image_map".
  Where: SQL statement "delete FROM image_templates where it_guid in(select it_guid from tt_TEMPTEMPLATEIMAGESTABLE)"
PL/pgSQL function "force_delete_storage_domain" line 45 at SQL statement
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:228) [spring-jdbc-2.5.6.SEC02.jar:]
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) [spring-jdbc-2.5.6.SEC02.jar:]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:952) [spring-jdbc-2.5.6.SEC02.jar:]
        at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:985) [spring-jdbc-2.5.6.SEC02.jar:]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:368) [spring-jdbc-2.5.6.SEC02.jar:]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:342) [spring-jdbc-2.5.6.SEC02.jar:]
        at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:164) [spring-jdbc-2.5.6.SEC02.jar:]
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:112) [engine-dal.jar:]
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeModification(SimpleJdbcCallsHandler.java:39) [engine-dal.jar:]
        at org.ovirt.engine.core.dao.StorageDomainDAODbFacadeImpl.remove(StorageDomainDAODbFacadeImpl.java:144) [engine-dal.jar:]
        at org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand$10.runInTransaction(RemoveStoragePoolCommand.java:262) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand$10.runInTransaction(RemoveStoragePoolCommand.java:253) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:204) [utils-3.0.0-0001.jar:]
        at org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.removeDomainFromDb(RemoveStoragePoolCommand.java:253) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.forceRemoveStorageDomains(RemoveStoragePoolCommand.java:121) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.executeCommand(RemoveStoragePoolCommand.java:74) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.ExecuteWithoutTransaction(CommandBase.java:617) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:709) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:978) [engine-bll.jar:]

Comment 1 Itamar Heim 2012-12-12 07:36:28 UTC
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.


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