Changing an advance reservation

Use the brsvmod command to change an existing advance reservation.

Specify the reservation ID for the reservation you want to modify. For example, run the following command to extend the duration from 6:00 AM. to 9:00 AM.
brsvmod -e "+60" user1#0
Reservation "user1#0" is modified 
Note: Administrators and root can modify any reservations. Users listed in the ResourceReservation section of the lsb.resources file, can modify only reservations they created themselves.
Take the following actions on a reservation:
  • Modify start time (postpone or move closer)
  • Modify the duration of the reservation window (and thus the end time)
  • Modify the slot numbers required by the reservation (add or remove slots with hosts)
  • Modify the host or host group list (add or remove hosts or host groups)
  • Replace the user or user group list or add or remove users or user groups
  • Add hosts by resource requirement (-R)
  • Modify the reservation type (open or closed)
  • Disable the specified occurrences of a recurring reservation
  • Modify the queue whose jobs are allowed to run on the advance reservation hosts before the advance reservation becomes active
  • Modify whether LSF suspends non-advance reservation jobs that are running when the advance reservation becomes active
  • Modify pre-scripts, post-scripts, and script start times.
For example, assume an advance reservation is the box between the time t1 and t2, as shown in the following figure:
[Modifying an advance reservation
  • The shadowed box shows the original reservation
  • Time means the time window of the reservation
  • t1 is the begin time of the reservation
  • t2 is the end time of the reservation
  • The reservation size means the resources that are reserved, such as hosts (slots) or host groups

Use the brsvmod command to shift, extend, or reduce the time window horizontally, and to grow or shrink the size vertically.

Extend the duration

The following command creates a one-time advance reservation for 1024 job slots on host hostA for user user1 between 6:00 AM and 8:00 AM today:
brsvadd -n 1024 -m hostA -u user1 -b "6:0" -e "8:0"
Reservation "user1#0" is created 
Run the following command to extend the duration from 6:00 AM to 9:00 AM:
brsvmod -e "+60" user1#0
Reservation "user1#0" is modified 

Add hosts to a reservation allocation

Use the brsvmod command to add hosts and slots on hosts into the original advance reservation allocation. The hosts can be local to the cluster or hosts leased from remote clusters.

Slots cannot be added (-n option) to a system reservation. Only hosts can be added (-m option) to a system reservation.

Adding a host without the -n option reserves all available hosts or slots on the host that are not already reserved by other reservations. You can specify the number of slots to be added from the host list specified with the -n option, but the -n option cannot be used alone. The -m option can be used alone if no host group is specified in the list. You must specify the -R option together with 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.

The following examples reserve slots from a reservation with the brsvmod addhost command:
  • Reserve 2 more slots from hostA:
    brsvmod addhost -n2 -m "hostA"
  • Reserve 4 slots in total from hostA and hostB:
    brsvmod addhost -n4 -m "hostA hostB"
  • Reserve 4 more slots from any Linux hosts:
    brsvmod addhost -n4 -R"type==linux"
  • Reserve 4 more slots from any Linux hosts in the host group :hostgroup1
    brsvmod addhost -n4 -m "hostgroup1" -R "type==linux"
  • Dynamically add any Linux hosts in the hostgroup1 host group:
    brsvmod addhost -f -m "hostgroup1" -R "type==linux"
  • Reserve all available slots from hostA and hostB:
    brsvmod addhost -m "hostA hostB"
The following command creates an advance reservation for 1024 slots on two hosts hostA and hostB for user group groupA every Wednesday from 12:00 midnight to 3:00 AM:
brsvadd -n 1024 -m "hostA hostB" -g groupA -t "3:0:0-3:3:0"
Reservation "groupA#0" is created
brsvs
RSVID      TYPE    USER     NCPUS      RSV_HOSTS       TIME_WINDOW
groupA#0   user    groupA   0/1024     hostA:0/256     3:3:0-3:3:0 *
                                       hostB:0/768
The following commands reserve 256 slots from each host for the reservation:
brsvmod addhost -n 256 -m "hostA" groupA#0
Reservation "groupA#0" is modified 
brsvmod rmhost -n 256 -m "hostB" groupA#0
Reservation "groupA#0" is modified

Remove hosts from a reservation allocation

Use the brsvmod rmhost command to remove 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 slots to be released from the host. Removing a host without the -n option releases all reserved slots on the host. The slot specification must be less than or equal to the actual reserved slot number of the host.

The following examples remove slots from reservations with the brsvmod rmhost command:
  • Remove 4 reserved slots from hostA
    brsvmod rmhost -n 4 -m "hostA"
  • Remove 4 slots in total from hostA and hostB.
    brsvmod rmhost -n 4 -m "hostA hostB" 
  • Release reserved hostA and hostB
    brsvmod rmhost -m "hostA hostB" 
  • Remove 4 slots from current reservation allocation.
    brsvmod rmhost -n 4 
You cannot remove slots from a system reservation. The following modification to the system reservation System#1 is rejected:
brsvmod rmhost -n 2 -m "hostA"  system#1
The number of slots or hosts that can be removed also depends on the number of slots that are free while the reservation is active. The brsvmod rmhost command cannot remove more slots than are free on a host. For example:
brsvs
RSVID    TYPE USER    NCPUS         RSV_HOSTS    TIME_WINDOW
user1_1  user  user1  3/4           hostA:2/2    1/24/12/2-1/24/13/0
                                    hostB:1/2
The following modifications are accepted because hostB has free slots:
brsvmod rmhost -m hostB user1_1
brsvmod rmhost -n 1 -m hostB user1_1
The following modifications are rejected because no free slots are available to be removed from hostA:
brsvmod rmhost -n 2 user1_1 # <<-- only 1 slot is free
brsvmod rmhost -m hostA user1_1        # <<-- hostA has no free slots
brsvmod rmhost -n 1 -m hostA user1_1   # <<-- hostA has no free slots
brsvmod rmhost -n 2 -m hostB user1_1   # <<-- hostB only has 1 free slot

Modify closed reservations

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 
Run the following command to close the reservation when it expires.
brsvmod -on user1#0
Reservation "user1#0" is modified 

Modify a reservation placeholder

To add a time window to a reservation placeholder, use the brsvmod -b begin_time -e end_time reservation_ID command.
brsvmod -b 23:30 -e 23:40 user1#0
Reservation user1#0 is modified
  • 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.
To add resources to a placeholder, use the brsvmod addhost command.
brsvmod addhost -m lsfrhel04 -n 2 user1#0
Reservation user1#0 is modified

Disable specified occurrences for recurring reservations

Use the brsvmod disable command to disable specified periods, or instances, of a recurring advance reservation.

Recurring reservations may repeat either on a daily cycle or a weekly cycle. For daily reservations, the instances of the reservation that occur on disabled days will be inactive. Jobs using the reservation are not dispatched on those disabled days. Other reservations are permitted to use slots of the reservation on those days. For overnight reservations (active from 11:00 PM to 9:00 AM daily), if the reservation is disabled on the starting day of an instance, the reservation is disabled for the whole of that instance.

For a weekly reservation, if the reservation is disabled on the start date of an instance of the reservation then the reservation is disabled for the entire instance. For example, for a weekly reservation with time window from 9 AM Wednesday to 10 PM Friday, in one particular week, the reservation is disabled on Thursday, then the instance of the reservation remains active for that week. However, if the same reservation is disabled for the Wednesday of the week, then the reservation is disabled for the week.

The following figure illustrates how the disable options apply to the weekly occurrences of a recurring advance reservation.
[How the disable options apply to the weekly occurrences of a recurring advance reservation]

Once a reservation is disabled for a period, it cannot be enabled again; 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.

For example, the following command creates a recurring advance reservation for 4 slots on host hostA for user user1 between 6:00 AM and 8:00 AM every day.
Reservation "user1#0" is created 
brsvadd -n 4 -m hostA -u user1 -t "6:0-8:0" 
Run the following command to disable the reservation instance that is active between Dec 1 to Dec 10, 2007.
brsvmod -disable -td "2007:12:1-2007:12:10" user1#0
Reservation "user1#0" is modified 
Then the administrator can use host hostA for other reservations during the duration
brsvadd -n 4 -m hostA -u user1 -b "2007:12:1:6:0" -e "2007:12:1:8:0" 
Reservation "user1#2" is created 

Change users and user groups

Use the brsvmod -u, brsvmod adduser, or brsvmod rmuser command to change the users or user groups that are able to submit jobs with the advance reservation.

Jobs that are submitted by the original user or user group to the reservation still belong to the reservation and are scheduled as advance reservation jobs, but new submitted jobs from the removed user or user group cannot use the reservation any longer.

brun command

An advance reservation job dispatched with the brun command is still subject to run windows and suspending conditions of the advance reservation for the job. The job must finish running before the time window of a closed reservation expires. Extending or shrinking a closed advance reservation duration prolongs or shortens lifetime of a brun job.

bslots command

The bslots command displays a snapshot of the slots currently not in use by parallel jobs or advance reservations. If the hosts or duration of an advance reservation is modified, the bslots command recalculates and displays the available slots and available run time accordingly.

How advance reservation modifications interact

The following table summarizes how advance reservation modification applies to various advance reservation instances.
Modification     Disable Begin time End time Add hosts Remove hosts User/usergroup open/closed Pre command Post command
One-time Active   No No Yes Yes Yes Yes Yes Yes Yes
Inactive   No Yes Yes Yes Yes Yes Yes Yes Yes
Recurring Occurrences All No Yes Yes Yes Yes Yes Yes Yes Yes
Specified Yes No No No No No No No No
Active instance   No No No No No No No No No

In this table, Yes means that the modification is supported. No means that the change is not allowed. For example, all modifications are acceptable in the case that the advance reservation is inactive and not disabled.