diff --git a/client-common/common.py b/client-common/common.py index 2c0bbec8..7b83cdc5 100644 --- a/client-common/common.py +++ b/client-common/common.py @@ -382,16 +382,16 @@ def findTargetNodeMem(zk_conn, node_limit, dom_uuid): # via load average def findTargetNodeLoad(zk_conn, node_limit, dom_uuid): - least_load = 9999 + least_load = 9999.0 target_node = None node_list = getNodes(zk_conn, node_limit, dom_uuid) for node in node_list: - load = int(zkhandler.readdata(zk_conn, '/nodes/{}/cpuload'.format(node))) + load = float(zkhandler.readdata(zk_conn, '/nodes/{}/cpuload'.format(node))) if load < least_load: least_load = load - target_hypevisor = node + target_node = node return target_node diff --git a/node-daemon/pvcd/common.py b/node-daemon/pvcd/common.py index 99cbcd4c..215c6b1b 100644 --- a/node-daemon/pvcd/common.py +++ b/node-daemon/pvcd/common.py @@ -212,16 +212,16 @@ def findTargetNodeMem(zk_conn, node_limit, dom_uuid): # via load average def findTargetNodeLoad(zk_conn, node_limit, dom_uuid): - least_load = 9999 + least_load = 9999.0 target_node = None node_list = getNodes(zk_conn, node_limit, dom_uuid) for node in node_list: - load = int(zkhandler.readdata(zk_conn, '/nodes/{}/load'.format(node))) + load = float(zkhandler.readdata(zk_conn, '/nodes/{}/cpuload'.format(node))) if load < least_load: least_load = load - target_hypevisor = node + target_node = node return target_node