Would it make sense to break this into two functions?
Have this function XMLRPCblockAllocation with only two parameters
blockrequestid and blockTimeid.
The second function would be to create the Block Allocation -
--On February 4, 2009 4:39:30 PM -0500 Josh Thompson
-----BEGIN PGP SIGNED MESSAGE-----
I'm going to start work on VCL-78 which is an addition to the frontend
XML RPC API to allow the backend to call the frontend for allocating
computers for block reservations. Currently, the block reservations are
created in the frontend, but computers are not allocated to fulfill them
because the requested time(s) could be at any point in the future. So,
around 6 hours before a requested time, the backend picks up that block
reservation time slot, allocates computers for it, and then inserts
reload reservations early enough for the computers to be preloaded by
the start of the time slot.
This results in a fair amount of duplicated code, since the frontend
currently handles computer allocation in all other cases.
This is how I am planning on implementing it. Please reply with any
comments on doing it differently or tweaking it somehow. I'm open to
The backend could just call the frontend with the blockTimes id to
process, but I'll make it more generic to be more useful in other cases
and require that the backend specify several items.
function name: XMLRPCblockAllocation
imageid - id of the image to be used
start - unix timestamp for the start time (i.e. machines should be
prep'd and ready by this time)
end - unix timestamp for the end time
machinecount - number of computers to allocate
usergroupid - id of user group for checking user access to machines
ignoreprivileges - 0 (false) or 1 (true) - set to 1 to select computers
from any that are mapped to be able to run the image; set to 0 to only
select computers from ones that are both mapped and that users in
usergroupid have been granted access to through the privilege tree. If
this is set to 1, usergroupid is ignored (more on this below).
blockTimeid - id from blockTimes table that this will fulfill or 0 if
there is not an existing block reservation related to this call
returns: the number of machines that were successfully allocated, with 0
indicating a complete failure of not being able to allocate any computers
Description of how it will work:
The frontend will use the normal scheduling functions to allocate
computers and insert them into the blockComputers table. If blockTimeid
is 0, new entries will be created in the blockRequest and blockTimes
tables. It will create reload reservations for the computers early
enough for them to be loaded by the start time based on historical
The ignoreprivileges flag exists to allow more machines to be available
for fulfilling block reservations than just those that the user group
has access to. The current implementation with the backend doing the
processing functions as if ignoreprivileges were set to 1.
That's pretty much it.
Virtual Computing Lab (VCL)
North Carolina State University
my GPG/PGP key can be found at pgp.mit.edu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
-----END PGP SIGNATURE-----
OIT Advanced Computing
College of Engineering-NCSU