Bug 844948

Summary: The quota didn't change after move app from medium district to small district
Product: OKD Reporter: Rony Gong 🔥 <qgong>
Component: ContainersAssignee: Rob Millner <rmillner>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: cgole, dmcphers, mfisher
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: devenv_1933 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 20:43:03 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:
Attachments:
Description Flags
development.log none

Description Rony Gong 🔥 2012-08-01 10:39:50 UTC
Created attachment 601705 [details]
development.log

Description of problem:
The quota didn't change after move app from medium district to small district


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


How reproducible:
always


Steps to Reproduce:
1.Setup multi node env, and create 2 districts, small and medium
2.Create a medium app, eg php
3.Move this php to small node across district.
4.Check the quota of this app
  
Actual results:
Still large for that 468114
[qphp-qgong1.dev.rhcloud.com ~]\> quota
Disk quotas for user 1263e78e26a343ab9050554ea167d321 (uid 1002): 
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
     /dev/xvde2     620       0 1048576             159       0  468114  


Expected results:
The files limit should be 40000, small


Additional info:
I find if move app from small to medium district, the quota could change to meidum.

Comment 1 Dan McPherson 2012-08-01 13:44:31 UTC
Why is the inodes limit different for small vs medium (or any gear size using 1G for that matter)?  From what we are selling we say they are both 1G.  I would expect changing gear sizes wouldn't give me more files I can add within the same space.  The issue being that going from a medium to small would mean my same data might not fit (once we allow users to make these kinds of choices).

Comment 2 Rob Millner 2012-08-01 17:54:19 UTC
[rmillner@splat stickshift]$ grep quota_files *
resource_limits.conf:quota_files=40000
resource_limits.conf.c9:quota_files=40000
resource_limits.conf.exlarge:quota_files=400000
resource_limits.conf.high_density:quota_files=40000
resource_limits.conf.jumbo:quota_files=4000000
resource_limits.conf.large:quota_files=40000
resource_limits.conf.medium:quota_files=468114
resource_limits.conf.micro:quota_files=20000
resource_limits.conf.small:quota_files=40000


It seems accidental that the medium quota is different than either the large or the small.

When you migrate from medium to small; should the quota retain medium's settings or should it force quota small?  

The former means we risk over-allocating disk on the small ex nodes.  The latter means we either risk a failure if the app's disk usage is beyond the limit or have to build in additional checks.

For this sprint; I'm going to verify that moving the quota is intentional behaviour.  If so, then this will move to FutureFeature to determine what the correct behaviour should be.

Comment 3 Rob Millner 2012-08-01 18:18:28 UTC
From the logs and code; it seems as though we're intentionally setting the new quota based on the old on.  Moving to FutureFeature to discuss if that's the correct semantics.

Comment 4 Dan McPherson 2012-08-01 18:39:06 UTC
That is the correct semantics.  Once they are given more space we can't just take it away.  But the issue is we set a different inodes limit for small vs medium gears.  I think that was done because the medium gears had less apps.  But I believe that's the wrong logic.  We should keep the same 1G standard across all gear sizes.

Comment 5 Rob Millner 2012-08-01 18:46:48 UTC
Agreed - and its a quick fix to set medium's quotas to the same as small and large.

Pull request:
https://github.com/openshift/li/pull/161

Comment 6 Rob Millner 2012-08-01 18:48:19 UTC
Taking off future Feature since its being dealt with in this sprint.

Comment 7 Rob Millner 2012-08-01 18:50:19 UTC
Pull request accepted.

Comment 8 Chandrika Gole 2012-08-02 17:32:43 UTC
Verified - all node profiles now have same default quota limit i.e. 40000

To test -

1. Created 2 districts, one small one medium
2. Added a node with a small profile to the small distrct and a medium profile node to the large district
3. Create a app.
4. login to the app and type quota. Make sure the files limit is 40000
5. Check which district the app is in and move the app to the other district
6. login to the app and type quota. Make sure the files limit is 40000