iControl 101 - #23 - Module Resource Provisioning

A somewhat unknown feature on the BIG-IP is the ability to override the default resource allocations for core modules on the BIG-IP.  This is available in the product GUI under the System’s “Resource Provisioning menu”.  In this article, I’m going to walk you through the iControl Management.Provision interface and show you how to automate the configuration of the resources.

The Provision interface manages the partitioning of system memory, disk space, and CPU usage among the modules (e.g., LTM, GTM, WOM) licensed to run on the system. The modules and the “host" system (everything not dedicated to network traffic processing) are first assigned a minimal set of resources, based on pre-determined values and the available system memory. The remaining resources are distributed among the modules, according to pre-determined rules, which can be modified by values which can be set via this iControl interface. The pre-defined module resource allocation handles a wide variety of circumstances, so this allocation should only need to be changed for unusual circumstances, such as turning modules on or off and large network traffic or configurations.

Read that last sentence: “allocation should only need to be changed for unusual circumstances”.  So, unless you have a need for doing so, I’d recommend keeping the default configuration.  With that said, on with the article.

Querying the Provisioning settings

The default settings in the GUI can be found by looking on the System “Resource Provisioning” menu.  A form similar to the following will be presented.  You’ll notice that I have 6 modules on my system: LTM, GTM, PSM, ASM, WAM, and LC.    Your configuration may be different depending on the version of your BIG-IP.

In my configuration, only LTM and GTM are enabled and they have the default allocation of “Nominal”.  The iControl Management.Provision interface contains the following methods to query the data from this form:

Here’s a PowerShell function that will use the iControl PowerShell Cmdlets to pull out the list of modules and then query the custom ratios for them.

   1: function Get-Provisioning()
   2: {
   3:   Write-Host "Retrieving the Provisioning List...";
   4:  
   5:   $module_list = (Get-F5.iControl).ManagementProvision.get_list();
   6:   $levels = (Get-F5.iControl).ManagementProvision.get_level($module_list);
   7:   $cpu_ratios = (Get-F5.iControl).ManagementProvision.get_custom_cpu_ratio($module_list);
   8:   $disk_ratios = (Get-F5.iControl).ManagementProvision.get_custom_disk_ratio($module_list);
   9:   $memory_ratios = (Get-F5.iControl).ManagementProvision.get_custom_memory_ratio($module_list);
  10:   
  11:   Write-Entry "Module Name" "Level" "CPU Ratio" "Disk Ratio" "Memory Ratio"
  12:   Write-Entry
  13:   for($i=0; $i -lt $module_list.Length; $i++)
  14:   {
  15:     $level = $levels[$i].ToString().Replace("PROVISION_LEVEL_", "");
  16:     Write-Entry $module_list[$i] $level $cpu_ratios[$i] $disk_ratios[$i] $memory_ratios[$i]
  17:   }
  18: }

Running this function on my system results in this output showing the 6 modules and that only LTM and GTM are provisioned.

Retrieving the Provisioning List...
Module Name Level CPU Ratio Disk Ratio Memory Ratio
---------------- --------- ------------ ------------ ------------
TMOS_MODULE_LTM NOMINAL 0 0 0
TMOS_MODULE_GTM NOMINAL 0 0 0
TMOS_MODULE_LC NONE 0 0 0
TMOS_MODULE_PSM NONE 0 0 0
TMOS_MODULE_ASM NONE 0 0 0
TMOS_MODULE_WAM NONE 0 0 0

Changing The Resource Allocation Setting

Now, let’s assume we have a need to tweak the configuration for some reason.  In my example I’m going to illustrate how to set the allocation setting to Custom and tweak the various ratio settings for cpu, disk, and memory.

   1: function Set-Custom()
   2: {
   3:   Write-Host "Setting Custom Provisioning levels";
   4:  
   5:   $modules = ("TMOS_MODULE_LTM", "TMOS_MODULE_GTM");
   6:   $levels = ("PROVISION_LEVEL_CUSTOM", "PROVISION_LEVEL_CUSTOM");
   7:   (Get-F5.iControl).ManagementProvision.set_level($modules, $levels);
   8:   (Get-F5.iControl).ManagementProvision.set_custom_cpu_ratio($modules, (60, 30));
   9:   (Get-F5.iControl).ManagementProvision.set_custom_disk_ratio($modules, (100, 100));
  10:   (Get-F5.iControl).ManagementProvision.set_custom_memory_ratio($modules, (75, 50));
  11: }

One thing that you’ll need to know for setting custom levels is that it’s an all or nothing thing.  To set one module to a custom setting, you have to set ALL other modules that have allocated resources to custom as well.   You’ll notice in my script above that I set both LTM and GTM to the Custom level in the same method call.  I then set the CPU ratios to 60 and 30, the Disk ratios to 100 and 100, and the Memory ratios to 75 and 50 respectively.

There is no rhyme nor reason to these numbers, I just picked some different values.  The Ratio itself is a number from 0 to 255 with 0 being equivalent to the “minimal” allocation level.

After running this script the results can be seen by calling the above Get-Provisioning function in Powershell.

Retrieving the Provisioning List...
Module Name Level CPU Ratio Disk Ratio Memory Ratio
---------------- --------- ------------ ------------ ------------
TMOS_MODULE_LTM CUSTOM 60 100 75
TMOS_MODULE_GTM CUSTOM 30 100 50
TMOS_MODULE_LC NONE 0 0 0
TMOS_MODULE_PSM NONE 0 0 0
TMOS_MODULE_ASM NONE 0 0 0
TMOS_MODULE_WAM NONE 0 0 0

And the management GUI will look like this.

Resetting The Resource Allocations To The Defaults

The default values for the allocation levels are the “Nominal” settings. To reset the values, you will have to switch all modules away from the “custom” settings at one shot (remember, it’s an all-or-nothing thing).

   1: function Set-Nominal()
   2: {
   3:   Write-Host "Resetting Provisioning Levels to NOMINAL...";
   4:   
   5:   $modules = ("TMOS_MODULE_LTM", "TMOS_MODULE_GTM");
   6:   $levels = ("PROVISION_LEVEL_NOMINAL", "PROVISION_LEVEL_NOMINAL");
   7:   $ratios = (0, 0);
   8:   (Get-F5.iControl).ManagementProvision.set_level($modules, $levels);
   9:   (Get-F5.iControl).ManagementProvision.set_custom_cpu_ratio($modules, $ratios);
  10:   (Get-F5.iControl).ManagementProvision.set_custom_disk_ratio($modules, $ratios);
  11:   (Get-F5.iControl).ManagementProvision.set_custom_memory_ratio($modules, $ratios);
  12: }

I went ahead and set all the ratios to zero but those values are ignored for any allocation levels other than “custom”.

Download The Source

The source for this article can be found in the iControl CodeShare under PowerShellManagementProvision.

Published Nov 24, 2010
Version 1.0
No CommentsBe the first to comment