Home | Trees | Indices | Help |
---|
|
The Haizea Lease Scheduler
This is the main scheduling class in Haizea. It handles lease scheduling which, in turn, involves VM scheduling, preparation scheduling (such as transferring a VM image), and numerous bookkeeping operations. All these operations are handled by other classes, so this class acts mostly as an orchestrator that coordinates all the different operations involved in scheduling a lease.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
VMScheduler |
vm_scheduler VM Scheduler |
|
|||
Inherited from |
|
Constructor The constructor does little more than create the lease scheduler's attributes. However, it does expect (in the arguments) a fully-constructed VMScheduler, PreparationScheduler, SlotTable, and PolicyManager (these are constructed in the Manager's constructor). Arguments: vm_scheduler -- VM scheduler preparation_scheduler -- Preparation scheduler slottable -- Slottable accounting -- AccountingDataCollection object
|
Requests a leases. This is the entry point of leases into the scheduler. Request a lease. The decision on whether to accept or reject a lease is deferred to the policy manager (through its admission control policy). If the policy determines the lease can be accepted, it is marked as "Pending". This still doesn't guarantee that the lease will be scheduled (e.g., an AR lease could still be rejected if the scheduler determines there are no resources for it; but that is a *scheduling* decision, not a admission control policy decision). The ultimate fate of the lease is determined the next time the scheduling function is called. If the policy determines the lease cannot be accepted, it is marked as rejected. Arguments: lease -- Lease object. Its state must be STATE_NEW. |
The main scheduling function The scheduling function looks at all pending requests and schedules them. Note that most of the actual scheduling code is contained in the __schedule_lease method and in the VMScheduler and PreparationScheduler classes. Arguments: nexttime -- The next time at which the scheduler can allocate resources. |
Processes starting reservations This method checks the slottable to see if there are any reservations that are starting at "nowtime". If so, the appropriate handler is called. Arguments: nowtime -- Time at which to check for starting reservations. |
Processes ending reservations This method checks the slottable to see if there are any reservations that are ending at "nowtime". If so, the appropriate handler is called. Arguments: nowtime -- Time at which to check for starting/ending reservations. |
Gets a lease with the given ID This method is useful for UIs (like the CLI) that operate on the lease ID. If no lease with a given ID is found, None is returned. Arguments: lease_id -- The ID of the lease |
Cancels a lease. Arguments: lease -- Lease to cancel |
Transitions a lease to a failed state, and does any necessary cleaning up Arguments: lease -- Lease to fail exc -- The exception that made the lease fail |
Notifies an event that affects a lease. This is the entry point of asynchronous events into the scheduler. Currently, the only supported event is the premature end of a VM (i.e., before its scheduled end). Other events will emerge when we integrate Haizea with OpenNebula 1.4, since that version will support sending asynchronous events to Haizea. Arguments: lease -- Lease the event refers to event -- Event type |
Reevaluates the schedule. This method can be called whenever resources are freed up unexpectedly (e.g., a lease than ends earlier than expected)) to check if any leases scheduled in the future could be rescheduled to start earlier on the freed up resources. Currently, this method only checks if best-effort leases scheduled in the future (using a backfilling algorithm) can be rescheduled Arguments: nexttime -- The next time at which the scheduler can allocate resources. |
Traverses the queue in search of leases that can be scheduled. This method processes the queue in order, but takes into account that it may be possible to schedule leases in the future (using a backfilling algorithm) Arguments: nexttime -- The next time at which the scheduler can allocate resources. |
Schedules a lease. This method orchestrates the preparation and VM scheduler to schedule a lease. Arguments: lease -- Lease to schedule. nexttime -- The next time at which the scheduler can allocate resources. |
Preempts a lease. This method preempts a lease such that any resources allocated to that lease after a given time are freed up. This may require scheduling the lease to suspend before that time, or cancelling the lease altogether. Arguments: lease -- Lease to schedule. preemption_time -- Time at which lease must be preempted |
Queues a best-effort lease request Arguments: lease -- Lease to be queued |
Queues a lease in order (currently, time of submission) Arguments: lease -- Lease to be queued |
Performs actions that have to be done each time a reservation ends. Arguments: rr -- Reservation that ended |
Performs actions that have to be done each time a lease ends. Arguments: lease -- Lease that has ended |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Dec 17 10:59:21 2009 | http://epydoc.sourceforge.net |