9.13. Configuring Gear Profiles (Sizes)

A gear profile, or gear size, specifies the parameters of the gears provided by a node host. A single node host can only host gears of the same gear profile. The gear profile for a given node host is defined in the host's /etc/openshift/resource_limits.conf file.
Because all gears on a node host have the same gear profile, references to node profiles in this guide refer to the gear profile on that particular node host. From the client usage perspective, the configurable parameters of a gear profile, such as RAM, CPU, and disk quota, conceptually define the size of a gear. Gear profiles are therefore often referred to synonymously with gear sizes. However, you can specify an arbitrary name for the gear profile to distinguish node hosts for purposes that are not related to resource limits, such as ownership and location.
All gears on the node host follow the configured gear profile's specifications. To be consistent, all node hosts with the same gear profile name should specify the same configuration, although this is not currently a requirement.

Important

Due to a bug, users of the Jenkins cartridge must define a gear profile named small. See https://bugzilla.redhat.com/show_bug.cgi?id=1027390 for more details.

9.13.1. Adding or Modifying Gear Profiles

Adding or modifying gear profiles in your OpenShift Enterprise deployment requires three main tasks:
  1. Define the new gear profile on the node host.
  2. Update the list of valid gear sizes on the broker host.
  3. Grant users access to the new gear size.
The following instructions detail how to perform these tasks.

Procedure 9.11. To Define a New Gear Profile:

The default node host installation configures a gear profile named small. Edit the /etc/openshift/resource_limits.conf file on the node host to define a new gear profile.

Note

Starting with OpenShift Enterprise 2.1.6, additional example resource_limits.conf files based on other gear profile and host type configurations are included in the /etc/openshift/ directory on nodes. For example, files for medium and large example profiles are included, as well as an xpaas profile for use on nodes hosting xPaaS cartridges. These files are available as a reference or can be used to copy over the existing /etc/openshift/resource_limits.conf file.
  1. Edit the /etc/openshift/resource_limits.conf file on the node host and modify its parameters to your desired specifications. See the file's commented lines for information on available parameters.
  2. Modify the node_profile parameter to set a new name for the gear profile, if desired.
  3. Restart the ruby193-mcollective service on the node host:
    # service ruby193-mcollective restart
  4. If Traffic Control is enabled in the /etc/openshift/node.conf file, run the following command to apply any bandwidth setting changes:
    # oo-admin-ctl-tc restart

Procedure 9.12. To Update the List of Valid Gear Sizes:

If you defined a new gear profile or modified the name of an existing gear profile, you must update the broker host configuration to enable administrators to create districts for the profile and to enable developers to create gears of that size.
  1. Edit the /etc/openshift/broker.conf file on the broker host and modify the comma-separated list in the VALID_GEAR_SIZES parameter to include the new gear profile.
  2. Consider adding the new gear profile to the comma-separated list in the DEFAULT_GEAR_CAPABILITIES parameter as well, which determines the default available gear sizes for new users.
  3. Restart the broker service:
    # service openshift-broker restart
  4. For existing users, you must grant their accounts access to the new gear size before they can create gears of that size. Run the following command on the broker host for the relevant user name and gear size:
    # oo-admin-ctl-user -l Username --addgearsize Gear_Size
  5. See Section 9.14, “Configuring Districts” for more information on how to create and populate a district, which are required for gear deployment, using the new gear profile.
  6. If gears already exist on the node host and the memory_limit_in_bytes variable has been updated in the resource_limits.conf, run the following command to ensure the memory limit for the new gear profile is applied to the existing gears. Replace 512 with the new memory limit in megabytes:
    # for i in /var/lib/openshift/*/.env/OPENSHIFT_GEAR_MEMORY_MB; do echo 512 > "$i"; done
    Note that the original variable from resource_limits.conf is in bytes, while the environment variable is actually in megabytes.