Add reservations

About this task

Note:

By default, only LSF administrators or root can add or delete advance reservations.

Procedure

Run brsvadd to create new advance reservations.
You must specify the following for the reservation:
  • Number of job slots or hosts to reserve—This number should less than or equal to the actual number of slots or hosts, selected by -m or -R.

  • The unit (slots of hosts) to use for the reservation. By default (without -unit), brsvadd creates a slot- based reservation. You can create a host-based reservation by specifing "-unit host", or a slot- based reservation with "-unit slot"

  • Hosts for the reservation

  • Owners of the reservation

  • Time period for the reservation—either:
    • Begin time and end time for a one-time reservation, OR

    • Time window for a recurring reservation

    Note:

    Advance reservations should be 10 minutes or more in length.

    Advance reservations may be rejected if they overlap other advance reservations that begin or end within a 10-minute time period.

    A day is divided into 144 periods, each period lasting for 10 minutes. For example, 0:0-0:10, 0:10-0:20, up to 23:50-24:00. If the start time or end time of a reservation is in the middle of a time period, LSF reserves the entire period. For example, if one reservation begins at 1:22 and ends at 4:24, a reservation request starting at 4:25 will be rejected because it lies within the already reserved 4:20-4:30 time period.

The brsvadd command returns a reservation ID that you use when you submit a job that uses the reserved hosts. Any single user or user group can have a maximum of 100 reservation IDs.

Specify hosts for the reservation

Procedure

Use one or both of the following brsvadd options to specify hosts for which job slots are reserved:
  • The -m option lists the hosts needed for the reservation. The hosts listed by the -m option can be local to the cluster or hosts leased from remote clusters. At job submission, LSF considers the hosts in the specified order. If you also specify a resource requirement string with the -R option, -m is optional.

  • The -R option selects hosts for the reservation according to a resource requirements string. Only hosts that satisfy the resource requirement expression are reserved. -R accepts any valid resource requirement string, but only the select string takes effect. If you also specify a host list with the -m option, -R is optional.

    If LSF_STRICT_RESREQ=Y in lsf.conf, the selection string must conform to the stricter resource requirement string syntax. The strict resource requirement syntax only applies to the select section. It does not apply to the other resource requirement sections (order, rusage, same, span, or cu).

Add a one-time reservation

Procedure

Use the -b and -e options of brsvadd to specify the begin time and end time of a one-time advance reservation. One-time reservations are useful for dedicating hosts to a specific user or group for critical projects.
The day and time are in the form:
[[[year:]month:]day:]hour:minute
with the following ranges:
  • year: any year after 1900 (YYYY)

  • month: 1-12 (MM)

  • day of the month: 1-31 (dd)

  • hour: 0-23 (hh)

  • minute: 0-59 (mm)

You must specify at least hour:minute. Year, month, and day are optional. Three fields are assumed to be day:hour:minute, four fields are assumed to be month:day:hour:minute, and five fields are year:month:day:hour:minute.

If you do not specify a day, LSF assumes the current day. If you do not specify a month, LSF assumes the current month. If you specify a year, you must specify a month.

You must specify a begin and an end time. The time value for -b must use the same syntax as the time value for -e. The begin time must be earlier than the time value for -e. The begin time cannot be earlier than the current time.

The following command creates a one-time advance reservation for 1024 job slots on host hostA for user user1 between 6:00 a.m. and 8:00 a.m. today:
brsvadd -n 1024 -m hostA -u user1 -b 6:0 -e 8:0Reservation "user1#0" is created

The hosts specified by -m can be local to the cluster or hosts leased from remote clusters.

The following command creates a one-time advance reservation for 1024 job slots on a host of any type for user user1 between 6:00 a.m. and 8:00 a.m. today:
brsvadd -n 1024 -R "type==any" -u user1 -b 6:0 -e 8:0Reservation "user1#1" is created
The following command creates a one-time advance reservation that reserves 12 slots on hostA between 6:00 p.m. on 01 December 2003 and 6:00 a.m. on 31 January 2004:
brsvadd -n 12 -m hostA -u user1 -b 2003:12:01:18:00 -e 2004:01:31:06:00
Reservation user1#2 is created

Add a recurring reservation

Procedure

Use the -t option of brsvadd to specify a recurring advance reservation. The -t option specifies a time window for the reservation. Recurring reservations are useful for scheduling regular system maintenance jobs.
The day and time are in the form:
[day:]hour[:minute]
with the following ranges:
  • day of the week: 0-6

  • hour: 0-23

  • minute: 0-59

Specify a time window one of the following ways:
  • hour-hour

  • hour:minute-hour:minute

  • day:hour:minute-day:hour:minute

You must specify at least the hour. Day of the week and minute are optional. Both the start time and end time values must use the same syntax. If you do not specify a minute, LSF assumes the first minute of the hour (:00). If you do not specify a day, LSF assumes every day of the week. If you do specify the day, you must also specify the minute.

If the current time when the reservation is created is within the time window of the reservation. the reservation becomes active immediately.

When the job starts running, the termination time of the advance reservation job is determined by the minimum of the job run limit (if specified), the queue run limit (if specified), or the duration of the reservation time window.

The following command creates an advance reservation for 1024 job slots on two hosts hostA and hostB for user group groupA every Wednesday from 12:00 midnight to 3:00 a.m.:
brsvadd -n 1024 -m "hostA hostB" -g groupA -t "3:0:0-3:3:0"
Reservation "groupA#0" is created
The following command creates an advance reservation for 1024 job slots on hostA for user user2 every weekday from 12:00 noon to 2:00 p.m.:
brsvadd -n 1024 -m "hostA" -u user2 -t "12:0-14:0"
Reservation "user2#0" is created
The following command creates a system reservation on hostA every Friday from 6:00 p.m. to 8:00 p.m.:
brsvadd -n 1024 -m hostA -s -t "5:18:0-5:20:0"
Reservation "system#0" is created

While the system reservation is active, no other jobs can use the reserved hosts, and LSF does not dispatch jobs to the specified hosts.

The following command creates an advance reservation for 1024 job slots on hosts hostA and hostB with more that 50 MB of swap space for user user2 every weekday from 12:00 noon to 2:00 p.m.:
brsvadd -n 1024 -R "swp > 50" -m "hostA hostB" -u user2 -t "12:0-14:0"
Reservation "user2#1" is created

Add an open reservation

Procedure

Use the -o option of brsvadd to create an open advance reservation. You must specify the same information as for normal advance reservations.
The following command creates a one-time open advance reservation for 1024 job slots on a host of any type for user user1 between 6:00 a.m. and 8:00 a.m. today:
brsvadd -o -n 1024 -R "type==any" -u user1 -b 6:0 -e 8:0
Reservation "user1#1" is created
The following command creates an open advance reservation for 1024 job slots on hostB for user user3 every weekday from 12:00 noon to 2:00 p.m.:
brsvadd -o -n 1024 -m "hostB" -u user3 -t "12:0-14:0"
Reservation "user2#0" is created

Specify a reservation name

Procedure

Use the -N option of brsvadd to specify a user-defined advance reservation name unique in an LSF cluster.

The reservation name is a string of letters, numeric characters, underscores, and dashes beginning with a letter. The maximum length of the name is 39 characters.

If no user-defined advance reservation name is specified, LSF creates the reservation with a system assigned name with the form
creator_name#sequence
For example:
brsvadd -n 3 -M "hostA hostB" -u user2 -b 16:0 -e 17:0 -d "Production AR test"
Reservation user2#0 (Production AR test) is created
brsvadd -n 2 -N Production_AR -M hostA -u user2 -b 16:0 -e 17:0 -d "Production AR test"
Reservation Production_AR (Production AR test) is created

If a job already exists that references a reservation with the specified name, an error message is returned: The specified reservation name is referenced by a job.

Modify an advance reservation

Procedure

Use brsvmod to modify reservations. Specify the reservation ID for the reservation you want to modify. For example, run the following command to extend the duration from 6:00 a.m. to 9:00 a.m.:
brsvmod -e "+60" user1#0
Reservation "user1#0" is modified 

Administrators and root can modify any reservations. Users listed in the ResourceReservation section of lsb.resources, can only modify reservations they created themselves.