blob: e61d2cfe3b60d4273399c82f36fbae1f7b1714e0 [file] [edit]
<!--#include virtual="header.txt"-->
<h1>Advanced Resource Reservation Guide</h1>
<p>Slurm has the ability to reserve resources for jobs
being executed by select users, QOS levels, partitions, and/or accounts.</p>
<h2 id="contents">Contents<a class="slurm_link" href="#contents"></a></h2>
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#resource_access">Access to Reserved Resources</a></li>
<li><a href="#management">Reservation Management</a>
<ul>
<li><a href="#creation">Reservation Creation</a></li>
<li><a href="#use">Reservation Use</a></li>
<li><a href="#modification">Reservation Modification</a></li>
<li><a href="#deletion">Reservation Deletion</a></li>
</ul></li>
<li><a href="#access_control">Reservation Access Control</a></li>
<li><a href="#special_types">Special Reservation Flags</a>
<ul>
<li><a href="#overlap">OVERLAP</a></li>
<li><a href="#maint">MAINT</a></li>
<li><a href="#recurring">Recurring</a></li>
<li><a href="#time_float">TIME_FLOAT</a></li>
<li><a href="#any_nodes">ANY_NODES / LICENSE_ONLY</a></li>
<li><a href="#replace">REPLACE</a></li>
<li><a href="#flex">FLEX</a></li>
<li><a href="#magnetic">MAGNETIC</a></li>
<li><a href="#purge">PURGE_COMP</a></li>
</ul></li>
<li><a href="#account">Reservation Accounting</a></li>
<li><a href="#pro_epi">Prolog and Epilog</a></li>
<li><a href="#limitations">Limitations</a></li>
</ul>
<h2 id="overview">Overview
<a class="slurm_link" href="#overview"></a>
</h2>
<p>An advanced resource reservation identifies the resources in that reservation,
a time period during which the reservation is in place, and access controls
identifying the jobs that can access the reserved resources. The resources which
can be reserved include nodes, cores, GRES, licenses, and burst buffers.
A reservation that contains nodes, cores, or GRES is associated with one
partition, and cannot span resources over multiple partitions. The only
exception is when the reservation is created on specific nodes.</p>
<p>Reservations can be created, updated, or deleted using the <b>scontrol</b>
command. By default, these operations are only available to
<a href="scontrol.html#SECTION_AUTHORIZATION">privileged users</a>. (See the
<a href="scontrol.html#SECTION_RESERVATIONS---SPECIFICATIONS-FOR-CREATE-AND-UPDATE-COMMANDS">
scontrol man page</a> for a full list of fields relating to reservations.)
The <b>scontrol</b> and <b>sview</b> commands can be used to view reservations.
Additionally, root and the configured <b>SlurmUser</b> have access to all
reservations, even if they would normally not have access.
Other privileged users can modify reservations to give themselves access.</p>
<h2 id="resource_access">Access to Reserved Resources
<a class="slurm_link" href="#resource_access"></a>
</h2>
<p>Creating a reservation prevents any jobs from using the reserved resources
unless they run within the reservation (see <a href="#use">Reservation Use</a>
and <a href="#access_control">Access Control</a> sections). Jobs inside the
reservation will be able to use any of the reservation's reserved resources plus
licenses and burst buffers that are not in any reservation.
(If the <a href="#flex">FLEX</a> flag is set, they may also use unreserved
resources of all other types.) This special handling eliminates the need to
explicitly put licenses or burst buffers into every reservation created.
Note that if multiple reservations exist in the system, then jobs inside one
reservation will be outside all other reservations.</p>
<table class="tlist">
<tr>
<td></td>
<td><strong>Nodes, node-specific resources</strong></td>
<td><strong>Licenses, burst buffers</strong></td>
</tr>
<tr>
<td>Jobs inside reservation</td>
<td>only reserved resources</td>
<td>reserved + unreserved resources</td>
</tr>
<tr>
<td>Jobs outside reservation</td>
<td>no reserved resources</td>
<td>no reserved resources</td>
</tr>
</table>
<h2 id="management">Reservation Management
<a class="slurm_link" href="#management"></a>
</h2>
<h3 id="creation">Reservation Creation
<a class="slurm_link" href="#creation"></a>
</h3>
<p>A simple example of reservation creation could be reserving two nodes for a
specific user. This could be given with a count of nodes to reserve, or by a
list of specific nodes to reserve:</p>
<pre>
# Create a two node reservation for user alan
$ scontrol create reservation \
StartTime=now Duration=60 \
User=alan NodeCnt=2
Reservation created: alan_1
# Create a two node reservation for user brenda on two specific nodes
$ scontrol create reservation \
StartTime=now Duration=60 \
User=brenda Nodes=n8,n9
Reservation created: brenda_2
</pre>
<p>Note that the message confirming that the reservation is created includes
the name used for the reservation. A name may be provided in the
<b>ReservationName</b> field, otherwise a unique name will be created
automatically based on the provided parameters and a numeric suffix.</p>
<p>Specific nodes to be associated with the reservation are identified
immediately after creation of the reservation. This permits users to stage files
to the nodes in preparation for use during the reservation. The reservation
creation request can also identify the partition from which to select the nodes
or certain features that every selected node must have.</p>
<p>On a smaller system, one might want to reserve cores or GRES (not available
with the <b>select/linear</b> plugin). This reserves only part of the involved
nodes, allowing those nodes' unreserved resources to be used by other jobs.
If GRES are specified, it will also reserve at least one core on each involved
node. Refer to the <a href="scontrol.html#OPT_TRES">TRES</a> option
documentation for details on reserving GRES.</p>
<pre>
# Create a two core reservation for user alan
$ scontrol create reservationname=alan_2core \
StartTime=now Duration=60 \
User=alan NodeCnt=1 CoreCnt=2
Reservation created: alan_2core
# Create a reservation of one GPU on node tux8 for user alan
$ scontrol create reservationname=brenda_1gpu \
StartTime=now Duration=60 \
Nodes=tux8 TRES=gres/gpu=1 User=brenda
</pre>
<p>In addition to <i>allowing</i> access to specific entities, reservations
may also <i>deny</i> access using those same entity types (accounts, QOS levels,
partitions, and/or users). In the following example, a reservation is created
for account <i>foo</i>, but user <i>alan</i> is prevented from using the
reservation even when using the account <i>foo</i>.</p>
<pre>
$ scontrol create reservationname=foo_no_alan \
starttime=noon duration=60 \
account=foo user=-alan partition=pdebug nodecnt=10
Reservation created: foo_no_alan
$ scontrol show res
ReservationName=foo_no_alan StartTime=2026-09-12T12:00:00 EndTime=2026-09-12T13:00:00 Duration=01:00:00
Nodes=n[1-10] NodeCnt=10 CoreCnt=120 Features=(null) PartitionName=pdebug Flags=
TRES=cpu=240
AllowedPartitions=(null) QOS=(null)
Users=-alan Groups=(null) Accounts=foo Licenses=(null) State=INACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
</pre>
<p>When creating a reservation, you can request that Slurm include all the
nodes in a partition by specifying the <b>PartitionName</b> option.
If you only want a certain number of nodes or CPUs from that partition
you can combine <b>PartitionName</b> with the <b>CoreCnt</b>, <b>NodeCnt</b>,
<b>TRES</b>, or <b>TRESPerNode</b> options to specify how many of a resource
you want. In the following example, a reservation is created in the 'gpu'
partition that uses the <b>TRESPerNode</b> option to reserve 6 processors on
each of 4 nodes (24 processors in total).</p>
<pre>
$ scontrol create reservationname=partition_test \
start=now duration=10 \
user=user1 partition=gpu trespernode=cpu=6 nodecnt=4
Reservation created: partition_test
$ scontrol show res
ReservationName=partition_test StartTime=2026-09-11T13:20:00 EndTime=2026-09-11T13:30:00 Duration=00:10:00
Nodes=g[1-4] NodeCnt=4 CoreCnt=24 Features=(null) PartitionName=gpu Flags=
NodeName=g1 CoreIDs=0-5
NodeName=g2 CoreIDs=0-5
NodeName=g3 CoreIDs=0-5
NodeName=g4 CoreIDs=0-5
TRES=cpu=24
AllowedPartitions=(null) QOS=(null)
Users=user1 Groups=(null) Accounts=(null) Licenses=(null) State=ACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
</pre>
<h3 id="use">Reservation Use<a class="slurm_link" href="#use"></a></h3>
<p>When a reservation is created, Slurm responds with its name, whether
specified in the command or automatically generated by Slurm. In order to use
the reservation, the job submit request must explicitly specify that
reservation name (or the reservation must be <a href="#magnetic">magnetic</a>).
The job must be contained completely within the named reservation; it cannot use
any resources outside of the reservation (except licenses and burst buffers).
The job will be canceled after the reservation reaches its EndTime, unless
the <a href="#flex">FLEX</a> flag is set on the reservation or
<a href="slurm.conf.html#OPT_ResvOverRun">ResvOverRun</a> is set in slurm.conf.</p>
<pre>
$ sbatch --reservation=foo_no_alan -N4 my.script
sbatch: Submitted batch job 65540
</pre>
<p>Note that use of a reservation does not alter a job's priority, but it
does give it preferential treatment outside of its priority.
Any job with a reservation is considered for scheduling to resources
before any other job in the same partition not associated with a reservation.</p>
<h3 id="modification">Reservation Modification
<a class="slurm_link" href="#modification"></a>
</h3>
<p>Reservations can be modified by privileged users. For example, their duration
could be altered or the users granted access changed as shown below:</p>
<pre>
$ scontrol update ReservationName=partition_test \
duration=150 users=admin
Reservation updated.
$ scontrol show ReservationName=partition_test
ReservationName=partition_test StartTime=2026-09-11T13:20:00 EndTime=2026-09-11T15:50:00 Duration=02:30:00
Nodes=g[1-4] NodeCnt=4 CoreCnt=24 Features=(null) PartitionName=gpu Flags=
NodeName=g1 CoreIDs=0-5
NodeName=g2 CoreIDs=0-5
NodeName=g3 CoreIDs=0-5
NodeName=g4 CoreIDs=0-5
TRES=cpu=24
AllowedPartitions=(null) QOS=(null)
Users=admin Groups=(null) Accounts=(null) Licenses=(null) State=ACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
</pre>
<h3 id="deletion">Reservation Deletion
<a class="slurm_link" href="#deletion"></a>
</h3>
<p>Reservations are automatically purged after their end time.
They may also be manually deleted as shown below.
Note that a reservation cannot be deleted while there are
jobs running in it.</p>
<pre>
$ scontrol delete ReservationName=foo_no_alan
</pre>
<p>By default, only privileged users can delete reservations. This can be
expanded to include any user that is able to run in a reservation, using
either of the following options. Note that the <b>QOS</b> and
<b>AllowedPartitions</b> fields are not considered when determining who
may delete a reservation.</p>
<ul>
<li>Reservation-specific <b>USER_DELETE</b> flag</li>
<li>Global <b>SlurmctldParameters=user_resv_delete</b> option</li>
</ul>
<p><b>NOTE</b>: By default, when a reservation ends, any pending jobs requesting
the reservation will have their reservation request removed and will be put
into a held state. If the jobs are then released, they will run outside of the
reservation. Use the <b>NO_HOLD_JOBS_AFTER_END</b> reservation flag to let jobs
run outside of the reservation automatically after the reservation is gone.</p>
<h2 id="access_control">Reservation Access Control
<a class="slurm_link" href="#access_control"></a>
</h2>
<p>When a new reservation is created, it must include at least one access
control field with valid entity name(s):</p>
<ul>
<li><b>Accounts</b></li>
<li><b>AllowedPartitions</b> (25.11+)</li>
<li><b>QOS</b> (25.11+)</li>
<li><b>Users</b> OR <b>Groups</b></li>
</ul>
<p>Note that <b>Users</b> and <b>Groups</b> are mutually exclusive; if one is
utilized, the other must be unset. An existing reservation cannot be modified
to change between these two fields in a single command. It is usually simplest
to create a new reservation if this is needed.</p>
<p>If multiple access control fields are specified, a job must be approved by
all of them to use the reservation. Most access control fields support
explicitly denying specific names from accessing the reservation. All access
control fields support adding or removing names from the list, though the exact
functionality varies. Refer to the relevant
<a href="scontrol.html#SECTION_RESERVATIONS---SPECIFICATIONS-FOR-CREATE-AND-UPDATE-COMMANDS">
scontrol documentation</a> for field-specific details.</p>
<p>Prior to version 25.05, if a reservation used user- or group-based access
controls and <b>slurmctld</b> ever failed to validate the user(s) or group(s),
it would delete the reservation. With the release of 25.05 this behavior was
changed to leave the reservation in place and wait for the users/groups to be
able to be validated again, making reservations resilient to temporary
validation outages.</p>
<h2 id="special_types">Special Reservation Flags
<a class="slurm_link" href="#special_types"></a>
</h2>
<p>A partial list of some commonly used flags is provided in this section.
Refer to the <a href="scontrol.html#OPT_Flags">scontrol man page</a> for an
exhaustive list of available flags.</p>
<h3 id="overlap">OVERLAP
<a class="slurm_link" href="#overlap"></a>
</h3>
<p>By default, reservations must not overlap. They must either include different
nodes or operate at different times. If specific nodes are not provided when a
reservation is created, Slurm will automatically select nodes to avoid overlap
and ensure that the selected nodes are available when the reservation begins.
This behavior can be changed by adding the <b>OVERLAP</b> flag to a reservation.
This might be used to ensure availability of resources for a specific user
within a group having a reservation.</p>
<p>For example, if users <i>alan</i> and <i>brenda</i> have a 10 node
reservation for 60 minutes, we might want to reserve 4 of those nodes for
<i>brenda</i> during the first 30 minutes of the time period. In this case, the
creation of one overlapping reservation (for a total of two reservations) allows
for simpler setup and usage of these reservations. Without this flag, it would
be necessary to create three separate reservations, and the users would need to
select between two different reservation names during the final 30 minutes:</p>
<ol>
<li>A six node reservation for both <i>alan</i> and <i>brenda</i> that lasts the
full 60 minutes</li>
<li>A four node reservation for <i>brenda</i> for the first 30 minutes</li>
<li>A four node reservation for both <i>alan</i> and <i>brenda</i> that lasts
for the final 30 minutes</li>
</ol>
<p>If the <b>OVERLAP</b> flag is used when creating reservations, one could
create a reservation within a reservation within a third reservation. Note that
a reservation having the <b>OVERLAP</b> flag will not have resources removed
from it by a subsequent reservation also having the <b>OVERLAP</b> flag, so more
overlapping reservations will just allow the same resources to be accessed with
different reservation names.</p>
<h3 id="maint">MAINT
<a class="slurm_link" href="#maint"></a>
</h3>
<p>For ease of system maintenance, you can create a reservation with the
<b>MAINT</b> flag that overlaps existing reservations. This is similar to the
<b>OVERLAP</b> flag but with the following distinctions:</p>
<ul>
<li>Reserved nodes will be shown in <b>maint</b> state</li>
<li>Reserved nodes will not be available as replacements in other reservations</li>
<li>Reserved nodes will only be available to jobs running in a maintenance
reservation (not in a normal overlapping reservation)</li>
<li>Cluster usage reports will show this time as <b>PlannedDown</b></li>
</ul>
<p>For example, users <i>alan</i> and <i>brenda</i> might have a reservation
for some nodes daily from noon until 1PM. If there is a maintenance reservation
for all nodes starting at 12:30PM, the only jobs they may start in their
reservation would have to be completed by 12:30PM, when the maintenance
reservation begins.</p>
<p>By default, only resources which are not expected to have a running job
at the reservation's start time can be reserved (the time limit of all running
jobs will have been reached). This can be impractical when reserving many nodes
for maintenance, so <b>IGNORE_JOBS</b> is commonly used in this situation.
This requires the administrators to manually cancel or requeue the running jobs
as needed to perform system maintenance. After the reservation is created, only
jobs that can complete before the reservation's start time will be started.</p>
<pre>
$ scontrol create reservationname=maint_all \
starttime=2026-09-16T16:00:00 duration=120 \
user=root flags=maint,ignore_jobs nodes=ALL
Reservation created: maint_all
$ scontrol show reservation
ReservationName=maint_all StartTime=2026-09-16T16:00:00 EndTime=2026-09-16T18:00:00 Duration=02:00:00
Nodes=g[1-5],n[1-20],vm1 NodeCnt=26 CoreCnt=282 Features=(null) PartitionName=(null)
Flags=MAINT,IGNORE_JOBS,SPEC_NODES,ALL_NODES
TRES=cpu=482
AllowedPartitions=(null) QOS=(null)
Users=root Groups=(null) Accounts=(null) Licenses=(null) State=INACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
</pre>
<p>This flag may also be useful for reserving one or more specific nodes to
troubleshoot issues. Note the infinite duration, which requires an administrator
to explicitly delete the reservation once maintenance is complete:</p>
<pre>
$ scontrol create reservationname=maint_specific \
starttime=now duration=infinite \
user=root flags=maint nodes=n10
Reservation created: maint_specific
$ scontrol show res
ReservationName=maint_specific StartTime=2026-09-11T13:36:53 EndTime=2027-09-11T13:36:53 Duration=365-00:00:00
Nodes=n10 NodeCnt=1 CoreCnt=8 Features=(null) PartitionName=(null) Flags=MAINT,SPEC_NODES
TRES=cpu=16
AllowedPartitions=(null) QOS=(null)
Users=root Groups=(null) Accounts=(null) Licenses=(null) State=ACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
</pre>
<h3 id="recurring">Recurring
<a class="slurm_link" href="#recurring"></a>
</h3>
<p>Slurm allows a reservation to be repeated on one of several predefined
intervals. The reservation will have the same characteristics and will
automatically toggle between <b>active</b> and <b>inactive</b> (future) states.
This is achieved by setting one of the following flags when creating the
reservation: <b>HOURLY</b>, <b>DAILY</b>, <b>WEEKLY</b>, <b>WEEKDAY</b>, or
<b>WEEKEND</b>. The first three directly represent the repetition interval,
while the last two represent the type of day on which the reservation should
repeat.</p>
<p>A <b>WEEKDAY</b> reservation must start on a weekday, and a <b>WEEKEND</b>
reservation must start on a Saturday or a Sunday. The start day is determined
in the local time zone of the <b>slurmctld</b> host. This is checked when the
reservation is created and on any update that sets <b>StartTime</b> or
specifies a recurring flag, so adding <b>WEEKEND</b> to a reservation
that starts on a Tuesday is rejected unless the update also sets a
<b>StartTime</b> on a day that flag covers. Similarly, swapping between
<b>WEEKDAY</b> and <b>WEEKEND</b> also needs a new <b>StartTime</b> on a day the
incoming flag covers:</p>
<pre>
# 2026-08-29 was a Saturday; any future Saturday or Sunday works
$ scontrol update ReservationName=resv1 \
Flags=-WEEKDAY,+WEEKEND StartTime=2026-08-29T09:00:00
</pre>
<p>An active reservation cannot have its <b>StartTime</b> changed, so a swap
between the <b>WEEKDAY</b> and <b>WEEKEND</b> flags cannot be made during an
occurrence of the recurring reservation. When the occurrence ends, the next
start and end times are determined, at which point a swap can be made.</p>
<p><b>NOTE</b>: When a recurring reservation attempts to replace nodes, it
will consider future availability of the resources and will only reserve
resources that are in an overlapping reservation or unreserved at that time.</p>
<p>This example demonstrates the creation and viewing of a recurring reservation:</p>
<pre>
$ scontrol create reservationname=daily_ab \
starttime=noon duration=60 \
user=alan,brenda flags=daily nodecnt=10
Reservation created: daily_ab
$ scontrol show res
ReservationName=daily_ab StartTime=2026-09-12T12:00:00 EndTime=2026-09-12T13:00:00 Duration=01:00:00
Nodes=n[1-10] NodeCnt=10 CoreCnt=120 Features=(null) PartitionName=active Flags=DAILY
TRES=cpu=240
AllowedPartitions=(null) QOS=(null)
Users=alan,brenda Groups=(null) Accounts=(null) Licenses=(null) State=INACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
</pre>
<h3 id="time_float">TIME_FLOAT
<a class="slurm_link" href="#time_float"></a>
</h3>
<p>Slurm can be used to create a reservation with a start time that remains a
fixed amount of time in the future.
These reservations are not intended to run jobs, but to prevent long running
jobs from being initiated on specific nodes. Because jobs cannot start on
reserved resources if they would be running when the reservation begins, the
reservation's start time determines the maximum job run time on those nodes.
Unlike placing the node in a DRAINING state, which prevents <b>any</b> new jobs
from starting there, a floating reservation only prevents jobs exceeding some
specific time limit from being started.
Job submissions attempting to use a floating reservation will be rejected.</p>
<p>A floating reservation may be useful when maintenance is anticipated on some
nodes but the exact time is not known, for example, when waiting on replacement
parts. When ready to perform the maintenance, place the node in DRAINING
state or create a new maintenance reservation and delete the previously created
floating reservation. Once the reservation-imposed max run time is reached, no
jobs will remain on the node and it will be ready for maintenance without
any need to requeue or cancel jobs.</p>
<p>Create the reservation by using the <b>TIME_FLOAT</b> flag and a
<b>StartTime</b> that is relative to the current time (use the keyword <b>now</b>).
The <b>Duration</b> should be larger than typical job run times and the
configured <a href="slurm.conf.html#OPT_bf_window">backfill window</a>.
Otherwise, the backfill scheduler may plan jobs on the reserved resources after
the reservation's currently expected end time, even though that end time will
keep moving later. This may block pending jobs from getting a realistic
start time on other nodes in the cluster. This does not apply if a specific
<b>EndTime</b> is given, since in that case only the start time will float
through time until the end time is reached. Then, once the current time reaches
the end time, the reservation will be purged.</p>
<p>In the example below, node <i>n8</i> is prevented from starting any jobs
exceeding a 60 minute time limit. The duration of this reservation is 7 days.</p>
<pre>
$ scontrol create reservation \
starttime=now+60minutes duration=7-0 \
user=admin flags=time_float nodes=n8
</pre>
<p><b>NOTE</b>: When <b>TIME_FLOAT</b> is set, the <b>StartTime</b> offset
represents the maximum run time for jobs on the reserved nodes. This means that
the normal DST-aware calculation used when the offset is in days or weeks can
lead to the limit being increased or decreased by 1 hour. You can avoid this by
using units of hours, minutes, or seconds in the offset.</p>
<h3 id="any_nodes">ANY_NODES / LICENSE_ONLY
<a class="slurm_link" href="#any_nodes"></a>
</h3>
<p>By default, jobs using a reservation are limited to specific nodes associated
with the reservation. If a reservation includes the <b>ANY_NODES</b> flag (or
its <b>LICENSE_ONLY</b> alias), then the reservation will only restrict access
to specific licenses or burst buffers, and not restrict the usage of compute
nodes. If the reservation also has the <a href="#overlap">OVERLAP</a> flag,
jobs will be allowed to use any non-license resources except for those in
<a href="#maint">maintenance</a> reservations.</p>
<p>This type of reservation may be particularly useful if licenses are used to
represent some system resource, such as a global file system. In the example
below, we create a reservation for 1000 licenses with the name of <i>lustre</i>.
This may be useful for maintenance on that resource, especially when all such
licenses are reserved.</p>
<pre>
$ scontrol create reservationname=lustre_maint \
starttime=2026-09-18T16:00:00 duration=120 \
user=root flags=license_only licenses=lustre:1000
Reservation created: lustre_maint
$ scontrol show reservation
ReservationName=lustre_maint StartTime=2026-09-18T16:00:00 EndTime=2026-09-18T18:00:00 Duration=02:00:00
Nodes=(null) NodeCnt=0 CoreCnt=0 Features=(null) PartitionName=(null) Flags=ANY_NODES
TRES=(null)
AllowedPartitions=(null) QOS=(null)
Users=root Groups=(null) Accounts=(null) Licenses=lustre:1000 State=INACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
</pre>
<p>The following example reserves 100GB of burst buffer space
starting at noon today and with a duration of 60 minutes.
The reservation will be available only to users <i>alan</i> and <i>brenda</i>.</p>
<pre>
$ scontrol create reservationname=burst_buffer_ab \
starttime=noon duration=60 \
user=alan,brenda flags=any_nodes burstbuffer=100GB
Reservation created: burst_buffer_ab
$ scontrol show res
ReservationName=burst_buffer_ab StartTime=2026-09-12T12:00:00 EndTime=2026-09-12T13:00:00 Duration=01:00:00
Nodes=(null) NodeCnt=0 CoreCnt=0 Features=(null) PartitionName=(null) Flags=ANY_NODES
TRES=(null)
AllowedPartitions=(null) QOS=(null)
Users=alan,brenda Groups=(null) Accounts=(null) Licenses=(null) State=INACTIVE BurstBuffer=100GB
MaxStartDelay=(null)
</pre>
<h3 id="replace">REPLACE
<a class="slurm_link" href="#replace"></a>
</h3>
<p>By default, nodes in a reservation that are DOWN or DRAINED will be replaced,
but not nodes that are allocated to jobs. This behavior may be explicitly
requested with the <b>REPLACE_DOWN</b> flag.</p>
<p>You may instruct Slurm to also replace nodes which are allocated to
jobs with new idle nodes. This is done using the <b>REPLACE</b> flag as shown in
the example below.
This maintains a constant pool of available resources within the reservation.
This option is not supported for reservations specifying cores which
span more than one node, rather than full nodes. For example, a 1 core
reservation on node <i>tux1</i> will be moved if <i>tux1</i> goes down, but a
reservation containing 2 cores on <i>tux1</i> and 3 cores on <i>tux2</i> will
not be moved if <i>tux1</i> goes down.</p>
<pre>
$ scontrol create reservationname=replace_example \
starttime=now duration=60 \
users=stephen flags=replace nodecnt=2
Reservation created: replace_example
$ scontrol show res
ReservationName=replace_example StartTime=2026-09-11T13:57:55 EndTime=2026-09-11T14:57:55 Duration=01:00:00
Nodes=n[1-2] NodeCnt=2 CoreCnt=32 Features=(null) PartitionName=active Flags=REPLACE
TRES=cpu=64
AllowedPartitions=(null) QOS=(null)
Users=stephen Groups=(null) Accounts=(null) Licenses=(null) State=ACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
$ sbatch -N1 --exclusive --reservation=replace_example --wrap="sleep 290"
Submitted batch job 7
$ scontrol show res
ReservationName=replace_example StartTime=2026-09-11T13:57:55 EndTime=2026-09-11T14:57:55 Duration=01:00:00
Nodes=n[2-3] NodeCnt=2 CoreCnt=32 Features=(null) PartitionName=active Flags=REPLACE
TRES=cpu=64
AllowedPartitions=(null) QOS=(null)
Users=stephen Groups=(null) Accounts=(null) Licenses=(null) State=ACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
$ sbatch -N1 --exclusive --reservation=replace_example --wrap="sleep 290"
Submitted batch job 8
$ scontrol show res
ReservationName=replace_example StartTime=2026-09-11T13:57:55 EndTime=2026-09-11T14:57:55 Duration=01:00:00
Nodes=n[3-4] NodeCnt=2 CoreCnt=32 Features=(null) PartitionName=active Flags=REPLACE
TRES=cpu=64
AllowedPartitions=(null) QOS=(null)
Users=stephen Groups=(null) Accounts=(null) Licenses=(null) State=ACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
$ squeue
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
8 active wrap stephen R 0:09 1 n2
7 active wrap stephen R 0:24 1 n1
</pre>
<h3 id="flex">FLEX<a class="slurm_link" href="#flex"></a></h3>
<p>By default, jobs that run in reservations must fit within the time and
size constraints of the reserved resources. With the <b>FLEX</b> flag, jobs
are able to start before the reservation begins or continue after it ends.
They are also able to use the reserved resources along with additional resources
if required and available (excluding resources held by other reservations that
overlap the job's run time).</p>
<p>The following example shows that the <b>FLEX</b> flag allows the job to run
before the reservation starts, after it ends, and on a node outside
of the reservation.</p>
<pre>
$ scontrol create reservationname=flex_example \
starttime=now+10minutes duration=10 \
users=stephen flags=flex nodes=n1
Reservation created: flex_example
$ sbatch -N 2 -t 30 --reservation=flex_example --wrap="sleep 290"
Submitted batch job 11
$ squeue
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
11 active wrap stephen R 0:01 2 n[1,6]
</pre>
<h3 id="magnetic">MAGNETIC
<a class="slurm_link" href="#magnetic"></a>
</h3>
<p>The default behavior for reservations is that jobs must request a
reservation in order to run in it. The <b>MAGNETIC</b> flag allows you to
create a reservation that will allow jobs to run in it without requiring that
they specify the name of the reservation. The reservation will only "attract"
jobs that meet the access control requirements.</p>
<p><b>NOTE</b>: Magnetic reservations cannot "attract" heterogeneous jobs -
heterogeneous jobs will only run in magnetic reservations if they explicitly
request the reservation.</p>
<p>The following example shows a reservation created on <i>n5</i>. The user
specified as being able to access the reservation then submits a job and
the job starts on the reserved node.</p>
<pre>
$ scontrol create reservationname=magnetic_example \
starttime=now duration=10 \
user=stephen flags=magnetic nodes=n5
Reservation created: magnetic_example
$ scontrol show res
ReservationName=magnetic_example StartTime=2026-09-11T14:12:55 EndTime=2026-09-11T14:22:55 Duration=00:10:00
Nodes=n5 NodeCnt=1 CoreCnt=16 Features=(null) PartitionName=(null) Flags=SPEC_NODES,MAGNETIC
TRES=cpu=32
AllowedPartitions=(null) QOS=(null)
Users=stephen Groups=(null) Accounts=(null) Licenses=(null) State=ACTIVE BurstBuffer=(null)
MaxStartDelay=(null)
$ sbatch -N 1 -t 5 --wrap="sleep 290"
Submitted batch job 12
$ squeue
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
12 active wrap stephen R 0:02 1 n5
</pre>
<h3 id="purge">PURGE_COMP
<a class="slurm_link" href="#purge"></a>
</h3>
<p>A reservation may be automatically purged after the last associated job
completes. This is accomplished by using the <b>PURGE_COMP</b> flag.
This flag accepts a timespec (default 5 minutes) indicating how long the
reservation may be idle before it is purged (see
<a href="scontrol.html#OPT_PURGE_COMP">scontrol man page</a> for details).
Once the reservation has started, it must be populated within the allowed idle
time or it will be purged before any jobs have been run.</p>
<h2 id="account">Reservation Accounting
<a class="slurm_link" href="#account"></a>
</h2>
<p>Jobs executed within a reservation are accounted for using the appropriate
user and account. If resources within a reservation are not used, those
resources will be accounted for as being used by all users or accounts
associated with the reservation on an equal basis. For example, if two users are
eligible to use a reservation and neither does, each user will be reported
to have used half of the reserved resources.</p>
<h2 id="pro_epi">Prolog and Epilog
<a class="slurm_link" href="#pro_epi"></a>
</h2>
<p>Slurm supports both a reservation prolog and epilog.
They may be configured using the <b>ResvProlog</b> and <b>ResvEpilog</b>
configuration parameters in slurm.conf. These scripts can be used to cancel
jobs, modify partition configuration, etc.</p>
<h2 id="limitations">Limitations<a class="slurm_link" href="#limitations"></a></h2>
<p>When <a href="gang_scheduling.html">gang scheduling</a> is enabled and a
reservation is set to start in the future, planning of jobs before that
reservation assumes the maximum allowed number of jobs sharing resources.
This will prevent the initiation of some jobs which would complete execution
before a reservation if fewer jobs attempt to share resources.</p>
<!--#include virtual="footer.txt"-->