brsvadd

Adds an advance reservation.

Synopsis

brsvadd [-o] [-f] [-d "description"] [-N reservation_name] [-nosusp] [-q "queue_name ..."] [-E pre_ar_script] [-Et pre_ar_time] [-Ep post_ar_script [-Ept post_ar_time]]
{-u "user_name ..." | -u "user_group ..."}
{[-unit slot] -n job_slots | -unit host -n number_hosts}
{-m "host_name" | "host_group ..." [-R "res_req"] |
[-m "host_name … | " host_group ..."] -R "res_req"}
{-b begin_time -e end_time | -t time_window}
brsvadd [-f] [-d "description"] [-N reservation_name] [-q "queue_name ..."] [-E pre_ar_script] [-Et pre_ar_time] [-Ep post_ar_script [-Ept post_ar_time]]
-s | {-m "host_name ... | host_group ..." [-R "res_req"] |
[-m "host_name ..." | -m "host_group ..."] -R "res_req"}
{-b begin_time -e end_time | -t time_window}
brsvadd [-o] [-f] -p [-d "description"] [-N reservation_name]
{-u "user_name ..." | -u "user_group ..."}
[-unit slot | -unit host]
brsvadd {-h | -V}

Description

CAUTION:

By default, this command can be used only by LSF administrators or root.

Reserves job slots or hosts in advance for a specified period for a user or user group, or for system maintenance purposes. Use the -b and -e options for one-time reservations, and the -t option for recurring reservations.

To allow users to create their own advance reservations without administrator intervention, configure advance reservation policies in the ResourceReservation section of the lsb.resources file.

Only administrators, root, or the users who are listed in the ResourceReservation section can add reservations for themselves or any other user or user group.

Advance reservations must be 10 minutes or more in length.

Note:

Advance reservations might 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 lasts 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 that starts at 4:25 is rejected because it is within the already reserved 4:20-4:30 time period.

Options

-nosusp
If specified, LSF will not suspend non-advance reservation jobs that are running on the advance reservation hosts when the first advance reservation job starts. Non-advance reservation jobs continue to run, and advance reservation jobs do not start until resources are available. This ensures that resources are not over-committed.

This flag is only valid with user advance reservations.

-o
Creates an open advance reservation. A job with an open advance reservation has the advance reservation property only during the reservation window. After the reservation window closes, the job becomes a normal job, not subject to termination.

An open reservation prevents jobs from being killed if the reservation window is too small. Instead, the job is suspended and normal scheduling policies apply after the reservation window.

-p
Manually creates an advance reservation placeholder without a time window or hosts for use by a dynamically scheduled advance reservation. You must use the –u to define a user name or user group that uses the reservation. The brsvsub command automatically creates a placeholder and submits a job to the reservation.
-s
Creates a reservation for system use. LSF does not dispatch jobs to the specified hosts while the reservation is active.

When you specify a system reservation with the -s option, you do not need to specify the number of job slots to reserve with the -n option.

-b begin_time
Begin time for a one-time reservation. The begin time has the following form:
[[[year:]month:]day:]hour:minute
The begin time has 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.

The time value for the -b option must use the same syntax as the time value for the -e option. It must be earlier than the time value for the -e option, and it cannot be earlier than the current time.

-d "description"
Specifies a description for the reservation to be created. The description must be provided as a double quoted text string. The maximum length is 512 characters.
-E pre_ar_script
Specifies the absolute file path to a script that is run to create the advance reservation. If the creator is not root or an LSF administrator, the creator's user group must be an an LSF or queue administrator so that this pre-script can take action on other users' jobs. LSB_START_EBROKERD=Y must be specified in the lsf.conf file for LSF to run the script.
Note: The file path can contain up to 4094 characters for UNIX and Linux, or up to 255 characters for Windows, including the directory and file name.
The following environment variables are available for use in the script:
AR_NAME
Name of the advance reservation.
AR_QUEUE_LIST
List of queues whose jobs can be run in this advance reservation.
AR_HOST_LIST
List of hosts in this advance reservation. The host is reported even if the advance reservation does not use all slots on the host.
AR_START_TIME
Start time of this advance reservation in epoch seconds.
AR_END_TIME
End time of this advance reservation in epoch seconds.
AR_JOBIDS
The job IDs of jobs that are currently running on this advance reservation's hosts.
AR_CREATOR
Name of the user that created this advance reservation.
AR_OWNERS
Name of the owners of this advance reservation.

The script is run at the start time of the advance reservation unless a pre-time is set with the -Et option, then the script is run at the start time minus the specified pre-time. If the script is modified before the script is to be run, the latest version of the script is run at the start time of the script.

The script can use the bpost command to notify the job owner that the job was killed by the script. The script can also create its own logs and send notifications to the creator and owner of the advance reservation. LSF does not take any specific action based on the success or failure of the script, and there is no timeout period or action that is associated with this script.

If the conditions of the advance reservation or the job change while the script is running (for example, with the brsvmod or bmod command), the scripts are not notified and the environment variables do not change. It is the responsibility of the script to handle these changes. In addition, after the script is run, any kill or requeue actions on the jobs cannot be undone if the advance reservation or the job itself is changed with the brsvmod or bmod command.

-Ep post_ar_script
Specifies the absolute file path to a script that is run as the creator of the advance reservation when it expires. If the creator is not root or an LSF administrator, the creator's user group should be an an LSF or queue administrator so that this post-script can take action on other users' jobs. LSB_START_EBROKERD=Y must be specified in the lsf.conf file for LSF to run the script.
Note: The file path can contain up to 4094 characters for UNIX and Linux, or up to 255 characters for Windows, including the directory and file name.
The following environment variables are available for use in the script:
AR_NAME
Name of the advance reservation.
AR_QUEUE_LIST
List of queues whose jobs can be run in this advance reservation.
AR_HOST_LIST
List of hosts in this advance reservation. The host is reported even if the advance reservation does not use all slots on the host.
AR_START_TIME
Start time of this advance reservation as a UTC time stamp.
AR_END_TIME
End time of this advance reservation as a UTC time stamp.
AR_JOBIDS
The job IDs of jobs that are currently running on this advance reservation's hosts.
AR_CREATOR
Name of the user that created this advance reservation.
AR_OWNERS
Name of the owners of this advance reservation.

The script is run at the expiry time of the advance reservation unless a pre-time is set with the -Ept option, then the script is run at the expiry time minus the specified pre-time. If the script is modified before the script is to be run, the latest version of the script is run at the start time of the script.

The script can use the bpost command to notify the job owner that the job was killed by the script. The script can also create its own logs and send notifications to the creator and owner of the advance reservation. LSF does not take any specific action based on the success or failure of the script, and there is no timeout period or action that is associated with this script.

If the conditions of the advance reservation or the job change while the script is running (for example, with the brsvmod or bmod command), the scripts are not notified and the environment variables do not change. It is the responsibility of the script to handle these changes. In addition, after the script is run, any kill or requeue actions on the jobs cannot be undone if the advance reservation or the job itself is changed with the brsvmod or bmod command.

-Ept post_ar_time
The amount of time, in minutes, before the expiry of the advance reservation for LSF to run the post-script (as specified by the -Ep option). This option is ignored if it is specified without the -Ep option.
-Et pre_ar_time
The amount of time, in minutes, before the start of the advance reservation for LSF to run the pre-script (as specified by the -E option) and to stop dispatching new jobs to the advance reservation hosts.

If this option is specified without the -E option, LSF stops dispatching jobs to this advance reservation's hosts at pre-time without running a pre-script.

-e end_time
End time for a one-time reservation. The end time has the following form:
[[[year:]month:]day:]hour:minute
The end time has 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.

The time value for the -e option must use the same syntax as the time value for the -b option. It must be later than the time value for the -b option.

-f
Selects hosts based on the specified resource requirements (-R/-m option).
Note: If AR_AVAILABLE_STATUS in lsb.params is defined, then hosts with that status are preferred in the AR creation.
-m "host_name ... | host_group ..."
Lists the hosts and groups of hosts that are used for the advance reservation request. At job submission, LSF considers the hosts in the specified order.

If you also specify a resource requirement string with the -R option, the -m option is not required.

The hosts can be local to the cluster or hosts that are leased from remote clusters.

The number of slots that are specified by the -n <job_slots> option or hosts that are specified by -n <number_hosts> option must be less than or equal to the actual number of hosts that are specified by the -m option.

Note: When you use the -m option to specify multiple hosts for advance reservation, some hosts might not be selected for advance reservation (for example, because the hosts are exclusive and in closed status). If at least one host in the list was successfully selected for advance reservation, the brsrvadd command indicates that the advance reservation was successfully created.
-N reservation_name
Specifies a user-defined advance reservation name unique in an LSF cluster. The name is a string of letters, numeric characters, underscores, and dashes. The name must begin with a letter. The maximum length of the name is 40 characters.
If no user-defined advance reservation name is specified, LSF creates the reservation with a system assigned name in the following form:
user_name#sequence
In the following example, the brsvadd command has no -N option, so the reservation is created with the system assigned name Reservation user2#0:
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

In the following example, the brsvadd command specifies the name Production_AR on the -N option, so the reservation is created with the specified name:
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 references a reservation with the specified name, an error message is returned: The specified reservation name is referenced by a job.

-n job_slots or number_hosts
The number of either job slots or hosts (specified by the -unit option) to reserve. For a slot-based advance reservation (brsvadd -unit slot), the -n option specifies the total number of job slots to reserve. For host-based advance reservation (brsvadd -unit host), the -n option specifies the total number of hosts to reserve.

The job_slots or number_hosts value must be less than or equal to the actual number of slots or hosts that are selected by the -m or -R option.

If you also specify the reservation for system use with the -s option, the -n is not required.

-q "queue_name ..."
Specifies the queues whose jobs are allowed to run on the advance reservation hosts even if the jobs' run limits are greater than the amount of time until the advance reservation starts.
-R "res_req"
Selects hosts for the reservation according to the specified resource requirements. Only hosts that satisfy the resource requirement expression are reserved. The -R option accepts any valid resource requirement string, but only the select and same strings take effect.

If you also specify a host list with the -m option, the -R is not required.

For more information about resource requirement strings, see Specifying resource requirements.

-t time_window
Time window for a recurring reservation.
To specify a time window, specify two time values that are separated by a hyphen (-), with no space in between:
time_window = begin_time-end_time
Times are specified in the following format:
[day:]hour[:minute]
All fields are numbers with the following ranges:
day of the week
0-6 (0 is Sunday).
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

The default value for minute is 0 (on the hour). The default value for day is every day of the week.

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.

To prevent running jobs from being killed when the reservation expires, LSF administrators can use the bmod -t option to change the termination time of the job before the reservation window closes.

When the job starts running, the run limit of the reservation is set to the minimum of the job run limit (if specified), the queue run limit (if specified), or the duration of the time window.

-u "user_name ..." | "user_group ..."
A list of users and user groups that have permission to use advance reservation.

The -u "user_name ... | user_group ..." option does not support the @cluster notation for advance reservations on remote clusters.

-unit [slot | host]
Specifies whether an advance reservation is for a number of slots or hosts. If the -unit option is not specified, the advance reservation request uses the slot unit by default.
The following options are required when used with the brsvadd command, regardless of whether you use the slot or host unit:
  • The number of slots or hosts to reserve, with the -n option.
  • The list of candidate hosts, with the -m option, the -R option, or both.
  • Users or user groups that have permission to use the advance reservation, with the -u option.
  • A time period for the reservation, with either the -t or the -b option and the -e option together.
-h
Prints command usage and exits.
-V
Prints LSF release version and exits.

Examples

The following command creates a one-time advance reservation for 14 job slots on hosts hostA and hostB for user1 and group1 between 6:00 AM and 8:00 AM today:
brsvadd -unit slot -n 14 -m "hostA hostB" -u "user1 group1" -b 6:0 -e 8:0
Reservation "user1#0" is created
The following command creates an advance reservation for four hosts and the reserved hosts have at least 16 slots:
brsvadd -unit host -n 4 -R "maxslots>=16"" -u "groupA groupB groupC" -b 3:0 -e 4:0
Reservation "groupA#0" is created
The following command creates an open advance reservation for 1024 job slots on host hostA for user user1 between 6:00 AM and 8:00 AM today.
brsvadd -o -n 1024 -m hostA -u user1 -b 6:0 -e 8:0
Reservation "user1#0" is created

See also

brsvdel, brsvmod, brsvs, lsb.resources