diff --git a/doc/html/licenses.shtml b/doc/html/licenses.shtml index 85ed6c63bc161b3eafcfbc49238997b3f8424082..3d6f847e9c6a51e13f62df18f217bf87a206d53d 100644 --- a/doc/html/licenses.shtml +++ b/doc/html/licenses.shtml @@ -4,33 +4,32 @@ <h2>Licenses Overview</h2> <p>Slurm can help with software license management by assigning available -licenses to jobs at scheduling time. If the license are not available, the -jobs are kept pending until some other jobs using the licenses complete -free a sufficient number of licenses. -License in Slurm are essentially shared resources meaning configured resources -that are not tied to a specific host, but are associated with the entire cluster.</p> +licenses to jobs at scheduling time. If the licenses are not available, +jobs are kept pending until licenses become available. +Licenses in Slurm are essentially shared resources, meaning configured resources +that are not tied to a specific host but are associated with the entire cluster. -<p>License in Slurm can be configured in two ways:</p> +<p>Licenses in Slurm can be configured in two ways:</p> <ul> -<li><b>Local Licenses</b> -Local licenses means they are local to the cluster using the +<li><b>Local Licenses:</b> +Local licenses are local to the cluster using the <it>slurm.conf</it> in which they are configured. </li> -<li><b>Remote Licenses</b> +<li><b>Remote Licenses:</b> Remote licenses are served by the database and are configured using the -<it>sacctmgr</it> command. This also makes them dynamic as upon running -the command the <it>slurmdbd</it> updates all clusters the licenses +<it>sacctmgr</it> command. Remote licenses are dynamic in nature as upon running +the <it>sacctmgr</it> the <it>slurmdbd</it> updates all clusters the licenses are assigned to. </li> </ul> <h2>Use Case</h2> -<p>A site has two license servers, one provides by FlexNet serving 100 Nastran -licenses and another one from Reprise License Management providing Matlab 50 -licenses. The site has two clusters named "fluid" and "pdf" dedicated to run +<p>A site has two license servers, one serves 100 Nastran licenses provided by +FlexNet and the other serves 50 Matlab licenses from Reprise License +Management. The site has two clusters named "fluid" and "pdf" dedicated to run simulation jobs using both products. The managers want to split the number -of Nastran licenses equally between clusters, but assign 70% of Matlab to -cluster "pdf" and the remaining 30% to cluster "fluid".</p> +of Nastran licenses equally between clusters, but assign 70% of the Matlab +licenses to cluster "pdf" and the remaining 30% to cluster "fluid".</p> <h2>Configuring Slurm for the use case</h2> <p>Here we assume that both clusters have been configured correctly in the @@ -44,76 +43,159 @@ $ sacctmgr show clusters format=cluster,controlhost </pre> <p>The licenses are added using the <i>sacctmgr</i> command, specifying the -total count of licenses and the percentage that should allocated -to each cluster.</p> +total count of licenses and the percentage that should be allocated +to each cluster. This can be done either in one step or through a +multi-step process. + +<p>One step: <pre> -$ sacctmgr add resource name=nastran cluster=fluid count=100 \ - percentallowed=50 server=flex_host servertype=flexlm \ - type=license +$ sacctmgr add resource name=nastran cluster=fluid,pdf \ + count=100 percentallowed=50 server=flex_host + servertype=flexlm type=license Adding Resource(s) - nastran@slurmdb + nastran@flex_host + Cluster - pdf 50% Cluster - fluid 50% Settings Name = nastran - Server = slurmdb + Server = flex_host Description = nastran - Manager = flex_host + ServerType = flexlm Count = 100 Type = License </pre> -<p>An equivalent command is executed to add the licenses to the other cluster, "pdf".</p> +<p>Multi-step: +<pre> +$ sacctmgr add resource name=matlab count=50 server=rlm_host \ + servertype=rlm type=license + Adding Resource(s) + matlab@rlm_host + Settings + Name = matlab + Server = rlm_host + Description = matlab + ServerType = rlm + Count = 50 + Type = License + +$ sacctmgr add resource name=matlab server=rlm_host + cluster=pdf percentallowed=70 +Adding Resource(s) + matlab@rlm_host + Cluster - pdf 70% + Settings + Server = rlm_host + Type = License + +$ sacctmgr add resource name=matlab server=rlm_host + cluster=fluid percentallowed=30 + Adding Resource(s) + matlab@rlm_host + Cluster - fluid 30% + Settings + Server = rlm_host + Type = License +</pre> + -<p>The configured licenses are now visible in both cluster using the <it>scontrol</it> -command.</p> +<p>The <it>sacctmgr</it> command will now display the grand total +of licenses. +<pre> +$ sacctmgr show resource + Name Server Type Count % Allocated ServerType +---------- ---------- -------- ------ ----------- ---------- + nastran flex_host License 100 100 flexlm + matlab rlm_host License 50 100 rlm + +$sacctmgr show resource withclusters + Name Server Type Count % Allocated ServerType Cluster % Allowed +---------- ---------- -------- ------ ----------- ---------- ---------- ---------- + nastran flex_host License 100 100 flexlm pdf 50 + nastran flex_host License 100 100 flexlm fluid 50 + matlab rlm_host License 50 100 rlm pdf 70 + matlab rlm_host License 50 100 rlm fluid 30 +</pre> + +<p>The configured licenses are now visible on both clusters using the +<it>scontrol</it> command. <pre> -# On cluster "fluid": $ scontrol show lic -LicenseName=nastran@slurmdb +LicenseName=matlab@rlm_host + Total=35 Used=0 Free=35 Remote=yes +LicenseName=nastran@flex_host Total=50 Used=0 Free=50 Remote=yes -# On cluster "pdf": +# On cluster "fluid": $ scontrol show lic -LicenseName=nastran@slurmdb +LicenseName=matlab@rlm_host + Total=15 Used=0 Free=15 Remote=yes +LicenseName=nastran@flex_host Total=50 Used=0 Free=50 Remote=yes </pre> -<p>Equivalent commands must be executed to add the matlab license to each -cluster, specifying different percentages and license server as appropriate.</p> +<p>When submitting jobs to remote licenses, the name and server must be used. <pre> -# On cluster "pdf": -$ scontrol show lic matlab@slurmdb -LicenseName=matlab@slurmdb - Total=35 Used=0 Free=35 Remote=yes +$ sbatch -L nastran@flex_host script.sh +Submitted batch job 5172 +</pre> -# On cluster "fluid": -$ scontrol show lic matlab@slurmdb -LicenseName=matlab@slurmdb - Total=15 Used=0 Free=15 Remote=yes + +<p>License percentages and counts can be modified as shown below: +<pre> +$ sacctmgr modify resource name=matlab server=rlm_host set \ + count=200 + Modified server resource ... + matlab@rlm_host + Cluster - pdf - matlab@rlm_host + Cluster - fluid - matlab@rlm_host + +$ sacctmgr modify resource name=matlab server=rlm_host \ + cluster=pdf set percentallowed=60 + Modified server resource ... + Cluster - pdf - matlab@rlm_host + +$ sacctmgr show resource withclusters + Name Server Type Count % Allocated ServerType Cluster % Allowed +---------- ---------- -------- ------ ----------- ---------- ---------- ---------- + nastran flex_host License 100 100 flexlm pdf 50 + nastran flex_host License 100 100 flexlm fluid 50 + matlab rlm_host License 200 90 rlm pdf 60 + matlab rlm_host License 200 90 rlm fluid 30 </pre> -<p>The <it>sacctmgr</it> command will now display the grand total -of licenses.</p> +<p>Licenses can be deleted either on the cluster or all together as shown: <pre> -$ sacctmgr show resource - Name Server Type Count % Allocated ServerType ----------- ---------- -------- ------ ----------- ---------- - nastran slurmdb License 100 100 flex_host - matlab slurmdb License 50 100 flex_host +$ sacctmgr delete resource where name=matlab server=rlm_host \ + cluster=fluid + Deleting resource(s)... + Cluster - fluid - matlab@rlm_host + +$ sacctmgr delete resource where name=nastran server=flex_host + Deleting resource(s)... + nastran@flex_host + Cluster - pdf - nastran@flex_host + Cluster - fluid - nastran@flex_host + +$ sacctmgr show resource withclusters + Name Server Type Count % Allocated ServerType Cluster % Allowed +---------- ---------- -------- ------ ----------- ---------- ---------- ---------- + matlab rlm_host License 200 60 rlm pdf 60 </pre> + <h2>Dynamic licenses</h2> <p>When the license counter and percentage is updated using the <it>sacctmgr</it> -command, the values are updated in the database and the updated values sent -to the slurmctld daemon. In this way the remote licenses are also dynamic. +command, the values are updated in the database and the updated values are sent +to the slurmctld daemon. It is possible for sites to write a script that detects global license counter -changes due to new licenses being add or old licenses being removed and +changes due to new licenses being added, or old licenses being removed, and updates Slurm. Should the license count decrease, the running jobs will not be affected only the dispatch of new job will reflect the new license count.</p> <p class="footer"><a href="#top">top</a></p> -<p style="text-align:center;">Last modified 10 October 2014</p> +<p style="text-align:center;">Last modified 2 February 2015</p> <!--#include virtual="footer.txt"--> diff --git a/doc/html/reservations.shtml b/doc/html/reservations.shtml index 2bf0154cc2b7c97d262d76af4d654f1316f84aef..2d432ce758ee42a31b028abfd711944b6d04af18 100644 --- a/doc/html/reservations.shtml +++ b/doc/html/reservations.shtml @@ -74,7 +74,7 @@ this reservation will prevent any job specifying the need for needed a lustre license from being scheduled on this cluster during this reservation.</p> <pre> $ scontrol create reservation starttime=2009-04-06T16:00:00 \ - duration=120 user=root flags=ignore_jobs \ + duration=120 user=root flags=license_only \ licenses=lustre:1000 Reservation created: root_4 @@ -83,7 +83,7 @@ ReservationName=root_4 StartTime=2009-04-06T16:00:00 EndTime=2009-04-06T18:00:00 Duration=120 Nodes= NodeCnt=0 Features=(null) PartitionName=(null) - Flags=IGNORE_JOBS Licenses=lustre*1000 + Flags=LICENSE_ONLY Licenses=lustre*1000 Users=root Accounts=(null) </pre> diff --git a/doc/man/man1/sacctmgr.1 b/doc/man/man1/sacctmgr.1 index d99b0fc2486e7a8b71be59a513165cdcc290ecc7..1a8096c3b3044569ba426e644504fe4f869ad205 100644 --- a/doc/man/man1/sacctmgr.1 +++ b/doc/man/man1/sacctmgr.1 @@ -1317,7 +1317,7 @@ To clear a previously set value use the modify command with a new value of \-1. \fIClusters\fP=<name list> Comma separated list of cluster names on which specified resources are to be -available. If no names are designated the all clusters already +available. If no names are designated then the clusters already allowed to use this resource will be altered. .TP