Case Study

This case study provides one example of sophisticated usage of Allocator.

  • There are 3 physical locations: US, Asia and Europe
  • Each location has its own installation of Accelerator
  • Each location has its own set of licenses (in our example, we use calibre)
The goal of the case study is to achieve:
  • Some licenses to be used locally only
  • Some licenses to be shared across all locations
  • Each Accelerator can continue to use its own local licenses even if Allocator goes down for any reason (such as, network outage)
  • Users do not have to know what LM_LICENSE_FILE to set before submitting jobs. The correct LM_LICENSE_FILE environment variable is set automatically by Accelerator at run time.

Step 1: Setup Monitor on Each Site

Assume in US site, we have two license servers, namely 27001@earth and 27002@jupiter. We want to restrict calibre usage served by 27001@earth to US local Accelerator queue, and share 27002@jupiter with the rest of the queues.

Since they serve the same feature, you need to tag the FlexNet Publisher daemon when you configure Monitor. For example, in your config.tcl for vovlmd:
# Example of vovlmd config.tcl

add_LM_LICENSE_FILE 27001@earth   -tag US_LOCAL
add_LM_LICENSE_FILE 27002@jupiter -tag US_WAN

You can do a similar setup for all other locations.

Step 2: Setup resources.tcl to Monitor the License Features of Interest

Assume the feature name is calibre. In the vnc.swd/resources.tcl file of US Accelerator queue, you could add:
# Fragment of resources.tcl for the US site

# Use LOCAL:calibre as Accelerator resource name for calibre from 27001@earth.
vtk_flexlm_monitor US_LOCAL/calibre LOCAL:calibre

# Use WAN:calibre as Accelerator resource name for calibre from 27002@jupiter.
vtk_flexlm_monitor US_WAN/calibre WAN:calibre

# When user submits a job requesting License:calibre, use either LOCAL or WAN
# resource, with LOCAL preferred.
vtk_resourcemap_set License:calibre UNLIMITED "LOCAL:calibre | WAN:calibre"

After changing resources.tcl, run ncmgr reset on the command line and use the resources monitor (nc mon) to verify that you get the correct number of resources for both LOCAL:calibre and WAN:calibre and you have License:calibre correctly map to "LOCAL:calibre | WAN:calibre".

The setup enables US Accelerator to use the both LOCAL and WAN calibre licenses when calibre is not managed by Allocator.

Repeat the same setup for the other sites as well.

Step 3: Setup Allocator to Manage Calibre Licenses

First we want to add all the Monitors that serve all WANable calibre licenses to Allocator.
# Segment of vovlad/config.tcl

# Monitor for US
LA::AddLicenseMonitor jupiter:5555

# Monitor for Asia
LA::AddLicenseMonitor tiger:5555

# Monitor for Europe
LA::AddLicenseMonitor queen:5555

Since the Allocator daemon checks the config file at every cycle, and reads it if it has changed, you may have to wait 1 or 2 minutes to see the changes reflected in the Allocator page.

Then you need to add the resource to be managed by Allocator.
# Segment of vovlad/config.tcl

# Manage resource 'WAN:calibre', which is derived from 
# the specified list of tags for the FlexNet Publisher feature 'calibre'
LA::DefineResourceGroup WAN:calibre {
  LA::AddResource WAN:us_calibre FlexLM/US_WAN/calibre "" 
  LA::AddResource WAN:jp_calibre FlexLM/ASIA_WAN/calibre "" 
  LA::AddResource WAN:eu_calibre FlexLM/EUROPE_WAN/calibre "" 

In the above example, we assume Accelerator is running on host_us, host_asia, and host_europe in US, Asia and Europe, respectively; and their Monitor has the corresponding tags.

We also need to use the -tags option to specify what tags are involved in Allocator. That is because, for example, we configured both US_WAN and US_LOCAL tags in the same Monitor. When Allocator connects to this Monitor server, it needs to tell the difference between wannable and non-wannable licenses to know which license features should be managed by Allocator.

We use WAN:calibre as the Accelerator resource name for calibre, which is the same name that we use in resources.tcl. By doing this, the resource WAN:calibre becomes managed by Allocator rather than vovresourced since Allocator has a higher rank than vovresourced. When Allocator goes down, the WAN:calibre resource set by Allocator will expire automatically after a short while (about 1 minute), which enables vovresourced to become the owner of this resource once again.

You also need to define the Accelerator sites and assign relative weights on the resource for each site. For example, the following configuration allows 5:3:2 allocation of WAN:calibre resource among US, ASIA and EUROPE queues:
# Segment of vovlad/config.tcl

LA::AddSite vnc@host_us US {
    WAN:calibre 50
} -port 6271 

LA::AddSite vnc@host_asia ASIA { 
    WAN:calibre 30

LA::AddSite vnc@host_europe EU {
    WAN:calibre 20

After this setup, check the Allocator CGI page again. You should see the total number of calibre licenses from all sites.

Step 4: Setup Jobclasses for LM_LICENSE_FILE environment variable

Check Jobclass documentation for details on how to setup job classes.

To set the LM_LICENSE_FILE environment variable for jobs at runtime, you need to set the VOV_LM_VARNAMES variable.
# Example of jobclass/calibre.tcl

set classDescription        "Calibre jobs"
set VOV_JOB_DESC(resources) "License:calibre"

Then when you submit jobs, you can use -C calibre option. After you submit job, you can use nc info -l <jobId> to look at the log file of the job to make sure it does set the correct LM_LICENSE_FILE environment variable.