Bug 789267

Summary: cannot destroy district after remove node with app
Product: OKD Reporter: Meng Bo <bmeng>
Component: ContainersAssignee: Dan McPherson <dmcphers>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.x   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-10 15:18:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Meng Bo 2012-02-10 08:41:06 UTC
Description of problem:
remove node with app from district, then try to destroy the district, got fail.

Version-Release number of selected component (if applicable):
rhc-broker-0.86.1-1.git.161.f3d1f3a.el6.noarch

How reproducible:
always

Steps to Reproduce:
1.create a district
#rhc-admin-ctl-district -n d1 -c create
2.add a node to the district
#rhc-admin-ctl-district -n d1 -c add-node -i host1
3.create app on the node 
#rhc-create-app -a testapp -t php-5.3
4.remove the node from the district
#rhc-admin-ctl-district -n d1 -c deactivate-node -i host1
#rhc-admin-ctl-district -n d1 -c remove-node -i host1
5.try to destroy the district
#rhc-admin-ctl-district -n d1 -c destroy
  
Actual results:
[root@ip-10-140-2-180 ~]# rhc-admin-ctl-district -n d2 -c destroy
!!!! WARNING !!!! WARNING !!!! WARNING !!!!
You are about to destroy the d2 district.

This is NOT reversible, all remote data for this district will be removed.
Do you want to destroy this district (y/n): y
ERROR OUTPUT:
Couldn't destroy district 'a352059d64d741dc90f7abb2d7aabac5' because it still contains applications and/or nodes



Expected results:
the district should be destroyed successfully

Additional info:
[root@ip-10-140-2-180 ~]# rhc-admin-ctl-district -n d2 


{"max_uid"=>6999,
 "available_uids"=>"<5999 uids hidden>",
 "uuid"=>"a352059d64d741dc90f7abb2d7aabac5",
 "max_capacity"=>6000,
 "server_identities"=>{},
 "name"=>"d2",
 "active_server_identities_size"=>0,
 "creation_time"=>"2012-02-10T00:17:47-05:00",
 "node_profile"=>"std",
 "externally_reserved_uids_size"=>0,
 "available_capacity"=>5999}

Comment 1 Dan McPherson 2012-02-10 15:18:29 UTC
It won't let you delete the district because it still has an application in it.  You can see the available capacity is 5999.  Which means it has 1 app in it.  You can either move that app out or destroy it to destroy the district.