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)
- 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.
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
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
#
# 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.
#
# 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.
#
# 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 the Jobclass documentation for details on how to setup job classes.
#
# Example of jobclass/calibre.tcl
#
set classDescription "Calibre jobs"
set VOV_JOB_DESC(resources) "License:calibre"
set VOV_JOB_DESC(env) "BASE+CALIBRE+D(VOV_LM_VARNAMES=LM_LICENSE_FILE)"
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.