The USERBASED and HOSTBASED directives make a license "semi-floating" by requiring that all or a specified number of licenses are reserved for named users (USERBASED) or named hosts (HOSTBASED). For example, semi-floating licenses can be used as a means to ensure certain usernames/hostnames can reliably access licenses or offer a discount to customers by restricting usage to a greater extent than standard floating licenses.

The USERBASED and HOSTBASED directives are not mutually exclusive; however, normally only one is used for a given license configuration.

These directives can be used only with network licenses; accordingly, the COUNT directive must be set if USERBASED or HOSTBASED are set. If COUNT is unlimited, the reservation requirements are not enforced.

Syntax

The syntax for the USERBASED and HOSTBASED directives is described below.

<SETTING USERBASED="ALL|<number>"/>
<SETTING HOSTBASED="ALL|<number>"/>
OptionDescription
ALLReserves all licenses (COUNT) for named users or hosts.
<number>Reserves the specified number of licenses for named users or hosts. The number cannot be greater than COUNT.

The following is an example of using the USERBASED directive to require that all 10 licenses are reserved for named users:

<FEATURE NAME="f1">
  <SETTING COUNT="10"/>
  <SETTING USERBASED="ALL"/>
  <SETTING SHARE="VIRTUAL"/>
</FEATURE>

Usage and recommendations

The USERBASED/HOSTBASED directive is used in combination with reservations. For this directive to work, the end-user must list the reserved users and/or hosts under the "checkout:reserve" section in the license server configuration (lmx-serv.yaml) file. 

Usernames are listed under the "users" setting, as shown in the following example:

checkout:
  reserve:
    - feature: "f1"
      count: 10
      users:
        - "bob"
        - "alice"
        - "tester"

Hostnames are listed under the "hosts" setting, as shown in the following example:

checkout:
  reserve:
    - feature: "f3"
      count: 2
      hosts:
        - "host1"
        - "host2"

In the legacy configuration file format, the same reservations are specified as in the following example:

RESERVE_USER_F1_10 = bob alice tester
RESERVE_HOST_F3_2 = host1 host2

When the license server starts, it verifies that the reservations required by the license are present.

For every license with USERBASED/HOSTBASED set, the license server calculates the required number of reservations:

  • ALL: the COUNT of the license
  • <number>: the value specified in the USERBASED/HOSTBASED setting

The license server then compares this number with the "reserve" entry for the feature's users/hosts. 

If the feature's reserve count is lower than required, or there is no reserve count entry, the feature is ignored. In this case, the feature cannot be checked out by anyone, and the license server log will contain the following warning message:

WARNING: Feature f1 is ignored: The feature does not have the number of reservations required by the user-based license count of 10.

When the check passes, the licenses are served according to the normal reservation rules:

  • Reserved licenses that are not currently in use are held back, so only the listed users (or hosts) can use them.
  • If a user or host that is not on the reservation list requests a license that would use a reserved one, the checkout is denied with the LMX_RESERVE status.
  • If USERBASED is lower than COUNT, only the required number of licenses is protected. The remaining licenses can be used by any user.


  • The reserve count value is the number of licenses reserved for the whole list of users or hosts, not for each of them. Any of the listed users/hosts can use more than one of the reserved licenses, and the number of listed users/hosts does not have to be equal to the reserve count.
  • The reserve count must be at least the number required by the license (COUNT for ALL; otherwise, the USERBASED or HOSTBASED value).
  • The reserve count cannot be greater than the number of licenses available for the feature. The sum of all reservations for a feature cannot exceed it either, otherwise the license server fails to start and applicable warnings are written to the log.
  • Use only one user and/or host reservation entry per feature. Only the first matching entry is verified.
  • A reservation for all features (*) does not satisfy the requirement, because the license server looks for an entry with the name of the feature.
  • Feature names in reserve entries must match the feature names in the license file. A reservation for a feature that does not exist is skipped, and a warning is written to the log.