Commit 261c2a1a authored by Leigh B Stoller's avatar Leigh B Stoller

Lets make it easier to manage pre reservations (Mike, this was Rob's


New script and table to manage node pre reservations. Lets just look
at the script.

To create a reservation:

    myboss> wap prereserve -t pc850 testbed 2
    Node reservation request for 2 nodes has been created.

To see the reservation status for testbed

    myboss> wap prereserve -i testbed
    Project         Cnt (Cur)  Creator    When               Pri Types
    testbed         1 (1)      stoller    2011-08-12 12:39:07 0   pc850

    which says 1 node is pending and 1 node has already been

To clear the above reservation request (and optionally, clean
reserved_pid from the nodes table).

    myboss> wap prereserve -c -r testbed

    The -r is optional, otherwise just the reservation request is
    cleared, and nodes continue to be pre-reserved to the project.

To see a list of all reservation requests:

    myboss> wap prereserve -l

So, when a node is released in nfree, we look at the reservation
status for the node and any pending reservation requests.

1. If the node has a reserved_pid and that request is still pending
   (still in the table), nothing is changed.

2. If the node has a reserved_pid, but the request has been cleared
   from the pending table, then clear reserved_pid.

3. If reserved_pid is null, and there are pending requests, then pick
   the highest priority, most recent dated, request, and set
   reserved_pid to that project.


* -n <pri> - is how you set a priority. Lowest is zero, choose a
  higher number if you want this reservation request to be considered
  before others. In a tie, look at the date of creation, and use the

* -t <typelist> - a comma separated list of types you want to
  consider. Types are considered in order, but not in the fancy way
  you might imagine.
parent 02f94859
......@@ -313,7 +313,7 @@ foreach my $type (@types) {
DBQueryFatal("unlock tables");
if ($current >= $count) {
print "Got as many nodes as you wanted the free pool. Yippie!\n";
print "Got as many nodes as you wanted from the free pool. Yippie!\n";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment