Skip to main content

License Scheduling

Overview

fsched provides license server monitoring and license allocation management for the current cluster. When a license query script exists, fsched automatically monitors license usage changes and adjusts the number of licenses available to jobs in real time, ensuring licenses are allocated correctly during scheduling.

warning
  • Enabling license scheduling affects job scheduling and must be configured carefully by administrators.
tip
  • Ensure network connectivity between the cluster head node and the license server.
  • The license query script is uploaded to the cluster head node. The fixed path and file name must be /etc/fastone/license_query, and the script output format must follow the specified format. See >>> License Query Script Output Format.
  • Because fsched converts license names and server names to lowercase, users must submit license names and server names in lowercase when submitting jobs.
  • If the license query script uses the license server client tool lmstat, you must add the license server domain name to /etc/hosts on the head node first.

Configuration

License scheduling provides two configuration tools for administrators:

  1. License Allocation management: manage current cluster license allocations to limit the maximum number of licenses the cluster can use, using the sacctmgr resource command.
  2. License Sync management: manage synchronization of license usage.

License Allocation Management

Use the sacctmgr resource command to manage license allocation for the current cluster.

Get the current cluster name

scontrol show config | grep ClusterName

Add license allocation

  1. Check whether the license already exists.
sacctmgr show resource name=test8 server=server3
  1. If it does not exist, you can add it in one step:
sacctmgr add resource name=test8 server=server3 servertype=flexlm type=license count=60 cluster=fastone-1 percentallowed=70
  1. If it already exists:

If the license already exists, you cannot set a new count. If you need to modify it, use the sacctmgr modify resource command.

3.1 Check whether there is an allocation for the current cluster:

sacctmgr show resource withclusters name=test8 server=server3 cluster=fastone-1

3.2 If there is no allocation for the current cluster, you can set percentallowed for the current cluster:

sacctmgr add resource name=test8 server=server3 cluster=fastone-1 percentallowed=70

3.3 If there is already an allocation for the current cluster, you cannot set it again. If you need to modify it, use the sacctmgr modify resource command.

Parameter descriptions:

  • name: license name
  • cluster: fsched cluster name
  • count: total number of licenses, including the total available inside and outside the cluster
  • percentallowed: percentage allowed for the current cluster
  • server: license server name
  • servertype: license server type
  • type: resource name, should be license in this workflow

Modify license allocation

  • To modify the total license count:
sacctmgr modify resource name=matlab server=server2 set count=200
  • To modify percentallowed for the current cluster:
sacctmgr modify resource name=matlab server=server2 cluster=fastone-1 set percentallowed=30

Parameter descriptions:

  • name: license name
  • server: server name
  • cluster: fsched cluster name
  • count: new total license count
  • percentallowed: new percentage

Delete license allocation

  • If there is only one cluster, or if you want to delete allocations for all clusters:
sacctmgr delete resource where name=matlab server=server2
  • If there are multiple clusters and you want to delete the allocation for the current cluster:
sacctmgr delete resource where name=matlab server=server2 cluster=fastone-1

Parameter descriptions:

  • name: license name
  • server: server name
  • cluster: fsched cluster name

Query license allocation

  • Query allocations for the current cluster:
# Query all license allocations
sacctmgr show resource withclusters cluster=fastone-1

# Filter by name
sacctmgr show resource withclusters cluster=fastone-1 name=nastran

# Filter by server
sacctmgr show resource withclusters cluster=fastone-1 server=flex_host

# Exact query
sacctmgr show resource withclusters cluster=fastone-1 name=matlab server=rlm_host
  • Query all license allocations:
sacctmgr show resource

Parameter descriptions:

  • name: filter by license name
  • server: filter by server name
  • cluster: fsched cluster name

License Sync Management

Use the output of the license query script to automatically sync license usage changes to the current cluster.

Set the license query script

License Query Script Output Format

The script must print license information to standard output (stdout), one line per entry, in the following format:

name@server_name:consumed
FieldDescription
namelicense name
server_namelicense server name
consumedcurrent number of licenses in use

Example output:

ansys@flexlm_server:5
meba@flexlm_server:20
  • The license query script takes no input parameters.
  • Script examples and documentation can be found on the head node at /opt/fsched/wrappers/statesvc/license_tools/.
License query script deployment

Copy the script to the fixed query path /etc/fastone/license_query. For example, with the script license_query_flexlm.sh:

cp license_query_flexlm.sh /etc/fastone/license_query
chmod +x /etc/fastone/license_query

Stop license sync

Delete the license query script /etc/fastone/license_query to stop synchronization automatically.

View license sync status

/opt/fsched/wrappers/statesvc/bin/stateclient lic-sync-status

This shows the current license sync status, including sync status, last update time and content, and error messages.

Configuration Example

The following commands are run on the cluster head node, using a single-cluster scenario as an example.

  1. Check whether the license to be managed has already been allocated to the current cluster; if not, allocate it.

    • View the current cluster name:
    [root@centos7-16c-1 ~]# scontrol show config | grep ClusterName
    ClusterName = fastone-2
    • View allocated licenses:
    [root@centos7-16c-1 ~]# sacctmgr show resource
    Name Server Type Count % Allocated ServerType
    ---------- ---------- -------- ------ ----------- ----------
    • The total license count can be confirmed via Total in lmstat output:
    [root@centos7-16c-1 ~]# ./lmstat -f ansys -c 1055@10.106.1.111
    lmstat - Copyright (c) 1989-2016 Flexera Software LLC. All Rights Reserved.
    Flexible License Manager status on Fri 3/13/2026 18:39

    License server status: 1055@ansys-lic
    License file(s) on ansys-lic: /fastone/softwares/ansys/ansys/2024R1/ansys_inc/shared_files/licensing/license_files/ansyslmd.lic:

    ansys-lic: license server UP (MASTER) v11.19.4

    Vendor daemon status (on ansys-lic):

    ansyslmd: UP v11.19.4
    Feature usage info:

    Users of ansys: (Total of 100 licenses issued; Total of 0 licenses in use)

    [root@centos7-16c-1 ~]# ./lmstat -f meba -c 1055@10.106.1.153
    lmstat - Copyright (c) 1989-2016 Flexera Software LLC. All Rights Reserved.
    Flexible License Manager status on Fri 3/13/2026 18:43

    License server status: 1055@ansys-lic
    License file(s) on ansys-lic: /fastone/softwares/ansys/ansys/2024R1/ansys_inc/shared_files/licensing/license_files/ansyslmd.lic:

    ansys-lic: license server UP (MASTER) v11.19.4

    Vendor daemon status (on ansys-lic):

    ansyslmd: UP v11.19.4
    Feature usage info:

    Users of meba: (Total of 100 licenses issued; Total of 0 licenses in use)
    • If this Name,Server combination does not exist, allocate the maximum available licenses for the current cluster. Use a unique server name defined by the administrator that corresponds to the license server:
    [root@centos7-16c-1 ~]# sacctmgr add resource name=ansys server=flexlm_server servertype=flexlm_server type=license count=100 cluster=fastone-2 percentallowed=100
    Adding Resource(s)
    ansys@flexlm_server
    Cluster - fastone-2 100%
    Settings
    Name = ansys
    Server = flexlm_server
    Description = ansys
    ServerType = flexlm_server
    Count = 100
    Type = License
    Would you like to commit changes? (You have 30 seconds to decide)
    (N/y): y
    [root@centos7-16c-1 ~]# sacctmgr add resource name=meba server=flexlm_server servertype=flexlm_server type=license count=100 cluster=fastone-2 percentallowed=100
    Adding Resource(s)
    meba@flexlm_server
    Cluster - fastone-2 100%
    Settings
    Name = meba
    Server = flexlm_server
    Description = meba
    ServerType = flexlm_server
    Count = 100
    Type = License
    Would you like to commit changes? (You have 30 seconds to decide)
    (N/y): y
    • View the configuration results:
    [root@centos7-16c-1 ~]# sacctmgr show resource -p
    Name|Server|Type|Count|% Allocated|ServerType|
    ansys|flexlm_server|License|100|100|flexlm_server|
    meba|flexlm_server|License|100|100|flexlm_server|
  2. Set license synchronization.

    • Copy the script to the fixed query path /etc/fastone/license_query, using license_query_flexlm.sh as an example:
    cp license_query_flexlm.sh /etc/fastone/license_query
    chmod +x /etc/fastone/license_query
    • View license sync status:
    [root@centos7-16c-1 ~]# /opt/fsched/wrappers/statesvc/bin/stateclient lic-sync-status
    Sending requests to server localhost:20051
    Status: OK
    Last Update: 2026-03-13T11:08:24Z
    Licenses (2):
    ansys@flexlm_server: 30
    meba@flexlm_server: 20

Cluster Usage Example

The following commands can be run on any node in the cluster.

  1. View the licenses available to the current cluster.

The output in the example shows available licenses (license_name@server_name). LastConsumed shows total consumption for the license (including inside and outside the cluster), and Free shows remaining available licenses for the current cluster.

[root@centos7-16c-1 ~]# scontrol show lic --ext
LicenseName=meba@flexlm_server
LicenseName=meba@flexlm_server
Total=100 Used=0 Free=80 Reserved=0 Remote=yes
LastConsumed=20 LastDeficit=20 LastUpdate=Unknown
LicenseName=ansys@flexlm_server
Total=100 Used=0 Free=70 Reserved=0 Remote=yes
LastConsumed=30 LastDeficit=30 LastUpdate=Unknown
  1. Specify the requested license count when submitting a job.

The job below requests more licenses than the current Free value for that license in the cluster, so the job is pending due to Licenses.

[root@centos7-16c-1 ~]# srun -L ansys@flexlm_server:90 sleep 600&
[1] 5586
[root@centos7-16c-1 ~]# srun: job 7 queued and waiting for resources

[root@centos7-16c-1 ~]# squeue
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
7 partition sleep root PD 0:00 1 (Licenses)

After some time, if external license usage is released, fsched will automatically update the monitored license consumption to the cluster and the job can run.

[root@centos7-16c-1 ~]# squeue
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
7 partition sleep root R 0:05 1 jj-centos7-2
[root@centos7-16c-1 ~]# scontrol show lic --ext
LicenseName=meba@flexlm_server
Total=100 Used=0 Free=80 Reserved=0 Remote=yes
LastConsumed=20 LastDeficit=20 LastUpdate=Unknown
LicenseName=ansys@flexlm_server
Total=100 Used=90 Free=10 Reserved=0 Remote=yes
LastConsumed=5 LastDeficit=0 LastUpdate=Unknown