Bug 981619

Summary: oo-admin-chk should not check subaccount
Product: OpenShift Online Reporter: Jianwei Hou <jhou>
Component: PodAssignee: Ravi Sankar <rpenta>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: rpenta
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: 2013-07-05 19:12:07 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:
Embargoed:

Description Jianwei Hou 2013-07-05 09:50:01 UTC
Description of problem:
oo-admin-chk fails due to a mismatch between gear and mongo, which was created by a subaccount. 

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

How reproducible:
Always

Steps to Reproduce:
1. Grant account with subaccount capacity
oo-admin-ctl-user --allowsubaccount true --inheritgearsize true --addgearsize c9 -l jhou
2. Create subaccount, and create application as subaccount
curl -k -X POST -H 'Accept: application/xml' -H 'X-Impersonate-User: c9sub' -d id=subd --user jhou:xxx https://ec2-23-20-185-7.compute-1.amazonaws.com/broker/rest/domains

curl -k -X POST -H 'Accept: application/xml' -H 'X-Impersonate-User: c9sub' -d name=c1 -d cartridge=php-5.3 -d gear_profile=c9 --user jhou:xxx https://ec2-23-20-185-7.compute-1.amazonaws.com/broker/rest/domains/subd/applications
3. Delete the application document from mongo
> db.applications.remove({name:"c1"})
4. On broker, oo-admin-chk

Actual results:
[root@ip-10-138-24-225 ~]# oo-admin-chk
Started at: 2013-07-05 05:04:08 -0400
Time to fetch mongo data: 0.012s
Total gears found in mongo: 3
Time to get all gears from nodes: 20.407s
Total gears found on the nodes: 4
Total nodes that responded : 1
Check failed.
Gear 51d68960205db86485000017 exists on node ip-10-138-24-225 (uid: 502) but does not exist in mongo database
Please refer to the oo-admin-repair tool to resolve some of these inconsistencies.
Total time: 20.421s
Finished at: 2013-07-05 05:04:29 -0400


Expected results:
Should success, oo-admin-chk should ignore subaccounts

Additional info:

Comment 1 Ravi Sankar 2013-07-05 19:12:07 UTC
This is an expected behavior.
Usage records are not created for subaccounts and oo-admin-chk will ignore comparing resources like gear/storage/premium-carts in applications mongo collection versus usage/usage_records mongo collection.
But we still need to ensure every gear on the node must have a valid gear record in applications mongo collection irrespective of whether it belongs to subaccount user or not.