Bug 996934

Summary: Force remove of data center fails
Product: Red Hat Enterprise Virtualization Manager Reporter: Moti Asayag <masayag>
Component: ovirt-engineAssignee: Moti Asayag <masayag>
Status: CLOSED CURRENTRELEASE QA Contact: Meni Yakove <myakove>
Severity: high Docs Contact:
Priority: high    
Version: 3.3.0CC: acathrow, iheim, lpeer, myakove, Rhev-m-bugs, yeylon
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: network
Fixed In Version: is11 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: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Moti Asayag 2013-08-14 10:11:33 UTC
Description of problem:
Attempt to force-remove a data center which contains VMs that are using vnic profiles fails.

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


How reproducible:
always

Steps to Reproduce:
1. Create a DC (add cluster, storage, host)
2. Add a vm with vnic that uses a profile.
3. Try to force remove the data center

Actual results:
Action fails with 5001 error.

Expected results:
DC should be removed.

Additional info:
The network elements are being removed prior to the vm removal therefore referenced vnic profiles caused this operation to fail:

b28b6eb1-680b-4e01-9c6d-95532411be18 Type: StoragePool
2013-08-14 10:25:20,222 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (http--0.0.0.0-8080-2) transaction rolled back
2013-08-14 10:25:20,223 ERROR [org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand] (http--0.0.0.0-8080-2) Command org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand throw exception: org.springframework.dao.DataIntegrityViolationException: CallableStatementCallback; SQL [{call deletevnicprofile(?)}]; ERROR: update or delete on table "vnic_profiles" violates foreign key constraint "fk_vm_interface_vnic_profile_id" on table "vm_interface"
  Detail: Key (id)=(0000000f-000f-000f-000f-00000000000f) is still referenced from table "vm_interface".
  Where: SQL statement "DELETE FROM vnic_profiles WHERE id =  $1 "
PL/pgSQL function "deletevnicprofile" line 5 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "vnic_profiles" violates foreign key constraint "fk_vm_interface_vnic_profile_id" on table "vm_interface"
  Detail: Key (id)=(0000000f-000f-000f-000f-00000000000f) is still referenced from table "vm_interface".
  Where: SQL statement "DELETE FROM vnic_profiles WHERE id =  $1 "
PL/pgSQL function "deletevnicprofile" line 5 at SQL statement
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:245) [spring-jdbc.jar:3.1.1.RELEASE]

Comment 1 Meni Yakove 2013-08-22 14:39:35 UTC
rhevm-3.3.0-0.16.master.el6ev.noarch

Comment 2 Itamar Heim 2014-01-21 22:21:07 UTC
Closing - RHEV 3.3 Released

Comment 3 Itamar Heim 2014-01-21 22:26:33 UTC
Closing - RHEV 3.3 Released