Description of problem: If you update resource_limits.conf and change memory_limit_in_bytes Version-Release number of selected component (if applicable): current OSE versions How reproducible: Always Steps to Reproduce: 1. Create some gears on a node 2. Change memory_limit_in_bytes in /etc/openshift/resource_limits.conf 3. Follow the documented steps (e.g. in the initial comments of the file) to apply the changes Actual results: Existing gears don't get their OPENSHIFT_GEAR_MEMORY_MB env var updated. Expected results: It should be possible to update this env var. Right now the only known method is something like: # find /var/lib/openshift -name OPENSHIFT_GEAR_MEMORY_MB | sed -i -e 's/oldMB/newMB/' Additional info: The variable is used in some places, e.g. Java based cartridges (EAP and EWS) calculate the JVM's heap size based on JVM_HEAP_RATIO * OPENSHIFT_GEAR_MEMORY_MB. Failing to update the env var after updating the memory limits means this calculation is not accurate.
*** Bug 1202466 has been marked as a duplicate of this bug. ***
So in order to make this workaround more visible, we're going to add the it to both the instructions at the beginning of resource_limits.conf, as well as to the Administrative guide <https://access.redhat.com/documentation/en-US/OpenShift_Enterprise/2/html-single/Administration_Guide/index.html#Adding_New_Gear_Profiles>. We're also recommending using the following command instead of the sed command currently recommended in the workaround, where 512 should be replaced with the new value in megabytes. for i in /var/lib/openshift/*/.env/OPENSHIFT_GEAR_MEMORY_MB; do echo 512 > "$i"; done I'll be opening a PR shortly with the change the resource_limits.conf file. A docs bug for the admin guide has been opened here: https://bugzilla.redhat.com/show_bug.cgi?id=1354609
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/505b7922fe1d5f8a69e2537e535bdb035d2e3933 resource_limits.conf: adds new update instruction Bug 1196783 https://bugzilla.redhat.com/show_bug.cgi?id=1196783 When the memory_limit_in_bytes variable in resource_limits.conf is updated, the OPENSHIFT_GEAR_MEMORY_MB env variable does not get updated for existing gears. Now there is an additional note for users to run a workaround to update that variable for existing gears.
Re-test this bug with rubygem-openshift-origin-node-1.38.6.3-1.el6op.noarch in 2.2/2016-08-08.1 puddle, seem like the PR is not merged into the RPM package.
Installer script - openshift.sh has the following logic: node_profile="${CONF_NODE_PROFILE:-small}" node && node_profile_name="${CONF_NODE_PROFILE_NAME:-$node_profile}" node && node_host_type="${CONF_NODE_HOST_TYPE:-m3.xlarge}" configure_node() { local resrc='/etc/openshift/resource_limits.conf' if [[ -f "${resrc}.${node_profile}.${node_host_type}" ]] then cp "${resrc}.${node_profile}.${node_host_type}" "$resrc" elif [[ -f "${resrc}.${node_profile}" ]] then cp "${resrc}.${node_profile}" "$resrc" fi ... } Though this fix is present in resource_limits.conf, not in resource_limits.conf.large.m3.xlarge, resource_limits.conf.medium.m3.xlarge, resource_limits.conf.small.m3.xlarge, resource_limits.conf.xpaas.m3.xlarge, when running installation using openshift.sh, /etc/openshift/resource_limits.conf will be overwritten, then the fix will be lost, we also need add the fix for the other resource_limits template conf file to avoid such issue.
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/1c18dea308cf2e58d81736288de352f1eea1e5be Add new update instruction for different gear types conf When the memory_limit_in_bytes variable in resource_limits.conf is updated, the OPENSHIFT_GEAR_MEMORY_MB env variable does not get updated for existing gears. Now there is an additional note for users to run a workaround to update that variable for existing gears. Bug 1196783 Link https://bugzilla.redhat.com/show_bug.cgi?id=1196783 Signed-off-by: Vu Dinh <vdinh>
Verified this bug with rubygem-openshift-origin-node-1.38.6.4-1.el6op.noarch in 2.2/2016-08-11.1, and PASS. Now the workaround comments are added into /etc/openshift/resource_limits.conf.
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-1773.html