From 0fec88ec06061861b911adba144ebc8fb473040c Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 3 Aug 2023 09:50:01 +0530 Subject: [PATCH] server: KVM guru should pass max memory as per VM transfer object This makes the KVM guru pass the max memory to KVM agent by picking the max. memory from the VM transfer object. This lets the cluster/agent decide if VM should start with the min or max memory depending on whether vm.memballoon.disable is false (default) or true. When `vm.memballoon.disable` is true, VMs start with max. memory. Right now the max memory isn't sent to the KVM agent causing the regression. Also fixes #7430 Signed-off-by: Rohit Yadav --- server/src/main/java/com/cloud/hypervisor/KVMGuru.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/cloud/hypervisor/KVMGuru.java b/server/src/main/java/com/cloud/hypervisor/KVMGuru.java index 412bd40f8f16..fc808b1607ef 100644 --- a/server/src/main/java/com/cloud/hypervisor/KVMGuru.java +++ b/server/src/main/java/com/cloud/hypervisor/KVMGuru.java @@ -213,7 +213,7 @@ protected void configureVmMemoryAndCpuCores(VirtualMachineTO virtualMachineTo, H Integer maxHostCpuCore = max.second(); long minMemory = virtualMachineTo.getMinRam(); - Long maxMemory = minMemory; + Long maxMemory = virtualMachineTo.getMaxRam(); int minCpuCores = virtualMachineTo.getCpus(); Integer maxCpuCores = minCpuCores;