Arik Hadas has uploaded a new change for review. Change subject: core: update the committed memory properly ......................................................................
core: update the committed memory properly The computation of the committed memory was wrong because it included VMs which are down as well. The problem was that we were iterating the wrong collections of VMs, we should iterate over the VMs which we got back from VDSM and take only them into consideration. Change-Id: I04be4ca80456ffbf47af2f883a33672166c25cb6 Bug-Url: https://bugzilla.redhat.com/1078553 Signed-off-by: Arik Hadas <[email protected]> --- M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/48/25948/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 36ed4e9..4e83747 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 @@ -904,6 +904,7 @@ } if (fetchRunningVms()) { + refreshCommitedMemory(); List<Guid> staleRunningVms = checkVmsStatusChanged(); proceedWatchdogEvents(); @@ -924,7 +925,6 @@ // checking the db for incoherent vm status; // setVmStatusDownForVmNotFound(); - refreshCommitedMemory(); // Handle VM devices were changed (for 3.1 cluster and above) if (!VmDeviceCommonUtils.isOldClusterVersion(_vds.getVdsGroupCompatibilityVersion())) { handleVmDeviceChange(); @@ -1842,10 +1842,13 @@ private void refreshCommitedMemory() { Integer memCommited = _vds.getGuestOverhead(); int vmsCoresCount = 0; - for (VM vm : _vmDict.values()) { + for (VmInternalData runningVm : _runningVms.values()) { + VmDynamic vmDynamic = runningVm.getVmDynamic(); // VMs' pending resources are cleared in powering up, so in launch state // we shouldn't include them as committed. - if (vm.getStatus() != VMStatus.WaitForLaunch) { + if (vmDynamic.getStatus() != VMStatus.WaitForLaunch && + vmDynamic.getStatus() != VMStatus.Down) { + VM vm = _vmDict.get(vmDynamic.getId()); memCommited += vm.getVmMemSizeMb(); memCommited += _vds.getGuestOverhead(); vmsCoresCount += vm.getNumOfCpus(); -- To view, visit http://gerrit.ovirt.org/25948 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04be4ca80456ffbf47af2f883a33672166c25cb6 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.3 Gerrit-Owner: Arik Hadas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
