[Haizea] get_host_score method

Mehdi Sheikhalishahi mehdi.alishahi at gmail.com
Fri Sep 24 10:08:51 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?.

I mean perhaps sometimes because of lack of enough capacity, some
parts of a lease would be scheduled on the other nodes.
The following is some part of code I've written in get_host_score function.

scheduled_leases_on_node = aw.get_leases_at(node, time)
for l in scheduled_leases_on_node:
     for res in l.requested_resources.values():
                    for i in range(len(res._single_instance)):
                        if res._single_instance[i] >
max_res._single_instance[i]:
                            max_res._single_instance[i] =
res._single_instance[i]

Regards,
Mehdi


More information about the Haizea mailing list