Gilad Chaplik has uploaded a new change for review.

Change subject: core: resouces of VMs in launch state shouldn't be committed
......................................................................

core: resouces of VMs in launch state shouldn't be committed

Currently we count pending in scheduling process, and committed memory
is calculated in server side according to VMs attached to the host
(including VMs in wait for launch state- host in VM entity
is update when CreateVm command returns from VDSM).
Pending memory is being release in powering-up state, so in fact
we count resources twice: since the time VM is in wait for launch till it's
powering up.

Memory commitment in VDSM occurs after a vm was requested, so using
this data will eliminate VM throttling that failed to reach powering up
state.

Change-Id: Ie2db20c213ac326d620fad578bb5c1c78ff0b3bc
Bug-Url: https://bugzilla.redhat.com/1052024
Signed-off-by: Gilad Chaplik <gchap...@redhat.com>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/61/25461/1

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
index 7ed2132..31801f2 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
@@ -1870,9 +1870,13 @@
         Integer memCommited = _vds.getGuestOverhead();
         int vmsCoresCount = 0;
         for (VM vm : _vmDict.values()) {
-            memCommited += vm.getVmMemSizeMb();
-            memCommited += _vds.getGuestOverhead();
-            vmsCoresCount += vm.getNumOfCpus();
+            // VMs' pending resources are cleared in powering up, so in launch 
state
+            // we shouldn't include them as committed.
+            if (vm.getStatus() != VMStatus.WaitForLaunch) {
+                memCommited += vm.getVmMemSizeMb();
+                memCommited += _vds.getGuestOverhead();
+                vmsCoresCount += vm.getNumOfCpus();
+            }
         }
         if (memCommited == null || !memCommited.equals(_vds.getMemCommited())) 
{
             _vds.setMemCommited(memCommited);


-- 
To view, visit http://gerrit.ovirt.org/25461
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2db20c213ac326d620fad578bb5c1c78ff0b3bc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to