Doron Fediuck has posted comments on this change.
Change subject: core: Add event logs for balloon issues
......................................................................
Patch Set 3: (5 inline comments)
Initial pass only.
There will be more.
....................................................
File
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
Line 315: VmBalloonInfo vmBalloonInfo = new VmBalloonInfo();
Line 316: if (balloonInfo != null && balloonInfo.size() > 0) {
Line 317:
vmBalloonInfo.setCurrentMemory(AssignLongValue(balloonInfo,
VdsProperties.vm_balloon_cur));
Line 318:
vmBalloonInfo.setBalloonMaxMemory(AssignLongValue(balloonInfo,
VdsProperties.vm_balloon_max));
Line 319:
vmBalloonInfo.setBalloonTargetMemory(AssignLongValue(balloonInfo,
VdsProperties.vm_balloon_target));
New engine should work with older vdsm as well.
Please check that this will not provide NPE if we only have curr and max.
Line 320:
vmBalloonInfo.setBalloonMinMemory(AssignLongValue(balloonInfo,
VdsProperties.vm_balloon_min));
Line 321: } else {
Line 322: vmBalloonInfo.setBalloonDeviceEnabled(false);
Line 323: }
....................................................
File
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
Line 1391: Integer currentVal = vmsWithBalloonDriverProblem.get(vmId);
Line 1392: if (currentVal == null) {
Line 1393: vmsWithBalloonDriverProblem.put(vmId, 1);
Line 1394: } else {
Line 1395: vmsWithBalloonDriverProblem.put(vmId, currentVal + 1);
I guess you need to clear this after the alert?
Line 1396: if (currentVal >= Config.<Integer>
GetValue(ConfigValues.IterationsWithBalloonProblem)) {
Line 1397: AuditLogableBase auditLogable = new
AuditLogableBase();
Line 1398: auditLogable.setVmId(vmId);
Line 1399: AuditLogDirector.log(auditLogable,
AuditLogType.VM_BALLOON_DRIVER_ERROR);
Line 1401: }
Line 1402: }
Line 1403:
Line 1404: private boolean isBalloonActiveOnHost() {
Line 1405: VDSGroup cluster =
getDbFacade().getVdsGroupDao().get(_vds.getVdsGroupId());
Don;t we have this info somewhere available?
Line 1406: return cluster != null && cluster.isEnableBallooning();
Line 1407: }
Line 1408:
Line 1409: private boolean isBalloonDeviceActiveOnVm(VmInternalData
vmInternalData) {
Line 1409: private boolean isBalloonDeviceActiveOnVm(VmInternalData
vmInternalData) {
Line 1410: VM savedVm =
_vmDict.get(vmInternalData.getVmDynamic().getId());
Line 1411: VmBalloonInfo balloonInfo =
vmInternalData.getVmStatistics().getVmBalloonInfo();
Line 1412: return savedVm.getMinAllocatedMem() < savedVm.getMemSizeMb()
Line 1413: && savedVm.getMinAllocatedMem() <
savedVm.getTotalMemorySizeInBytes()
Why do we need to test both of the above?
Did you notice one is in MB ant the other in Bytes?
Line 1414: && balloonInfo.isBalloonDeviceEnabled()
Line 1415: && balloonInfo.getBalloonTargetMemory() !=
balloonInfo.getBalloonMaxMemory();
Line 1416: }
Line 1417:
Line 1411: VmBalloonInfo balloonInfo =
vmInternalData.getVmStatistics().getVmBalloonInfo();
Line 1412: return savedVm.getMinAllocatedMem() < savedVm.getMemSizeMb()
Line 1413: && savedVm.getMinAllocatedMem() <
savedVm.getTotalMemorySizeInBytes()
Line 1414: && balloonInfo.isBalloonDeviceEnabled()
Line 1415: && balloonInfo.getBalloonTargetMemory() !=
balloonInfo.getBalloonMaxMemory();
Please add comments the explain what each condition means.
Line 1416: }
Line 1417:
Line 1418: private Long toMegaByte(Long kilobytes) {
Line 1419: if (kilobytes != null && kilobytes > 0) {
--
To view, visit http://gerrit.ovirt.org/17486
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I30395b90b74777eacca76419c20960eb812204ae
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: Noam Slomianko <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches