From 65f31f1a9fbc1c20cd752d80a7e1117efc0248a5 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Wed, 8 Aug 2018 08:44:26 +0200 Subject: [PATCH] kvm: Agent should not check if remaining memory on host is sufficient (#2766) When a Instance is (attempted to be) started in KVM Host the Agent should not worry about the allocated memory on this host. To make a proper judgement we need to take more into account: - Memory Overcommit ratio - Host reserved memory - Host overcommit memory The Management Server has all the information and the DeploymentPlanner has to make the decision if a Instance should and can be started on a Host, not the host itself. Signed-off-by: Wido den Hollander --- .../resource/LibvirtComputingResource.java | 6 ----- .../wrapper/LibvirtStartCommandWrapper.java | 26 ------------------- .../LibvirtComputingResourceTest.java | 1 - 3 files changed, 33 deletions(-) diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 3983b18b297..ed87974cd51 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -277,7 +277,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv protected int _rngRateBytes = 2048; private File _qemuSocketsPath; private final String _qemuGuestAgentSocketName = "org.qemu.guest_agent.0"; - private long _totalMemory; protected WatchDogAction _watchDogAction = WatchDogAction.NONE; protected WatchDogModel _watchDogModel = WatchDogModel.I6300ESB; @@ -2603,7 +2602,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv public StartupCommand[] initialize() { final List info = getHostInfo(); - _totalMemory = (Long)info.get(2); final StartupRoutingCommand cmd = new StartupRoutingCommand((Integer)info.get(0), (Long)info.get(1), (Long)info.get(2), (Long)info.get(4), (String)info.get(3), _hypervisorType, @@ -3792,10 +3790,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv } } - public long getTotalMemory() { - return _totalMemory; - } - public String getHostDistro() { return _hostDistro; } diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java index 5a75f078f9e..fd5f2fa83ef 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java @@ -24,7 +24,6 @@ import java.util.List; import org.apache.log4j.Logger; import org.libvirt.Connect; -import org.libvirt.Domain; import org.libvirt.DomainInfo.DomainState; import org.libvirt.LibvirtException; @@ -65,13 +64,6 @@ public final class LibvirtStartCommandWrapper extends CommandWrapper