Do not scale a computer node if its memory is less than existed nodes.

Change-Id: I3b9a468a0f7358471e6d1e5e4a01720a0162cfdd
(cherry picked from commit b9cb083f82)
This commit is contained in:
meizhifang
2016-11-28 18:59:02 +08:00
committed by Zhijiang Hu
parent da23b9899b
commit ea836174cb

7
code/daisy/daisy/orchestration/manager.py Normal file → Executable file
View File

@@ -133,6 +133,8 @@ class OrchestrationManager():
def check_isomorphic_host(self, compute_list, host_info):
new_interfaces = host_info.interfaces
host_numa_cpus = utils.get_numa_node_cpus((host_info.cpu or {}))
memory_size_b_str = str(host_info.memery['total'])
memory_size_b_int = int(memory_size_b_str.strip().split()[0])
for compute_host in compute_list:
new_interface_count = len(
[interface for interface in
@@ -148,6 +150,11 @@ class OrchestrationManager():
(compute_host.cpu or {}))
if compute_numa_cpus != host_numa_cpus:
continue
active_compu_memory_str = str(compute_host.memory['total'])
active_compu_memory_size =\
int(active_compu_memory_str.strip().split()[0])
if memory_size_b_int < active_compu_memory_size:
continue
is_isomorphic = False
for interface in new_interfaces:
if interface['type'] != "ether":