Home | Trees | Indices | Help |
---|
|
A resource lease
This is one of the main data structures used in Haizea. A lease is "a negotiated and renegotiable agreement between a resource provider and a resource consumer, where the former agrees to make a set of resources available to the latter, based on a set of lease terms presented by the resource consumer". All the gory details on what this means can be found on the Haizea website and on the Haizea publications.
See the __init__ method for a description of the information that is contained in a lease.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
STATE_NEW = 0
|
|||
STATE_PENDING = 1
|
|||
STATE_REJECTED = 2
|
|||
STATE_SCHEDULED = 3
|
|||
STATE_QUEUED = 4
|
|||
STATE_CANCELLED = 5
|
|||
STATE_PREPARING = 6
|
|||
STATE_READY = 7
|
|||
STATE_ACTIVE = 8
|
|||
STATE_SUSPENDING = 9
|
|||
STATE_SUSPENDED_PENDING = 10
|
|||
STATE_SUSPENDED_QUEUED = 11
|
|||
STATE_SUSPENDED_SCHEDULED = 12
|
|||
STATE_MIGRATING = 13
|
|||
STATE_RESUMING = 14
|
|||
STATE_RESUMED_READY = 15
|
|||
STATE_DONE = 16
|
|||
STATE_FAIL = 17
|
|||
state_str =
|
|||
BEST_EFFORT = 1
|
|||
ADVANCE_RESERVATION = 2
|
|||
IMMEDIATE = 3
|
|||
UNKNOWN = -1
|
|||
type_str =
|
|
|||
Inherited from |
|
Constructs a lease. The arguments are the fundamental attributes of a lease. The attributes that are not specified by the arguments are the lease ID (which is an autoincremented integer), the lease state (a lease always starts out in state "NEW"). A lease also has several bookkeeping attributes that are only meant to be consumed by other Haizea objects. Arguments: id -- Unique identifier for the lease. If None, one will be provided. submit_time -- The time at which the lease was submitted requested_resources -- A dictionary (int -> Capacity) mapping each requested node to a capacity (i.e., the amount of resources requested for that node) start -- A Timestamp object containing the requested time. duration -- A Duration object containing the requested duration. deadline -- A Timestamp object containing the deadline by which this lease must be completed. preemptible -- A boolean indicating whether this lease can be preempted or not. software -- A SoftwareEnvironment object specifying the software environment required by the lease.
|
Constructs a lease from an XML file. See the Haizea documentation for details on the lease XML format. Argument: xml_file -- XML file containing the lease in XML format. |
Constructs a lease from an XML string. See the Haizea documentation for details on the lease XML format. Argument: xml_str -- String containing the lease in XML format. |
Constructs a lease from an ElementTree element. See the Haizea documentation for details on the lease XML format. Argument: element -- Element object containing a "<lease>" element. |
Returns an ElementTree XML representation of the lease See the Haizea documentation for details on the lease XML format. |
Returns a string XML representation of the lease See the Haizea documentation for details on the lease XML format. |
Determines the type of lease Based on the lease's attributes, determines the lease's type. Can return Lease.BEST_EFFORT, Lease.ADVANCE_RESERVATION, or Lease.IMMEDIATE |
Changes the lease's state. The state machine will throw an exception if the requested transition is illegal. Argument: state -- The new state |
Prints the lease's attributes to the log. Argument: loglevel -- The loglevel at which to print the information |
Prints the lease's resource reservations to the log. Argument: loglevel -- The loglevel at which to print the information |
Returns the active VM resource reservations at a given time Argument: time -- Time to look for active reservations |
Returns the time at which the last VM reservation for this lease ends. Note that this is not necessarily the time at which the lease will end, just the time at which the last currently scheduled VM will end. |
Adds a VM resource reservation to the lease. Argument: vmrr -- The VM RR to add. |
Removes a VM resource reservation from the lease. Argument: vmrr -- The VM RR to remove. |
Adds a preparation resource reservation to the lease. Argument: preparation_rr -- The preparation RR to add. |
Removes a preparation resource reservation from the lease. Argument: preparation_rr -- The preparation RR to remove. |
Gets the waiting time for this lease. The waiting time is the difference between the submission time and the time at which the lease start. This method mostly makes sense for best-effort leases, where the starting time is determined by Haizea. |
Determines the bounded slowdown for this lease. Slowdown is a normalized measure of how much time a request takes to make it through a queue (thus, like get_waiting_time, the slowdown makes sense mostly for best-effort leases). Slowdown is equal to the time the lease took to run on a loaded system (i.e., a system where it had to compete with other leases for resources) divided by the time it would take if it just had the system all to itself (i.e., starts running immediately without having to wait in a queue and without the possibility of being preempted). "Bounded" slowdown is one where leases with very short durations are rounded up to a bound, to prevent the metric to be affected by reasonable but disproportionate waiting times (e.g., a 5-second lease with a 15 second waiting time -an arguably reasonable waiting time- has a slowdown of 4, the same as 10 hour lease having to wait 30 hours for resources). Argument: bound -- The bound, specified in seconds. All leases with a duration less than this parameter are rounded up to the bound. |
Adds a boot overhead to the lease. Increments the requested duration to account for the fact that some time will be spent booting up the resources. Argument: t -- Time to add |
Adds a runtime overhead to the lease. This method is mostly meant for simulations. Since VMs run slower than physical hardware, this increments the duration of a lease by a percent to observe the effect of having all the leases run slower on account of running on a VM. Note: the whole "runtime overhead" problem is becoming increasingly moot as people have lost their aversion to VMs thanks to the cloud computing craze. Anecdotal evidence suggests that most people don't care that VMs will run X % slower (compared to a physical machine) because they know full well that what they're getting is a virtual machine (the same way a user of an HPC system would know that he/she's getting processors with speed X as opposed to those on some other site, with speed X*0.10) Argument: percent -- Runtime overhead (in percent of requested duration) to add to the lease. |
|
state_str
|
type_str
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Dec 17 10:59:20 2009 | http://epydoc.sourceforge.net |