Bug 1369589

Summary: [RFE] Add vm.overcommit_memory check
Product: Red Hat Satellite Reporter: Josh Foots <jfoots>
Component: InstallationAssignee: Chris Roberts <chrobert>
Status: CLOSED ERRATA QA Contact: Daniel Lobato Garcia <dlobatog>
Severity: low Docs Contact:
Priority: low    
Version: 6.1.9CC: bbuckingham, cduryee, chrobert, dlobatog, jcallaha, oshtaier, stbenjam
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: http://projects.theforeman.org/issues/16300
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:17 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:

Description Josh Foots 2016-08-23 21:03:11 UTC
Description of problem:

There should be a check to ensure that the vm.overcommit_memory variable is set to 0 on Red Hat Satellite 6.X

We have two scripts to add this check into:

One is : https://access.redhat.com/solutions/1474003

The other is the pre-upgrade check preformed by the foreman-installer itself:

# foreman-rake katello:upgrade_check

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


How reproducible:

Very

Steps to Reproduce:
1. Set teh vm.overcommit to 2 and the upgrade will fail every time.
2.
3.

Actual results:

Currently there is no check for this.

Expected results:

For either the healthcheck script or the preupgrade script to flag this as needing to be fixed.



Additional info:

This BZ is related to https://access.redhat.com/solutions/2548501

Comment 1 Chris Duryee 2016-08-24 14:23:07 UTC
add'l info:

If you run a java app without Xmx set, it will ask for 1/4 of physical memory. If vm.overcommit_memory is set to 0 (default) or 1, this  is fine. The OS will give the process 1/4 of memory, but will not guarantee that the full space is available. However, if vm.overcommit_memory is set to 2, it enforces that all memory allocated to processes is backed by physical memory.

To try this out, you can start a VM, use >75% of memory, then run "java -version". If overcommit is set to 2, it will fail. This is not unreasonable behavior, since Java has no idea how much mem it will need without Xmx guidance, and typically it's fine to ask for more than what it actually uses.

Some users set vm.overcommit_memory to 2 in order to avoid OOM conditions. However, any process that asks for more memory than it needs may not be able to execute.

There are two ways to "fix" this for Satellite:

 * verify that overcommit is not set to 2 during pre-upgrade check
 * ensure that all java processes have Xmx set to something reasonable, to avoid the "25% of physical mem" default.

Both of these would be good to do, but the first option is most needed. Users should not run overcommit_memory=2 on a Satellite, since it is not a tested scenario.

Comment 2 Stephen Benjamin 2016-08-25 16:54:59 UTC
Created redmine issue http://projects.theforeman.org/issues/16300 from this bug

Comment 6 Daniel Lobato Garcia 2017-08-30 13:49:12 UTC
Verified.

Tested in Satellite 6.3 - Snap 13


Some output from the CLI of what I did to verify:
---

[root@tyan-gt24-13 ~]# sysctl -n vm.overcommit_memory
2
[root@tyan-gt24-13 ~]# satellite-installer
This system has the vm.overcommit.memory flag enabled in sysctl. Please set this to 0 and then run the installer again.

Comment 7 Satellite Program 2018-02-21 16:54:17 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://access.redhat.com/errata/RHSA-2018:0336