Bug 837579 - User can create medium size app on small profile node, and the app actually has small specification
User can create medium size app on small profile node, and the app actually h...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rajat Chopra
libra bugs
: Regression, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-04 06:03 EDT by Meng Bo
Modified: 2015-05-14 21:59 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-13 19:43:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Meng Bo 2012-07-04 06:03:51 EDT
Description of problem:
Launch a single node with default config, the node profile is small.

[root@ip-10-144-74-67 ~]# mco facts node_profile
Report for fact: node_profile

        small                                   found 1 times

Finished processing 1 / 1 hosts in 212.54 ms

Try to create medium size gear on this node via CLI will get successful.
And check the app info the gear size is "medium".

        "app_url": "http://php2-bmengdev5.dev.rhcloud.com/", 
        "creation_time": "2012-07-04T05:30:30-04:00", 
        "domain_id": "bmengdev5", 
        "embedded": {}, 
        "framework": "php-5.3", 
        "gear_count": 1, 
        "gear_profile": "medium", 


Check the app disk and memory info via cgsnapshot and quota, it is actually small sepcification.

#cgsnapshot
memory {
                memory.memsw.failcnt="0";
                memory.memsw.limit_in_bytes="641728512";
                memory.memsw.max_usage_in_bytes="10756096";
                memory.move_charge_at_immigrate="0";
                memory.swappiness="60";
                memory.use_hierarchy="0";
                memory.failcnt="0";
                memory.soft_limit_in_bytes="9223372036854775807";
                memory.limit_in_bytes="536870912";
                memory.max_usage_in_bytes="10756096";
        }


[php2-bmengdev5.dev.rhcloud.com ~]\> quota -s
Disk quotas for user 2e112557fd9440539cb1266d28314c71 (uid 537): 
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
     /dev/xvde2     628       0   1024M             159       0   40000        


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

How reproducible:
always

Steps to Reproduce:
1.Since the bug 837574, it should add the medium gear size to user to create medium gear on node.
#rhc-admin-ctl-user -l bmeng@redhat.com --addgearsize medium
2.Create medium size gear on small node
#rhc app create -a php2 -t php-5.3 -g medium 
3.
  
Actual results:
App creation successfully, but the app specification actually is small.

Expected results:
User should not be allowed to create medium size gear on a small node.
Error message like ‘No node available’ should come out.

Additional info:
Comment 1 Rajat Chopra 2012-07-06 19:52:17 EDT
First - the gearchanger options in Rails configuration should be corrected before testing this bug. 
File-> /var/www/stickshift/broker/config/environments/test.rb (or development.rb)
Option-> :node_profile_enabled should be set to "true"

Once the above is done, the fix can be tested.
pull request#192 in crankcase
Comment 2 Rajat Chopra 2012-07-09 02:41:12 EDT
fixed with crankcase rev#6d745d4da971c42e472530691872e350717fb9aa
Comment 3 Xiaoli Tian 2012-07-09 04:52:23 EDT
Verified it on devenv_1879,

set node_profile_enable = true in development.rb

Add medium gear size for the user

And try to create medium size app on small node ,

It will return: Unable to create gear on node

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