From 93b40e92620340b77a2e4e28446272af7c99819b Mon Sep 17 00:00:00 2001 From: licanwei Date: Wed, 7 Aug 2019 11:28:22 +0800 Subject: [PATCH] update outlet_temp_control strategy For Compute node, we can use the new property to calculate resource(VCPU, memory and disk). Partially Implements: blueprint improve-compute-data-model Depends-on: I3f9a3279a26f3df444117d9265e74cca57b38d6e Change-Id: Id113b4c19792946329e9ff448bfe636cc8eca057 --- .../strategy/strategies/outlet_temp_control.py | 6 +++--- .../decision_engine/model/data/scenario_3_with_2_nodes.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/watcher/decision_engine/strategy/strategies/outlet_temp_control.py b/watcher/decision_engine/strategy/strategies/outlet_temp_control.py index 40a6a1a6f..536546047 100644 --- a/watcher/decision_engine/strategy/strategies/outlet_temp_control.py +++ b/watcher/decision_engine/strategy/strategies/outlet_temp_control.py @@ -223,9 +223,9 @@ class OutletTempControl(base.ThermalOptimizationBaseStrategy): host = instance_data['compute_node'] # available cores_used, mem_used, disk_used = self.calc_used_resource(host) - cores_available = host.vcpus - cores_used - disk_available = host.disk - disk_used - mem_available = host.memory - mem_used + cores_available = host.vcpu_capacity - cores_used + disk_available = host.disk_gb_capacity - disk_used + mem_available = host.memory_mb_capacity - mem_used if cores_available >= required_cores \ and disk_available >= required_disk \ and mem_available >= required_memory: diff --git a/watcher/tests/decision_engine/model/data/scenario_3_with_2_nodes.xml b/watcher/tests/decision_engine/model/data/scenario_3_with_2_nodes.xml index ea90081bc..9a00e3109 100644 --- a/watcher/tests/decision_engine/model/data/scenario_3_with_2_nodes.xml +++ b/watcher/tests/decision_engine/model/data/scenario_3_with_2_nodes.xml @@ -1,8 +1,8 @@ - + - +