Red Hat Bugzilla – Bug 981619
oo-admin-chk should not check subaccount
Last modified: 2015-05-14 20:18:39 EDT
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):
Steps to Reproduce:
1. Grant account with subaccount capacity
oo-admin-ctl-user --allowsubaccount true --inheritgearsize true --addgearsize c9 -l firstname.lastname@example.org
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 email@example.com: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 firstname.lastname@example.org:xxx https://ec2-23-20-185-7.compute-1.amazonaws.com/broker/rest/domains/subd/applications
3. Delete the application document from mongo
4. On broker, oo-admin-chk
[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
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
Should success, oo-admin-chk should ignore subaccounts
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.