Roy Golan has posted comments on this change.
Change subject: core: throttle running of VMs (#843058)
......................................................................
Patch Set 1: (3 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java
Line 362: return true;
Line 363: }
Line 364:
Line 365: protected void DecreasePendingVms(Guid vdsId) {
Line 366: try {
will move the lock out of the try
Line 367: decreaseLock.lock();
Line 368: boolean updateDynamic = false;
Line 369: VDS vds = DbFacade.getInstance().getVdsDAO().get(vdsId);
Line 370: if (vds == null)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsFreeMemoryChecker.java
Line 19: public boolean evaluate(VDS vds, VM vm) {
Line 20: // first check if this host has memory.
Line 21: if (!RunVmCommandBase.hasMemoryToRunVM(vds, vm)) {
Line 22: // not enough memory to run the vm invoke the throttler.
Line 23: log.debug("not enough memory on host. throttling...");
will surround with isDebugEnabled
Line 24: throttler.throttle();
Line 25:
Line 26: // fetch a fresh vds and check its memory again
Line 27: vds = DbFacade.getInstance().getVdsDAO().get(vds.getId());
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsSelector.java
Line 227: || isVdsFailedToRunVm(vds.getId())) {
Line 228: return new
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER);
Line 229: }
Line 230: // If Vm in Paused mode - no additional memory allocation
needed
Line 231: else if (getVm().getstatus() != VMStatus.Paused &&
!memoryChecker.evaluate(vds, getVm())) {
since this is canDoAction I think I will revert to using the old static method.
there is no need for special treatment here.
maybe I'll have a SimpleMemeoryChecker here that will use no throttler at all
and deprecate the static use of hasMemoryToRun. thoughts?
Line 232: // not enough memory
Line 233: // In case we are using this function in migration we
make sure we
Line 234: // don't allocate the same VDS
Line 235: return new
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_MEMORY);
--
To view, visit http://gerrit.ovirt.org/7204
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I076ede6cba919bc61f7546d7b29ef436eb6d3375
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches