From 1ba37fe33d8b7b38f2cb2dc42075bc55f01bb42c Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 11 Dec 2023 11:52:59 -0500 Subject: [PATCH] Restore VM resource allocation location Commit 5f1432ccdd38996dac0f528035634cbc82827abd changed where these happen due to a bug after fencing. However this completely broke node resource reporting as only the final instance will be queried here. Revert this change and look further into the original bug. --- node-daemon/pvcnoded/util/keepalive.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/node-daemon/pvcnoded/util/keepalive.py b/node-daemon/pvcnoded/util/keepalive.py index 8d211d9e..5cf7a1e5 100644 --- a/node-daemon/pvcnoded/util/keepalive.py +++ b/node-daemon/pvcnoded/util/keepalive.py @@ -477,6 +477,10 @@ def collect_vm_stats(logger, config, zkhandler, this_node, queue): fixed_d_domain = this_node.d_domain.copy() for domain, instance in fixed_d_domain.items(): if domain in this_node.domain_list: + # Add the allocated memory to our memalloc value + memalloc += instance.getmemory() + memprov += instance.getmemory() + vcpualloc += instance.getvcpus() if instance.getstate() == "start" and instance.getnode() == this_node.name: if instance.getdom() is not None: try: @@ -532,11 +536,6 @@ def collect_vm_stats(logger, config, zkhandler, this_node, queue): continue domain_memory_stats = domain.memoryStats() domain_cpu_stats = domain.getCPUStats(True)[0] - - # Add the allocated memory to our memalloc value - memalloc += instance.getmemory() - memprov += instance.getmemory() - vcpualloc += instance.getvcpus() except Exception as e: if debug: try: