From 5d73974e95607cdbe70735391ed5beae83ce32c7 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 29 Jan 2020 17:22:29 -0500 Subject: [PATCH] Fix several bugs around load-based migrations --- client-common/common.py | 6 +++--- node-daemon/pvcd/common.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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