brsvmod
Modifies an advance reservation.
Synopsis
brsvmod [-o | -on] [-d "description"] [-u "user_name ..." | "user_group ..." ] [-nosusp | -nonsuspn] [-q "queue_name ..." | -qn] [-E pre_ar_script | -En] [-Et pre_ar_time | -Etn] [-Ep post_ar_script | -Epn] [-Ept post_ar_time | -Eptn] [[-b begin_time | [+|-]minutes] [-e end_time | [+|-]minutes]] | [-t time_window] reservation_IDDescription
By default, this command can be used only by LSF administrators or root.
Replaces advance reservation option values previously created, extends or reduces the reservation time window, or adds or removes reserved hosts of the advance reservation that is specified by reservation_ID. For a recurring reservation, can disable specified occurrences of the reservation.
Administrators and root can modify any reservations. Users who are listed in the ResourceReservation section of the lsb.resources file can modify only reservations that they created themselves.
The original value for user, user group, or time window, can be overridden with a new value by specifying the option as in brsvadd. Change a reservation from closed (the default) to open with the -o option, or from open to closed with the -on option. You can also use the subcommands adduser and rmuser to add or remove users and user groups that are assigned to the advance reservation.
Options -n, -m, and -R must be used with the subcommands addhost or rmhost. These options allow adding or removing from the original values.
The -td and -tn options are only allowed in the disable subcommand.
All subcommands are mutually exclusive. The time window options -b, -e, and -t are not valid in any of the subcommands.
You cannot modify the start time of an active reservation.
The brsvmod command does not support the reservation_ID@cluster_name notation for advance reservations on remote clusters, or the user_name@cluster_name notation for reservations with remote users.
-n 3 -m "host1 host2"
If you do not use the brsvsub command to create a dynamically scheduled reservation, you can manually add a time window to a reservation placeholder that was created with the brsvadd -p option. Use the brsvmod -b begin_time -e end_time reservation_ID command.
To add resources to a placeholder, use the brsvmod addhost command.
- By default, a placeholder reservation is a one-time reservation. You can’t change a placeholder to a recurring reservation.
- A placeholder reservation with a time window is cleaned when the reservation expires.
Subcommands
- addhost {-n number_unit -R "res_req" [-m "host_name ... | host_group ..."]} | {[-n number_unit] -m "host_name ... | host_group ..."} [-f] reservation_ID
- Adds hosts and slots on hosts into the original reservation allocation. The hosts can be local
to the cluster or hosts that are leased from remote clusters.
Adding a host without the -n option reserves all available hosts or slots on the host that are not already reserved by other reservations. The -n cannot be used alone. You can specify the number of slots to be added from the host list that is specified with the -n option. The -m option can be used alone if no host group is specified in the list. If you specify the -R option, you must also specify the -n option.
The specified number of units (slots or hosts) must be less than or equal to the available number of slots for the hosts or hosts themselves.
Restriction: Only hosts can be added (with the -m option) to a system reservation. Slots cannot be added (with the -n option) to a system reservation. - adduser -u "user_name ... | user_group ..." reservation_ID
- Adds users and user groups to an advance reservation.
- disable {-td "begin_date-end_date" | -tn} [-f] reservation_ID
- Disables specified periods, or instances, of a recurring advance reservation. The
start_date and end_date represent the start and end date of a
period in which the reservation is disabled. These periods must take one of the following forms:
- yyyy:mm:dd-yyyy:mm:dd
- mm:dd-mm:dd - the current year is assumed
- dd-dd - the current month and year are assumed
The start date must be the same as or earlier than the end date.
If a reservation is disabled for a specified day, then it does not become active on that day, and remains inactive during the reservation time window. Non-recurring reservations are able to use slots of the recurring reservation during the time window. The -tn option is a shortcut that disables a reservation on the starting day of the next instance of the reservation time window; that is, the instance that starts nearest in the future. If the reservation is disabled for this day, the modification request is rejected.
For example, for a weekly reservation with time window from Wednesday 9 AM to Friday 10 PM, if the current day is Monday, then running the command with the -tn option disables the reservation from Wednesday to Friday of the current week. However, if the current day is Thursday, then the reservation is disabled from Wednesday to Friday of the following week. If it is Wednesday, then whether to disable in the current week or following week depends on whether the start time of the instance is passed. If not, then the reservation is disabled in the current week, otherwise the following week's reservation is disabled.
Running the disable command with the -tn option twice on Monday tries to disable twice in the current week. The second run has no effect, but is rejected because the specified reservation instance is already disabled.
After a reservation is disabled for a period, it cannot be enabled; that is, the disabled periods remain fixed. Before a reservation is disabled, you are prompted to confirm whether to continue disabling the reservation. Use the -f option to silently force the command to run without prompting for confirmation; for example, to allow for automating disabling reservations from a script.
- rmhost {-n number_unit [-m "host_name ... | host_group ..."]} | {[-n number_unit]-m "host_name ... | host_group ..."} reservation_ID
- Removes hosts or slots on hosts from the original reservation allocation. You must specify
either the -n or -m option. Use the -n option to
specify the number of hosts to be released or slots to be released from reserved hosts. Removing a
host without the -n option releases all hosts or reserved free slots on the host.
The specified number of units (slots or hosts) must be less than or equal to the available number of
hosts or slots for the hosts.
You can remove only a whole host from a system reservation.
How many slots or hosts can be removed depends on the number of slots that are free while the reservation is active. The rmhost subcommand cannot remove more slots than are free on the host on both one-time and recurring reservations that are active. If you want to remove more slots from the reservation, you must wait until running jobs finish or the reservation is inactive.
- rmuser -u "user_name ... | user_group ..." reservation_ID
- Removes users and user groups from an advance reservation.
Options
- -nosusp | -nosuspn
- If specified, LSF no
longer suspends 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 resource are available. This ensures that resources are not
over-committed. If the -nosuspn option is specified, LSF
suspends non-advance reservation jobs that are running on the advance reservation hosts when the
first advance reservation job starts.
This flag is only valid with user advance reservations if the advance reservation is inactive and not within the pre-time period.
- -o
- Changes a closed advance reservation to open, or cancels an open reservation.
If the reservation is open, all jobs in the reservation become normal jobs, not subject to termination when the reservation window closes. The -on option closes the reservation when it expires. The running jobs of an open reservation are terminated when the reservation is changed into closed. The termination times of running jobs of a closed reservation are removed if the reservation is changed to open. The termination time of running jobs is set by the mbatchd daemon but checked by the sbatchd daemon. Termination time is an absolute time based on management host, so all hosts in the cluster must be synchronized with the local time on the management host. If the sbatchd daemon and the mbatchd daemon are not synchronized, termination might not occur at the correct time.
- -b begin_time | [+ | -]minutes
- Replaces the begin time for a one-time reservation, or gives an offset in minutes to the current
begin time. Restriction: You cannot modify the begin time of an active reservation.The begin time is in 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).
Year, month, and day are optional. You must specify at least hour:minute:- Three fields are assumed to be day:hour:minute
- Four fields are assumed to be month:day:hour:minute
- 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 offset is in minutes, an integer with a prefix + or -. For example, -b+5 moves the begin time 5 minutes later, and -b-5 moves the begin time 5 minutes earlier.
The modified time value for the begin time (-b option) must use the same syntax as the time value for the end time (-e option). The begin time must be earlier than the time value for the end time. The begin time cannot be earlier than the current time.
- -d "description"
- Replaces or sets a description for the reservation. The description must be provided as a double quoted text string. The maximum length is 512 characters.
- -E pre_ar_script | -En
- Replaces the absolute file path to the script that is run to create the advance reservation. The
-En option removes the script so that no scripts are run. 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 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 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 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.
When the AR_END_TIME is changed, the pending jobs should not be dispatched if the specified runlimit exceeds the end time of the AR.
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 | -Epn
- Replaces the absolute file path to the script that is run as the creator of the advance
reservation when it expires. The -En option removes the script so that no scripts
are run. 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.
When the AR_END_TIME is changed, the pending jobs should not be dispatched if the specified runlimit exceeds the end time of the AR.
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 | -Eptn
- Changes 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). The
-Ept option is ignored if the -Ep option is not enabled.
If you specify the -Eptn option, the post-script is run at the expiry time of the advance reservation
- -Et pre_ar_script | -Etn
- Changes 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 the -E option is not enabled, specifying the -Et option means that LSF stops dispatching jobs to this advance reservation's hosts at pre-time without running a pre-script.
If you specify the -Etn option, the pre-script is run at the start time of the advance reservation
- -e end_time | [+ | -]minutes
- Replaces the end time for a one-time reservation, or gives an offset in minutes to the current
end time.
By giving a positive offset to the end time, you extend the duration of a reservation so that the jobs in the reservation can run longer. Shrinking the reservation with a negative value terminates running jobs earlier.
The end time is in 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).
Year, month, and day are optional. You must specify at least hour:minute:- Three fields are assumed to be day:hour:minute
- Four fields are assumed to be month:day:hour:minute
- 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 end time (-e option) must use the same syntax as the time value for the (-b option). The end time must be later than the time value for the begin time.
- -f
- Dynamically 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..."
- Changes the list of hosts for which job slots or number of hosts that are specified with the
-n option are reserved. At job submission, LSF uses
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.
- -n number_unit
- Changes the number of either job slots or hosts to reserve (based on the unit that is specified
by the brsvadd -unit slot | host command. The number_unit
variable must be less than or equal to the actual number of slots for the hosts that are selected by
the -m or -R option for the reservation.
If you also specify the reservation for system, use the -n option with the -s option. The -n option is not required.
- -q "queue_name ..." | -qn
- Changes 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. The -qn option removes the list of allowed queues.
- -R "res_req"
- Changes the host selection 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 option is not required.
For more information about resource requirement strings, see Specifying resource requirements.
- -t time_window
- Replaces the time window with a new one to shift a recurring reservation. You cannot modify the
start time of a recurring reservation that has current active instance.To specify a time window, specify two time values. Separate the time values by a hyphen (-) with no space in between:
time_window = begin_time-end_time
Times are specified in the following format:
where all fields are numbers with the following ranges:[day:]hour[:minute]
- day of the week
- 0-6 (0 is Sunday).
- hour
- 0-23
- minute
- 0-59
Specify a time window:- 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.
LSF administrators can prevent running jobs from being killed when the reservation expires by changing the termination time of the job that uses the reservation with the bmod -t command 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 ..."
- Replaces the list of users or groups who are able to submit jobs to a reservation. Replacing the
list of users or groups does not affect the currently running jobs.
Jobs that are submitted by the original users or groups to the reservation still belong to the reservation and scheduled as advance reservation jobs, but newly submitted jobs from the users or groups that were removed from the reservation cannot use the reservation any longer.
The -u "user_name ... | user_group ..." option does not support the @cluster notation for advance reservations on remote clusters.
- -h
-
Prints command usage and exits.
- -V
-
Prints LSF release version and exits.
Examples
brsvmod addhost -m hostB user1#0
Reservation user1#0 is modified
brsvmod disable {-td "2008:01:01-2008:01:06"}