diff --git a/watcher/decision_engine/strategy/strategies/host_maintenance.py b/watcher/decision_engine/strategy/strategies/host_maintenance.py index ccd3a306b..5e5479cfb 100644 --- a/watcher/decision_engine/strategy/strategies/host_maintenance.py +++ b/watcher/decision_engine/strategy/strategies/host_maintenance.py @@ -133,9 +133,9 @@ class HostMaintenance(base.HostMaintenanceBaseStrategy): :param node: node object :return: dict(cpu(cores), ram(MB), disk(B)) """ - return dict(cpu=node.vcpus, - ram=node.memory, - disk=node.disk) + return dict(cpu=node.vcpu_capacity, + ram=node.memory_mb_capacity, + disk=node.disk_gb_capacity) def get_node_used(self, node): """Collect cpu, ram and disk used of a node. diff --git a/watcher/tests/decision_engine/model/data/scenario_1.xml b/watcher/tests/decision_engine/model/data/scenario_1.xml index 933399961..83cc43496 100644 --- a/watcher/tests/decision_engine/model/data/scenario_1.xml +++ b/watcher/tests/decision_engine/model/data/scenario_1.xml @@ -1,20 +1,20 @@ - + - + - + - + - + diff --git a/watcher/tests/decision_engine/model/data/scenario_1_with_all_nodes_disable.xml b/watcher/tests/decision_engine/model/data/scenario_1_with_all_nodes_disable.xml index a2f9ea2a9..7ee44a612 100644 --- a/watcher/tests/decision_engine/model/data/scenario_1_with_all_nodes_disable.xml +++ b/watcher/tests/decision_engine/model/data/scenario_1_with_all_nodes_disable.xml @@ -1,8 +1,8 @@ - + - + diff --git a/watcher/tests/decision_engine/model/data/scenario_9_with_3_active_plus_1_disabled_nodes.xml b/watcher/tests/decision_engine/model/data/scenario_9_with_3_active_plus_1_disabled_nodes.xml index bdc602a0d..9c7b66afb 100644 --- a/watcher/tests/decision_engine/model/data/scenario_9_with_3_active_plus_1_disabled_nodes.xml +++ b/watcher/tests/decision_engine/model/data/scenario_9_with_3_active_plus_1_disabled_nodes.xml @@ -1,16 +1,16 @@ - + - + - + - + diff --git a/watcher/tests/decision_engine/model/faker_cluster_state.py b/watcher/tests/decision_engine/model/faker_cluster_state.py index a64f2a7bb..51ca228c5 100644 --- a/watcher/tests/decision_engine/model/faker_cluster_state.py +++ b/watcher/tests/decision_engine/model/faker_cluster_state.py @@ -82,9 +82,15 @@ class FakerModelCollector(base.BaseClusterDataModelCollector): "uuid": node_uuid, "hostname": hostname, "memory": 132, + "memory_mb_reserved": 0, + "memory_ratio": 1, "disk": 250, "disk_capacity": 250, + "disk_gb_reserved": 0, + "disk_ratio": 1, "vcpus": 40, + "vcpu_reserved": 0, + "vcpu_ratio": 1, } node = element.ComputeNode(**node_attributes) model.add_node(node)