Modify the out-of-box resource plan

Goal

The resource distribution plan is closely related to the consumer tree. The plan cannot be defined without the tree. EGO comes with supplied resource groups and a basic out-of-the-box consumer tree to begin working with. In this tutorial you learn about resource plans by modifying the supplied version.

At a glance

Contents include the following:

  1. Recognize the default configurations

  2. Learn about resource plans

  3. Create a time interval

  4. Set owned slots

  5. Set lend policy

  6. Set borrowing policy

  7. Understand share ratios

  8. Set share ratios

  9. Understand consumer rank

  10. Set consumer rank

  11. Export or import resource plan

1. Recognize the default configurations

To help orient you, here is a list of the default consumer tree, resource groups, and resource plan components you see and work with in the Platform Management Console:

  • Consumer tree: “ManagementServices” (with nested child consumer “EGOManagementServices”), “SampleApplications” (with nested child consumer “EclipseSamples”), and ClusterServices (with nested child consumer “EGOClusterServices”).

    In this tutorial, we work with the “SampleApplications” top-level consumer and its “EclipseSamples” sub-consumer.

  • Resource groups: “ComputeHosts” (executes workload units), “InternalResourceGroup” and “ManagementHosts” (run important EGO components and services).

    In this tutorial, we work with the “ComputeHosts” resource group.

  • Resource plan (default resource group upon opening page is “ComputeHosts”): Only consumers registered to a selected resource group show; select different resource groups to modify corresponding resource plans. Notice the following:
    • The resource group “ComputeHosts” is associated with one consumer (“SampleApplications”).

    • There is only one defined time interval in the resource plan for the resource group view “ComputeHosts” (00:00 - 24:00).

    • The consumer “SampleApplications” owns zero slots.

    • Lending and borrowing are disabled for all consumers.

    • Sharing is enabled for all consumers, with a default share ratio of one.

    • Consumers associated with this resource group have a consumer rank set at 50 (where a higher number = a lower ranking)

    In this tutorial, we change the default time intervals, slot ownerships, lending and borrowing policies, share ratio, and consumer rank.

2. Learn about resource plans

The resource plan defines how cluster resources are allocated among consumers. The plan takes into account the differences between consumers and their needs, resource properties, and various other policies concerning consumer rank and the allocation of resources.

A resource plan supports a number of rules used to set policies for how, when, and where resources get allocated. This includes policies concerning resource allocation and ownership, borrowing and lending, sharing, and the reclaiming of borrowed resources. In all cases, resource plans must be set at the leaf level (consumers with no descendents).

A resource plan allows for sharing, lending, and borrowing between specified consumers. A good resource plan anticipates time periods of peak activity and sets policies to ensure high priority consumers can access (borrow) required resources during these times.

EGO systematically allocates resources to consumers experiencing by demand by this ordered process:

  1. Allocate idle resources owned by consumer

  2. Allocate idle, owned resources from share pool

  3. Allocate idle resources borrowed from other consumers

  4. Allocate resources reclaimed by consumer

  5. Allocate resources reclaimed by share pool

3. Create a time interval

Make sure you are at the top of your tree (at the cluster level).

Time-based configuration in the resource plan allows the resource distribution for a consumer to change according to the time of day.

Time intervals exist across all resource groups. No time gaps are allowed in the resource distribution plan.

Time interval boundaries are at the hour point, so the minimum time interval is 60 minutes. The daily pattern repeats itself every 24 hours.

  1. Click Consumers > Consumers & Plans.

    A list of consumers at that level in your tree displays.

  2. Click Resource Plan.

    The resource distribution plan displays.

  3. Select the resource group you want to add the time interval for.

  4. Select Time Intervals and Settings > Insert a Time Interval.

    An insert element displays just above the resource distribution plan.

  5. Specify a start time and an end time.

    By default, settings for a new time interval are inherited from an existing one.

  6. Click Insert.

  7. Click OK to confirm that you want to insert the time interval.

    The new time interval displays in your resource distribution plan for the selected resource group.

  8. Add the time interval for any other resource groups.

4. Set owned slots

Before beginning, ensure you are still on the Consumers & Plans page, in the Resource Plan. The selected resource group should be “ComputeHosts”.

When consumers “own” resources, they are guaranteed of a minimum allocation of resources, regardless of competition from other consumers. Ownership is expressed as a numeric quantity.

The number of owned slots available to each resource group and branch in the consumer tree is set elsewhere (see the tutorial for creating resource groups). For this tutorial, we’ll use the default settings. Out-of-the-box, there is only 1 slot available for allocation within the “ComputeHosts” resource group per time interval (the default setting shows a balance of “1” at the bottom of the dialog box).

Tip:

Upon completion of your resource plan, each balance must show “0” except the cluster balance, which is allowed to retain unallocated resources (and therefore a balance greater than 0).

  1. Click Expand All to expand the entire list of consumers associated with the ComputeHosts resource group.

  2. For each time interval, set the owned slots for each consumer and leaf consumer. Be sure to distribute all available resources as far down a consumer branch as possible to its leaf consumers. For example, assign 1 slot to SampleApplications, and then do the same for EclipseSamples.

    Tip:

    In EGO, the bottom sub-consumer is called a “leaf” consumer; a top-level consumer, such as SampleApplications, is considered a “branch” in the consumer “tree”.

    When all available resources are allocated, the cluster balance at the bottom of the Owned Slots section changes to 0.

  3. Click Apply to set the new values and immediately apply the changes o the running cluster. If you simply want to save the changes you made to the plan, click Export and you can save the changes to a file that you can later import and apply to activate.

5. Set lend policy

Before beginning, ensure you are still on the Consumers & Plans page, on the Resource Plan page. The selected resource group should be “ComputeHosts”.

Lending is optional. You can enable lending only for leaf consumers who own resources (there are no lend setting available for non-leaf consumers in the resource plan). With lending, a consumer's unused resources become available for other consumers to borrow. This kind of resource sharing improves the efficiency of the cluster. Without lending, owned resources cannot be shared with other consumers and idle resources are wasted.

  1. Select Time Intervals and Settings > Show Advanced Settings to display advanced settings and policy configuration options for the resource group.

  2. For each time interval, you can choose to Lend slots allocated to leaf consumers during periods of non-use.

    1. To lend a leaf consumer’s slots, check the box under Lend | Limit in the Model Type: Ownership section of the plan.

    2. Beside the check box, click Details. In the Lend Details dialog box that opens, specify the maximum number of slots you want to lend from this branch.

      As the out-of-the-box configuration only has one slot available to the “ComputeHosts” resource group, you are not able to lend more than one slot at this point.

  3. In future, when you have more than one consumer branch in the “ComputeHosts” resource group, you want to specify particular leaf consumers to lend to as part of a strategic lending/borrowing policy.

    1. Click Details beside the consumer’s Lend | Limit box.

    2. Check the boxes beside those leaf consumers from other branches you lend to.

      (Out-of-the-box, there are no other leaf consumers in the “ComputeHosts” resource group, so there are none to check. Skip this step. If you want to look at a configuration with multiple leaf consumers, change the resource plan view to “Resource Group: ManagementHosts”, and then click Details.)

    3. Click Apply and then Close.

6. Set borrowing policy

Before beginning, ensure you are still on the Consumers & Plans page, in the Resource Plan. The selected resource group should be “ComputeHosts”.

Borrowing is optional. If borrowing is disabled, the allocation to a leaf consumer never exceeds the configured ownership. Therefore, if borrowing is disabled for all consumers, any unused resources (owned by other consumers) are wasted.

You can enable borrowing only for leaf consumers (consumers with no descendents); there are no borrow settings available for non-leaf consumers in the resource plan.

If you enable borrowing, distribution to a consumer can exceed its actual ownership during peak periods of activity and times of increased need. Enable borrowing to ensure unowned resources are not wasted/left unused.

  1. If not already selected, click Time Intervals and Settings > Show Advanced Settings to display advanced settings and policy configuration options for the resource group.

  2. In a similar fashion to setting the lending policy, you can choose to borrow slots allocated to other leaf consumers during periods of increased activity.

    1. To borrow slots, check the box under Borrow | Limit in the Model Type: Ownership section of the plan.

    2. Beside the check box, click Details. In the Borrow Details dialog box that opens, specify the maximum number of slots you want to lend from this branch.

      As the out-of-the-box configuration does not have any other consumers from which to borrow in the “ComputeHosts” resource group, you can leave this field blank.

  3. In future, when you have multiple lending consumers in a resource group, you want to specify particular leaf consumers to borrow from as part of a strategic lending/borrowing policy.

    1. For each leaf consumer that has borrowing enabled, click Details beside the consumer’s Borrow | Limit box.

    2. Check the boxes beside those leaf consumers from which you want to borrow from.

      The Borrow Details dialog box opens for this consumer.

      (Out-of-the-box, there are no other leaf consumers in the “ComputeHosts” resource group, so there are none to check. Skip this step. If you want to see a configuration with multiple leaf consumers, change the resource plan view to “Resource Group: ManagementHosts”, and then click Details.)

    3. Under the Borrow/ Preference Order column, specify the order in which you want to borrow from specific consumers.

      The number 1 indicates that this consumer is your first choice to borrow from. Do not repeat any numbers.

      (Out-of-the-box, there are no other leaf consumers to borrow from, so you do not see this field. Skip this step. If you want to see a configuration with multiple leaf consumers, change the resource plan view to “Resource Group: ManagementHosts”, and then click Details.)

    4. Click Apply and then Close.

    5. Run egosh ego restart to have the changes take effect.

7. Understand share ratios

Sometimes there may be competition between leaf consumers from the same branch for additional resources. You must configure your resource plan to indicate how to appropriately satisfy the demands of these competing leaf consumers. This is done by specifying a share ratio.

When all the owned resources have been allocated according to the resource plan, and all resources that can be borrowed from other consumers have been borrowed, then EGO begins allocating unowned resources from a share pool. To plan how to allocate share pool resources, you need to specify a ratio value. Leaf consumers with a higher share ratio receives more resources during periods of competition.

To understand share ratios, it is important to first understand how resources generally are allocated. One way to do this is to picture three “buckets” containing owned resources, borrowed resources, and shared resources. Each bucket contains resources that get allocated to consumers according to the resource plan and to consumer demands. Resources are distributed from the buckets in this order:

  1. EGO always allocates owned resources first to consumers according to the resource plan.

  2. Then, when there are no owned resources left to borrow from consumers who are willing to lend them, EGO allocates unowned resources from the share pool to consumers with unsatisfied demand.

    • Share pool resources first come from the “family” pool (any unowned resources within a particular branch in the consumer tree).

    • Once the family pool is exhausted, then EGO distributes resources from other branches in the consumer tree, eventually moving up the tree to distribute any unowned resources from the cluster level.

    • Share pool resources are distributed to competing leaf consumers according to their allowed share ratio. If the share ratio for two competing consumers is 1:1, resources are allocated evenly. If the share ratio is 1:2, then the second competing consumer gets twice as many available resources from the share pool.

  3. Finally, when there is demand, consumers lend and borrow resources from each other.

Why a ratio instead of an absolute number? Because only those consumers experiencing a current demand factor into the distribution calculation—because current demand fluctuates, making it difficult to predict who will have demand at any given time, a ratio is the best way to indicate a relative quantity of resources a particular consumer should receive.

8. Set share ratios

Before beginning, ensure you are still on the Consumers & Plans page, in the Resource Plan. The selected resource group should be “ComputeHosts”. Under Time Intervals and Settings, you must select Show Advanced Settings.

  1. Under the Model type: Sharing section of the plan, check the Share Ratio box for the SampleApplications consumers and EclipseSamples leaf consumer, and enter the share ratio 1 for each. (Out-of-the-box there are no other leaf consumers competing for available resources, so the share ratio has no effect at this point.)

    If there were other EclipseSamples leaf consumers, you might enter a share ratio of 1 for each of them. This would ensure that all leaf consumers share available surplus resources equally. If you wanted one leaf consumer to have twice as many resource made available during times of competition for resources, you would enter a share ratio of 2 for it, and 1 for the others.

  2. Indicate a sharing limit for leaf consumers.

    By default, a leaf consumer who is first in line to borrow (either because it is the first one to express a demand or because of its higher consumer rank), can borrow all the resources available for sharing if it has enough demand. If you want to limit the amount of resources a consumer receives through borrowing, you can indicate a limit in the Sharing Limit field. The borrowing limit is expressed as a numeric quantity.

9. Understand consumer rank

Resources are borrowed between siblings according to their consumer ranking: sibling consumers (consumers at the same level of the same branch) with the highest priority setting have the first opportunity to borrow if they are simultaneously competing for resources.

When carrying out the resource distribution plan, EGO considers consumer rank in deciding which sibling consumer to apply the plan to first. If parts of the plan compete with each other, the plan is first applied to sibling consumers with a higher consumer ranking.

An assigned consumer rank is only considered when lending unused or surplus resources to consumers with a resource need; those borrowing consumers with the highest set priority are lent resources first. Note that a child’s rank has nothing to do with the rank of its parent.

10. Set consumer rank

Before beginning, ensure you are still on the Consumers & Plans page, in the Resource Plan. The selected resource group should be “ComputeHosts”. Under Time Intervals and Settings, you must select Show Advanced Settings.

  1. Under the Model Type: Ownership section of the plan, rank consumers within the SampleApplications branch. (Out-of-the-box, there is only 1 top-level consumer and 1 leaf consumer, so the ranking has no effect at this point.)

    Specify any positive whole number in the Consumer Rank field, where 1 is the highest priority. Priority settings are relative to one another within the resource group. If you leave the priority blank, that consumer has no priority over any other consumer (it does not form part of any consumer ordering/sequencing). If all consumers have a high ranking, any advantage one may have over another is nullified. Be selective in assigning a high consumer rank to a consumer.

  2. In future, repeat step 1 for other consumer branches in the consumer tree.

    For low priority consumer branches, you can choose to leave the Consumer Rank field blank.

11. Export or import resource plan

Any changes you apply to the resource plan in the Platform Management Console are implemented immediately (if you click Apply). We recommend exporting the plan instead, saving it under a different name for future import. That way, the original default resource plan remains available to you for future re-use. This procedure walks you through how to export a completed plan, and then how to import it at a later time.

  1. Export the plan.

    If you do not want to immediately apply the resource plan you have created, export it for later use.

    1. At the bottom of the Resource Plan page, click Export.

      A dialog box opens, asking if you want to save or open the file. Click Save.

    2. Navigate to a local directory location to save your resource plan.

      You may want to give the XML file a unique name including date or plan specifics so that you can import the plan of your choice quickly and easily at a later time.

    Changing your consumer tree structure after exporting a plan may introduce errors to the plan when it is later imported. Check your plan carefully when you later import it if the consumer tree structure has changed, and make any required modifications to it.

  2. Import plan at a later time.

    To import a saved resource plan at a later time, follow these steps.

    1. Ensure that a resource plan exists (and was exported).

    2. Ensure that the resource plan you import has an identical consumer tree structure to the active resource plan. If not, check your plan carefully and make any required modifications. (For example, if the current tree has additional leaf consumers, the imported plan may need to distribute resources to the added leaf consumers and apply lend/borrow policies.)

      It is ok if the time intervals are different.

    3. Click on your cluster name in the consumer tree.

    4. Click Consumer > Consumers & Plans > Resource Plan.

      If you do not see Resource Plan, make sure you are at the top of your consumer tree.

    5. At the bottom of the page, click Import.

      The Import a resource plan (XML) dialog displays.

    6. Browse for the location of the XML resource plan you wish to import.

    7. Click Import.

      Importing a resource plan makes it the active plan. You can export this plan and import it again as needed if you want it to apply it only to specific days of the week. You can create as many resource distribution plans as you want and import them as needed for a quick change in your distribution.