Installation & Licensing Center
HOW TO - Release a Stuck License
Authored by Nick Heberle
March 21st, 2022
3475 views
2 likes
KB1072674
Description
When network connectivity to the license server is interrupted or a client application crashes, any checked out license increment can remain falsely checked out.
When a license increment gets stuck, it can be stuck in either the FlexLM component or the Ansys Licensing Interconnect.
Related - ERROR - Cannot return a borrowed license
Solution
Option 1 - Restart the Ansys License Manager (Fastest)
If possible, the fastest resolution for stuck licenses is to restart the Ansys License Manager
DeleteOption 2 - Wait for License Timeout
When a license increment is stuck, the license server is no longer receiving a client heartbeat for that license increment check out. After approximately two hours, the missed heartbeat threshold will be met, and the license increment will be checked in and made available in the license pool. If this does not occur, which has been seen in the past, you will need to use a different method to remove the license.
DeleteOption 3 - Manually Remove Stuck Increment from FlexLM via Command Line
- Verify the license increments currently checked out via FlexLM
- On the license server, open a command prompt
- Change directory to the folder with the licensing utilities:
cd C:\Program Files\ANSYS Inc\Shared Files\Licensing\winx64
- Use lmstat to query the license serverfor currently checked out increments:
lmutil.exe lmstat -a -c 1055@localhost
- The output will display all license increments on the server and any user checkouts of those license increments.
- Remove the stuck increment
- Use the lmremove command to remove the stuck increment:
lmutil.exe lmremove [-c license_file_list] feature user user_host display
- Use the lmremove command to remove the stuck increment:
Example:
Our user, Nick, uses Ansys 2020 R2 on his office computer, DESKTOP-PC. Ansys has crashed, and the licenses are still checked out on the license server.
When our license server administrator runs the lmstat command, they receive the following output from the command, indicating that Nick has the "ansys" license increment checked out while the software is not running:
C:\Program Files\ANSYS Inc\Shared Files\licensing\winx64>lmutil.exe lmstat -a -c 1055@localhost Users of ansys: (Total of 1 license issued; Total of 1 license in use) "ansys" v9999.9999, vendor: ansyslmd, expiry: 28-feb-2022 floating license Nick DESKTOP-PC DESKTOP-PC 5796 (v2021.0512) (WinDev2108Eval/1055 101), start Tue 10/12 8:43
In order to remove the stuck "ansys" increment, the license administrator would need to run the lmremove command
lmutil.exe lmremove [-c license_file_list] feature user user_host display
Where:
- [-c license_file_list] indicates the license server/file to use, in this case port 1055 on our local server - 1055@localhost
- feature is the license increment to remove, in this case "ansys"
- user is the username of the affected user, in this case Nick
- user_host is the workstation of the affected user, in this case DESKTOP-PC (the first instance in the output)
- display is the display where the user is working, typically the same as the workstation name, in this case DESKTOP-PC (the second instance in the output)
For this user's scenario, the administrator would run the following command to remove the license increment:
lmutil.exe lmremove -c 1055@localhost ansys Nick DESKTOP-PC DESKTOP-PC
The lmremove command does not return an output, so the administrator would need to run lmstat again to confirm the increment has been removed.
DeleteOption 4 - Manually Remove Stuck Increment from Ansys Licensing Interconnect via Command Line
- Verify the increments checked out in the Ansys Licensing Interconnect
- On the license server, open a command prompt
- Change directory to the folder with the licensing utilities:
cd C:\Program Files\ANSYS Inc\Shared Files\Licensing\winx64
- Run the licensing interconnect usage command:
ansysli_util.exe -liusage
- The output will display all license increments currently checked out in the licensing interconnect.
- Remove the stuck increment
- Run the licensing interconnect remove command:
ansysli_util.exe -liremove <[user]@[host][:pid]>
where <[user]@[host][:pid]> corresponds to the information output by the -liusage command - The ansysli_util.exe -liremove will return an output listing the increments removed
- Run the licensing interconnect remove command:
Example:
Our user, Nick, uses Ansys 2020 R2 on his office computer, DESKTOP-PC. Ansys has crashed, and the licenses are still checked out on the license server.
When our license server administrator runs the -liusage command, they receive the following output from the command, indicating that Nick has the "ansys" license increment checked out while the software is not running:
C:\Program Files\ANSYS Inc\Shared Files\Licensing\winx64>ansysli_util.exe -liusage USER@HOST:PID TIMESTAMP NAME USED VERSION APP SERVER Nick@DESKTOP-PC:6172 2021/10/12 10:05:29 MECH_STRUCT 1 20.2 (2020.0507) MECH Nick@DESKTOP-PC:6172 2021/10/12 10:05:29 ansys 1 20.2 (2020.0507) MECH 1055@172.29.64.81 USER@HOST:PID TIMESTAMP NAME USED VERSION APP SERVERTo remove the "ansys" license increment, the administrator would remove all checkouts related to the user, their workstation, and the Process ID (PID) using the -liremove command:
C:\Program Files\ANSYS Inc\Shared Files\Licensing\winx64>ansysli_util.exe -liremove Nick@DESKTOP-PC:6172After running the command, the administrator output will indicate all the increments removed:
C:\Program Files\ANSYS Inc\Shared Files\Licensing\winx64>ansysli_util.exe -liremove Nick@DESKTOP-PC:6172 The following jobs have been removed: USER@HOST:PID TIMESTAMP NAME USED VERSION APP SERVER Nick@DESKTOP-PC:6172 2021/10/12 10:05:29 MECH_STRUCT 1 20.2 (2020.0507) MECH Nick@DESKTOP-PC:6172 2021/10/12 10:05:29 ansys 1 20.2 (2020.0507) MECH 1055@172.29.64.81 USER@HOST:PID TIMESTAMP NAME USED VERSION APP SERVER