Resizing a resource pool in the load manager plugin

The load manager plugin is used to distribute load across a number of resources with a specific capacity. This is called a resource pool, and its mutual exclusivity is guaranteed on the selected scope (Absolute, workfow, workorder group).

The load manager stores the allocation information in the database. The first work order to run will initialize all information related to this resource pool in the database. The problem is, if you wish to resize the resource pool, the database information would first need to be cleaned up. Otherwise the corresponding dashboard page will not reflect the sizing changes.

The only way to resize the resource pool is to delete it, change the sizing in the plugin configuration then let a work order recreate it. That also means all existing reservations will be lost.

Here is a way to delete the allocation information, with pool1_resource_name being the unique resource name for your resource pool:

cd /opt/aspera/orchestrator
>> pool_name="pool1_resource_name"
>> ManagedResource.find(:all,:conditions=>["resource_name='#{pool_name}__a'"]).each{|r| r.destroy}

Observe that the __a was added given your scope is Absolute. If the scope is something else, like workflow or workorder group, first search for the resource_name in the database (with the command below for example).

After you run the above commands, all related rows should be deleted.

If a new work order now get executed, a new resource pool is created with the new sizing information. Check with:

>> Database.execute("select id, resource_id, resource_name, max, reserved from managed_resources;")
=> [ 
{"reserved"=>nil, "resource_id"=>"ffmpeg transcoder__a->resource_1", "max"=>"2", "id"=>"18", "resource_name"=>"ffmpeg transcoder__a"}, 
{"reserved"=>nil, "resource_id"=>"ffmpeg transcoder__a->resource_2", "max"=>"2", "id"=>"19", "resource_name"=>"ffmpeg transcoder__a"}

Here we have a load manager resource named ffmpeg transcoder with Absolute scope, 2 for number of resources and 2 for capacity. Now you can check in your dashboard page that it reflects the right sizing information.

Note that the resource manager plugin does not use the managed_resources table. You can change the sizing information in the plugin and it's reflected immediately in the corresponding dashboard page.

Powered by Zendesk