Package haizea :: Package core :: Package scheduler :: Module policy :: Class HostSelectionPolicy
[hide private]
[frames] | no frames]

Class HostSelectionPolicy

source code


Host Selection policy

This is the parent class of host selection policies. When mapping VMs to physical hosts, this policy determines what hosts are more desireable. For example, an energy-saving policy might value hosts that already have VMs running (to leave as many empty machines as possible, which could then be turned off), whereas another policy might prefer empty hosts to make sure that VMs are spread out across nodes.

To do this, the policy will assign a score to each host. See the documentation for get_host_score for more details.

Instance Methods [hide private]
 
__init__(self, slottable)
Constructor
source code
 
get_host_score(self, node, time, lease)
Computes the score of a host
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, slottable)
(Constructor)

source code 

Constructor

Argument slottable -- A fully constructed SlotTable

Overrides: object.__init__

get_host_score(self, node, time, lease)

source code 

Computes the score of a host

Given a physical host, a time, and a lease we would like to schedule at that time, this method returns a score indicating how desireable that host is for that lease at that time. The score can be between 0.0 and 1.0. The higher the score, the "more desireable" the physical host is (this is a relative measure; the score should be used to determine which of several physical hosts is more desireable for this lease).

Arguments: node -- Physical node (the integer identifier used in the slot table) time -- Time at which the lease might be scheduled lease -- Lease that is being scheduled.