Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1031717

Summary: Force removal of DataCenter fails to remove vm_pool from DB
Product: Red Hat Enterprise Virtualization Manager Reporter: sefi litmanovich <slitmano>
Component: ovirt-engineAssignee: Omer Frenkel <ofrenkel>
Status: CLOSED CURRENTRELEASE QA Contact: sefi litmanovich <slitmano>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, gklein, iheim, lpeer, mavital, michal.skrivanek, ofrenkel, Rhev-m-bugs, sbonazzo, sherold, yeylon
Target Milestone: ---Keywords: ZStream
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: ovirt-3.4.0-beta3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1069219 (view as bug list) Environment:
Last Closed: 2014-06-12 14:04:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1069219, 1078909, 1142926    
Attachments:
Description Flags
engine.log none

Description sefi litmanovich 2013-11-18 15:28:16 UTC
Created attachment 825729 [details]
engine.log

Description of problem:

Force removal of DataCenter fails to remove a vm_pool that was created on this DC from the vm_pool table in DB.
After I force removed the DC, all the vms from that pool were deleted and the vm_pool was delted from the webadmin manue.
I then tried to remove the cluster which was related to the deleted DC and that failed.
looking at engine.log I saw the following ERROR:

2013-11-18 17:02:16,368 ERROR [org.ovirt.engine.core.bll.RemoveVdsGroupCommand] (pool-5-thread-50) [56101ce] Command org.ovirt.eng
ine.core.bll.RemoveVdsGroupCommand throw exception: org.springframework.dao.DataIntegrityViolationException: CallableStatementCall
back; SQL [{call deletevdsgroup(?)}]; ERROR: update or delete on table "vds_groups" violates foreign key constraint "fk_vds_groups
_vm_pools" on table "vm_pools"
  Detail: Key (vds_group_id)=(feace1c4-bae7-412a-9684-24d20813fedc) is still referenced from table "vm_pools".
  Where: SQL statement "DELETE FROM vds_groups WHERE vds_group_id =  $1 "
PL/pgSQL function "deletevdsgroup" line 7 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: update o
r delete on table "vds_groups" violates foreign key constraint "fk_vds_groups_vm_pools" on table "vm_pools"
  Detail: Key (vds_group_id)=(feace1c4-bae7-412a-9684-24d20813fedc) is still referenced from table "vm_pools".
  Where: SQL statement "DELETE FROM vds_groups WHERE vds_group_id =  $1 "
PL/pgSQL function "deletevdsgroup" line 7 at SQL statement......

I then saw the pool I once created was still existing in vm_pool table in DB.
After manually deleting it, cluster removal worked just fine.


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


Steps to Reproduce:
1.create DC-cluster-host-vmpool
2.create more dc's and cluster and detach the first one from any hosts.
3.force remove first Dc
4. remove cluster

Actual results:

1. upon removal of DC vm's from pool and pool itself do not appear in webadmin.
2. vm pool isn't deleted from DB
3. remove cluster fails

Expected results:

1. upon removal of DC vm's from pool and pool itself do not appear in webadmin.
2. vm pool is deleted from DB
3. remove cluster succeds

Comment 3 Sandro Bonazzola 2014-02-19 11:58:46 UTC
all patches merged

Comment 4 Sandro Bonazzola 2014-02-19 12:26:56 UTC
This bug is referenced in ovirt-engine-3.4.0-beta3 logs. Moving to ON_QA

Comment 6 sefi litmanovich 2014-02-23 10:31:56 UTC
Verified with ovirt-engine-3.4.0-0.11.beta3.el6.noarch.

reproduced according to the steps mentioned on bz description:

1) created DC-cluster-host
2)created vm - template - vm pool
3) created a new DC-cluster
4) attached the host to the new DC-Cluster
5) Force removed original DC
6) Verified that the vm pool was deleted from DB
7) removed the original cluster - worked with no failure

Comment 8 Itamar Heim 2014-06-12 14:04:59 UTC
Closing as part of 3.4.0