From 101c1907aa93fed1413f67cb1c3e6a2cd08b0599 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Tue, 24 Jul 2018 16:18:34 +0200 Subject: [PATCH] kvm: Agent should not check if remaining memory on host is sufficient 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 3983b18b2970..ed87974cd51a 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 @@ private Map getVersionStrings() { 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 void restoreVMSnapshotMetadata(Domain dm, String vmName, List