Bug 837579 - User can create medium size app on small profile node, and the app actually has small specification
Summary: User can create medium size app on small profile node, and the app actually h...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Rajat Chopra
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-04 10:03 UTC by Meng Bo
Modified: 2015-05-15 01:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-13 23:43:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Meng Bo 2012-07-04 10:03:51 UTC
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 --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 23:52:17 UTC
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 06:41:12 UTC
fixed with crankcase rev#6d745d4da971c42e472530691872e350717fb9aa

Comment 3 Xiaoli Tian 2012-07-09 08:52:23 UTC
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.