Package haizea :: Package core :: Package scheduler :: Module slottable :: Class ResourceReservation
[hide private]
[frames] | no frames]

Class ResourceReservation

source code


A resource reservation

A resource reservation (or RR) is a data structure representing resources (represented as a ResourceTuple) reserved across multiple physical nodes. (each node can have a different resource tuple; e.g., 1 CPU and 512 MB of memory in node 1 and 2 CPUs and 1024 MB of memory in node 2). An RR has a specific start and end time for all the nodes. Thus, if some nodes are reserved for an interval of time, and other nodes are reserved for a different interval (even if these reservations are for the same lease), two separate RRs would have to be added to the slot table.

This class isn't used by itself but rather serves as the base class for VM reservations, image transfer reservations, etc.

Instance Methods [hide private]
 
__init__(self, lease, start, end, res)
Constructor
source code
 
print_contents(self, loglevel=5)
Prints the contents of the RR to the log
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  STATE_SCHEDULED = 0
  STATE_ACTIVE = 1
  STATE_DONE = 2
  state_str = {0: 'Scheduled', 1: 'Active', 2: 'Done'}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, lease, start, end, res)
(Constructor)

source code 

Constructor

Parameters:
  • lease (Lease) - Lease this resource reservation belongs to
  • start (DateTime) - Starting time of the reservation
  • end (DateTime) - Ending time of the reservation
  • res (dict) - A dictionary mapping physical node ids to ResourceTuple objects
Overrides: object.__init__

print_contents(self, loglevel=5)

source code 

Prints the contents of the RR to the log

Parameters:
  • loglevel (str) - Log level