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 <[email protected]>
---
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/51/24651/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 a970511..026c611 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
@@ -1861,9 +1861,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 (!VMStatus.WaitForLaunch.equals(vm.getStatus())) {
+                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/24651
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2db20c213ac326d620fad578bb5c1c78ff0b3bc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to