Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 949072

Summary: active_capacity = NaN because openshift_facts.rb relies on deprecated settings
Product: OpenShift Container Platform Reporter: Miciah Dashiel Butler Masters <mmasters>
Component: NodeAssignee: Luke Meyer <lmeyer>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 1.1.1CC: baulakh, bhatiam, bleanhar, cpelland, libra-onpremise-devel, pruan, xjia
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-origin-msg-node-mcollective-1.0.5-1.el6op Doc Type: Bug Fix
Doc Text:
The OpenShift Enterprise 1.1.3 release shipped with rubygem-openshift-origin-node-1.0.13-1 which required openshift-origin-msg-node-mcollective-1.0.4-1. However, openshift-origin-msg-node-mcollective-1.0.4-1 was inadvertently left out of the release, causing application creation to fail because no gears could be created on the node. This issue has been fixed in the current release of OpenShift Enterprise, and applications can now be created successfully.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-09 08:48:47 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 Miciah Dashiel Butler Masters 2013-04-05 19:39:12 UTC
Description of problem:

We are currently shipping rubygem-openshift-origin-node-1.0.13-1.el6op
and openshift-origin-msg-node-mcollective-1.0.3-1.el6op.  These versions are incompatible for the following reasons:

• node-1.0.13 has an up-to-date version of /etc/openshift/resource_limits.template that no longer has the max_apps and max_active_apps settings (they are replaced by max_gears and max_active_gears).

• On a typical OSE installation, /etc/openshift/resource_limits.conf is usually a symlink to, or a copy of, /etc/openshift/resource_limits.template.

• mcollective-1.0.3 has an old version of /usr/lib/ruby/site_ruby/1.8/facter/openshift_facts.rb that still reads max_apps and max_active_apps from /etc/openshift/resource_limits.conf.

• The old openshift_facts.rb uses max_apps and max_active_apps to compute active_capacity, which is computed by dividing a quantity by max_active_apps, but if max_active_apps is not set in resource_limits.conf, then it defaults to 0, and thus active_capacity is set to NaN (resulting from division by zero).

• Because the node's facts say that active_capacity is NaN, no gears can be created on the node.


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

The latest released bits.  The system is yum-updated, and the following channels are enabled:

jb-eap-6-for-rhel-6-server-rpms
jb-ews-1-for-rhel-6-server-rpms
rhel-6-server-cf-tools-1-rpms
rhel-6-server-rhev-agent-rpms
rhel-6-server-rpms
rhel-ha-for-rhel-6-server-rpms
rhel-lb-for-rhel-6-server-rpms
rhel-rs-for-rhel-6-server-rpms
rhel-server-ose-infra-6-rpms
rhel-server-ose-jbosseap-6-rpms
rhel-server-ose-node-6-rpms
rhel-server-ose-rhc-6-rpms

How reproducible:

• This bug will break all new installations of OSE.

• The bug may also break existing installations on yum update if those existing installations symlink /etc/openshift/resource_limits.conf to resource_limits.template.

• The bug will not break existing installations on yum update if those existing installations use a copy of resource_limits.conf (yum will not touch resource_limits.conf itself).


Steps to Reproduce:
1. Install a new OSE installation with one node.
2. Try `rhc app create testapp php` with your new OSE installation.
3. Try `mco inventory node.example.com | grep capacity`.


Actual results:

After step 2, you will see "Creating application 'testapp2' ... Unable to create gear on node"

After step 3, you will see that active_capacity and capacity are both NaN.


Expected results:

After step 2, you the application should be created successfully.

After step 3, you should see that active_capacity and capacity are numbers.


Additional info:

The following commit adds the new _gear settings to resource_limits.template and updates openshift_facts.rb so that it uses both the old _app and the new _gear settings:

https://github.com/openshift/enterprise-server/commit/556a9efaf786f5d225de4f2c23432d2b28f724f8

The following commit deletes the old settings from resource_limits.template and updates openshift_facts.rb to use only the new _gear settings:

https://github.com/openshift/enterprise-server/commit/fa38702b762989c09af1c3a5f1324b13a8c0918f

We ship openshift-origin-msg-node-mcollective-1.0.3-1.el6op, which still has an old openshift_facts.rb that uses the old _app settings.  We need to ship openshift-origin-msg-node-mcollective-1.0.4 or newer to get the updated openshift_facts.rb.

Comment 6 xjia 2013-04-07 07:16:32 UTC
Version:
install ose-1.1.3(rhn) and update the environment with these advisories:
https://errata.devel.redhat.com/advisory/14699
https://errata.devel.redhat.com/advisory/14678
https://errata.devel.redhat.com/advisory/14706

Verify:
[root@broker ~]# rhc app create php php 
Password: ***
Using php-5.3 (PHP 5.3) for 'php'

Application Options
===================
  Gear Size: default
  Cartridge: php-5.3
  Scaling:   no
  Namespace: sjia

Creating application 'php' ... done

Waiting for your DNS name to be available ... done

Downloading the application Git repository ...
Initialized empty Git repository in /root/php/.git/
The authenticity of host 'php-sjia.example.com (10.4.59.223)' can't be established.
RSA key fingerprint is f5:2e:2f:ea:e3:af:84:df:ec:b0:97:f9:65:32:07:27.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'php-sjia.example.com,10.4.59.223' (RSA) to the list of known hosts.
reverse mapping checking getaddrinfo for vm-223-59-4-10.ose.phx2.redhat.com [10.4.59.223] failed - POSSIBLE BREAK-IN ATTEMPT!

Your application code is now in 'php'

php @ http://php-sjia.example.com/ (uuid: 174d980e4710444ebf90b50e2a975145)
===========================================================================
  Created:   12:14 AM
  Gear Size: small
  Git URL:   ssh://174d980e4710444ebf90b50e2a975145.com/~/git/php.git/
  SSH:       174d980e4710444ebf90b50e2a975145.com

  php-5.3 (PHP 5.3)
  =================

RESULT:
Application php was created.

Comment 8 errata-xmlrpc 2013-04-09 08:48:47 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.

http://rhn.redhat.com/errata/RHBA-2013-0723.html