[Haizea] get_host_score method

Borja Sotomayor borja at borjanet.com
Thu Sep 30 11:18:56 CDT 2010


Hi,

> In "def get_host_score(self, node, time, lease):" method of "class
> GreedyPolicy(HostSelectionPolicy):" class, I would like to find How
> much parts of a current scheduled lease on node "node" is scheduled on
> that node?.

Actually, it might be easier to do this by accessing the
VirtualMachineResourceReservation for that lease at that time (once
you have the Lease object, you can use the get_vmrr_at method to
obtain the VMRR). Using the Lease's requested_resources (as you do in
your code) would be another way of doing this, but the VMRR object
will provide an exact mapping of physical nodes to reserved resources,
so you can easily check how many resources are reserved in nodes other
than a given node.

Cheers!
--
Borja Sotomayor
Scientific Writer at UChicago's Computation Institute
http://people.cs.uchicago.edu/~borja/


More information about the Haizea mailing list