Bug 1169690

Summary: Webconsole should show warning info when add cartridge as quota used up to QUOTA_WARNING_PERCENT
Product: OpenShift Container Platform Reporter: Yanping Zhang <yanpzhan>
Component: Management ConsoleAssignee: Sally <somalley>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.2.0CC: bleanhar, gpei, jokerman, libra-onpremise-devel, mmccomas, rthrashe, somalley, yanpzhan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-origin-msg-node-mcollective-1.30.2.1-1 Doc Type: Bug Fix
Doc Text:
Cause: When adding a cartridge to a gear if gear quota is > 90% used, warning info was shown twice with 2 different quota values. Consequence: Confusing to users and 1 warning reflected quota before cartridge addition and 1 warning reflected quota after cartridge addition. Fix: Removed the double warning. Was reporting quota during action=='configure' and action=='post-configure'. Now only reports quota during action=='post-configure'. Result: User only sees 1 correct warning message when trying to add a cartridge to a nearly full gear, ex: "Warning: Gear <app name> is using 95.9% of disk quota"
Story Points: ---
Clone Of:
: 1170021 (view as bug list) Environment:
Last Closed: 2016-03-22 16:51:10 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:
Bug Depends On: 1170021    
Bug Blocks:    
Attachments:
Description Flags
restart-warning
none
add-mongo
none
warninginfo
none
warning appears when adding mongodb cart to full quota app
none
Duplicate warning information none

Description Yanping Zhang 2014-12-02 08:33:55 UTC
Description of problem:
Create an app, and make the gear's quota used exceed up QUOTA_WARNING_PERCENT(default 90% in node.conf), it should have warning info when do app restart, cartridge add, ssh operations. But it doesn't show warning info when add cartridge to the gear on website until it uses up the quota then throw error info. . 

Version-Release number of selected component (if applicable):
ose2.2/2014-11-26.3

How reproducible:
Always

Steps to Reproduce:
1.Create an app on website, ssh into gear, touch large file using at least 90% of gear's quota
#[jbossews2-dom1.ose22.com dom1-jbossews2-1]\> dd if=/dev/zero of=app-root/data/test1 bs=1M count=950
2.Restart app on website
3.In rhc, add mongo to the app.
4.Remove mongo from app in rhc, and readd mongodb to the app on website

Actual results:
2.Show warning info :Warning: Gear dom1-jbossews2-1 is using 93.0% of disk quota. Refer to attachment
3.Have warning info when remove/add cartridge.
$ rhc cartridge remove mongodb-2.4 -a jbossews2
Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge.
Are you sure you wish to remove mongodb-2.4 from 'jbossews2'? (yes|no): yes
Removing mongodb-2.4 from 'jbossews2' ... Warning: Gear dom1-jbossews2-1 is using 93.0% of disk quota
removed
[yanping@dhcp-129-219 test1201]$ rhc cartridge add mongodb-2.4 -a jbossews2
Adding mongodb-2.4 to application 'jbossews2' ... 
Warning: Gear dom1-jbossews2-1 is using 93.0% of disk quota
Warning: Gear dom1-jbossews2-1 is using 99.2% of disk quota
done
mongodb-2.4 (MongoDB 2.4)
-------------------------
  Gears:          Located with jbossews-2.0
  Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/
  Database Name:  jbossews2
  Password:       I82YTpELYPbJ
  Username:       admin
MongoDB 2.4 database added.  Please make note of these credentials:
   Root User:     admin
   Root Password: I82YTpELYPbJ
   Database Name: jbossews2
Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/
4.Add successfully without warnning info.Refer to attachment.

Expected results:
4.Should show warning info.

Additional info:

Comment 1 Yanping Zhang 2014-12-02 08:34:37 UTC
Created attachment 963588 [details]
restart-warning

Comment 2 Yanping Zhang 2014-12-02 08:35:28 UTC
Created attachment 963589 [details]
add-mongo

Comment 4 Yanping Zhang 2014-12-03 02:57:02 UTC
Yeah, have cloned it to online.

Comment 6 Yanping Zhang 2014-12-09 02:46:14 UTC
Have tested on puddle-2-2-2014-12-08.After fix, the same result with Bug #1170021 is seen. Could refer to attachment "warninginfo".

Comment 7 Yanping Zhang 2014-12-09 02:47:21 UTC
Created attachment 966046 [details]
warninginfo

Comment 10 Sally 2016-02-25 16:07:02 UTC
Created attachment 1130593 [details]
warning appears when adding mongodb cart to full quota app

I see the console warning when adding mongodb to an app that is very near quota limit.

Comment 12 Gaoyun Pei 2016-02-26 10:01:53 UTC
Hi,

Still could reproduce the error in Comment 7, here's my steps:

1. Create a ruby-2.0 app named app1

2. Log into the app and take more than 90% quota of the app
rhc ssh app1
[app1-yes.ose22-auto.com.cn yes-app1-1]\> dd if=/dev/zero of=app-root/data/test1 bs=1M count=950
950+0 records in
950+0 records out
996147200 bytes (996 MB) copied, 3.78669 s, 263 MB/s

3. On web console, Click "Add MySQL 5.5" on app1 page.
Then could see "Warning: Gear yes-app1-1 is using 93.0% of disk quota
Warning: Gear yes-app1-1 is using 97.9% of disk quota"

Comment 13 Gaoyun Pei 2016-02-26 10:02:28 UTC
Created attachment 1130807 [details]
Duplicate warning information

Comment 14 Rory Thrasher 2016-03-01 18:27:32 UTC
Looks like openshift-github-bot didn't post for some reason.  The relevant PR has been merged: https://github.com/openshift/origin-server/pull/6369

Comment 15 Dan McPherson 2016-03-01 19:07:59 UTC
@rory

The bot doesn't do that.  There is a github webhook but it is picky about how you reference the bug.  Examples that work:

Ticket 123
Bug 123
Tracker item 123
Multiple bugs can also be specified by separating them with a comma,
apersand, plus or "and":

Bug 123, 124 and 125

Comment 16 Rory Thrasher 2016-03-01 21:46:37 UTC
Dan,

Ahhhhh good to know - I'm just used to seeing the post come from "openshift-github-bot".  Looks like there was a space missing from the commit message - which was probably why the webhook didn't pick it up.  Just wanted to have the link to the PR for future reference.

Comment 18 Rory Thrasher 2016-03-03 22:34:52 UTC
QE,

We've made changes and updated the puddle.  Can we verify that there is a warning for the quota over 90%, and that the double-warning no longer exists?

Puddle: http://etherpad.corp.redhat.com/puddle-2-2-2016-02-19

Comment 19 Yanping Zhang 2016-03-04 07:07:10 UTC
Tested on puddle 2.2/2016-03-03.1/
Steps to verify:
1.Create app.
$rhc app create phptest php-5.4
2. Log into the app and take more than 90% quota of the app:
$ rhc ssh phptest
[phptest-domtest.ose22-auto.com.cn domtest-phptest-1]\> dd if=/dev/zero of=app-root/data/test1 bs=1M count=930
930+0 records in
930+0 records out
975175680 bytes (975 MB) copied, 2.1559 s, 452 MB/s
[phptest-domtest.ose22-auto.com.cn domtest-phptest-1]\> quota
Disk quotas for user domtest-phptest-1 (uid 1460): 
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
     /dev/loop0  953340       0 1048576             222       0   80000 
3.Login web console, Click "Add MySQL 5.5" on phptest page. Now could see one warning info:
Warning: Gear domtest-phptest-1 is using 95.9% of disk quota 

The bug has been fixed, so move it to verified.

Comment 21 errata-xmlrpc 2016-03-22 16:51:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-0489.html