update node resource capacity for basic_consolidation

For Compute node, when calculating resource(VCPU, memory and disk)
capacity, we need to consider reserved resource and allocation ratio.

Partially Implements: blueprint improve-compute-data-model
Depends-on: I3f9a3279a26f3df444117d9265e74cca57b38d6e
Change-Id: I70257dd5fb342a67a3ffda1055eddc54b8360ca3
This commit is contained in:
licanwei
2019-07-29 10:54:40 +08:00
parent 0b25c884e6
commit 33d7de12ef
3 changed files with 9 additions and 9 deletions

View File

@@ -232,9 +232,9 @@ class BasicConsolidation(base.ServerConsolidationBaseStrategy):
:param total_mem: total memory used by the virtual machine
:return: True if the threshold is not exceed
"""
cpu_capacity = destination_node.vcpus
disk_capacity = destination_node.disk
memory_capacity = destination_node.memory
cpu_capacity = destination_node.vcpu_capacity
disk_capacity = destination_node.disk_gb_capacity
memory_capacity = destination_node.memory_mb_capacity
return (cpu_capacity >= total_cores * self.threshold_cores and
disk_capacity >= total_disk * self.threshold_disk and