Bug 981619 - oo-admin-chk should not check subaccount
oo-admin-chk should not check subaccount
Product: OpenShift Online
Classification: Red Hat
Component: Pod (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ravi Sankar
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-07-05 05:50 EDT by Jianwei Hou
Modified: 2015-05-14 20:18 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-07-05 15:12:07 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jianwei Hou 2013-07-05 05:50:01 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):
On devenv_3450

How reproducible:

Steps to Reproduce:
1. Grant account with subaccount capacity
oo-admin-ctl-user --allowsubaccount true --inheritgearsize true --addgearsize c9 -l jhou@redhat.com
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@redhat.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 jhou@redhat.com: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 15:12:07 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.