[Haizea] Give me a code example about how to impletmented a simple Load-aware Policy!

柯俊峰 kjf620520 at gmail.com
Fri Dec 4 01:35:10 CST 2009


Hi all,

 I want to implement Load-aware Policy which impletmented by using
those nodes with more FREECPU first.
Who can give me a simple code example?

Is it right? Please correct the following code ,thank you for your time!

    def get_host_score(self, node, time, lease):
        """Computes the score of a host

        See class documentation for details on what policy is implemented
here.
        See documentation of HostSelectionPolicy.get_host_score for more
details
        on this method.

        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.
        """
        aw = self.slottable.get_availability_window(time)
        avail = aw.get_availability_at(node, time)
        leases_in_node_score = avail.get_by_type(constants.RES_CPU)

Regards,
Jerry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.uchicago.edu/pipermail/haizea/attachments/20091204/62e7d663/attachment.htm 


More information about the Haizea mailing list