Arik Hadas has uploaded a new change for review. Change subject: core: prevent incorrect down events on migration ......................................................................
core: prevent incorrect down events on migration We are not supposed to produce audit log events when VM went down on a host which is different than the one it should run on. It should only happen when the VM is migrating. We used to eliminate such audit logs when the VM went down normally, from now on we will eliminate them also when the VM went down because of an error. Change-Id: I90b684e75972ca8eb384c33f7fab8b73640ada20 Bug-Url: https://bugzilla.redhat.com/1104195 Signed-off-by: Arik Hadas <aha...@redhat.com> --- M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java 1 file changed, 5 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/61/32261/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 60e4eb9..bf16445 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 @@ -1564,10 +1564,13 @@ private void handleVmOnDown(VM cacheVm, VmDynamic vmDynamic, VmStatistics vmStatistics) { VmExitStatus exitStatus = vmDynamic.getExitStatus(); - if (exitStatus != VmExitStatus.Normal) { - + // we don't need to have an audit log for the case where the VM went down on a host + // which is different than the one it should be running on (must be in migration process) + if (cacheVm != null) { auditVmOnDownEvent(exitStatus, vmDynamic.getExitMessage(), vmStatistics.getId()); + } + if (exitStatus != VmExitStatus.Normal) { // Vm failed to run - try to rerun it on other Vds if (cacheVm != null) { if (ResourceManager.getInstance().IsVmInAsyncRunningList(vmDynamic.getId())) { @@ -1583,12 +1586,6 @@ addVmDynamicToList(vmDynamic); } } else { - // if went down normally during migration process (either on source or on destination) - // don't generate an event - if (cacheVm != null) { - auditVmOnDownEvent(exitStatus, vmDynamic.getExitMessage(), vmStatistics.getId()); - } - // Vm moved safely to down status. May be migration - just remove it from Async Running command. ResourceManager.getInstance().RemoveAsyncRunningVm(vmDynamic.getId()); } -- To view, visit http://gerrit.ovirt.org/32261 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90b684e75972ca8eb384c33f7fab8b73640ada20 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Arik Hadas <aha...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches