Eli Mesika has uploaded a new change for review. Change subject: core: Distinguish between manual fence resulted.. ......................................................................
core: Distinguish between manual fence resulted.. Distinguish between manual fence resulted from user action and manual fence called internally by auto fence Manual fence currently can be executed in 2 flows 1) As part of the non responding treatment when host is restart via its PM agent. 2) As a result of a manual host stopping and choosing "confirm Host has been rebooted" from the right-click popup menu The messages generated by both to the log are of the format: Manual fence for host ${VdsName} was started. Manual fence for host ${VdsName} failed. When this occurs in scenario 1) above, the term "manual" in the audit log is confusing and should be changed to reflect the fact that was done internally by the engine code and not by the user This patch logs different messages to the audit log when resulted from scenario 1) above. Change-Id: I274ec95bb3f2c217bd9871afa9d761a1b975d793 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1083750 Signed-off-by: Eli Mesika <emes...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/FenceVdsManualyCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java 2 files changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/26385/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/FenceVdsManualyCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/FenceVdsManualyCommand.java index 0de6fdf..1ab3ba6 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/FenceVdsManualyCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/FenceVdsManualyCommand.java @@ -111,8 +111,14 @@ @Override public AuditLogType getAuditLogTypeValue() { - return _fenceSpmCalled != null && !_fenceSpmCalled ? AuditLogType.VDS_MANUAL_FENCE_FAILED_CALL_FENCE_SPM - : getSucceeded() ? AuditLogType.VDS_MANUAL_FENCE_STATUS : AuditLogType.VDS_MANUAL_FENCE_STATUS_FAILED; + if (isInternalExecution()) { + return _fenceSpmCalled != null && !_fenceSpmCalled ? AuditLogType.VDS_AUTO_FENCE_FAILED_CALL_FENCE_SPM + : getSucceeded() ? AuditLogType.VDS_AUTO_FENCE_STATUS : AuditLogType.VDS_AUTO_FENCE_STATUS_FAILED; + } + else { + return _fenceSpmCalled != null && !_fenceSpmCalled ? AuditLogType.VDS_MANUAL_FENCE_FAILED_CALL_FENCE_SPM + : getSucceeded() ? AuditLogType.VDS_MANUAL_FENCE_STATUS : AuditLogType.VDS_MANUAL_FENCE_STATUS_FAILED; + } } /** diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java index 47a709e..e638e8e 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java @@ -29,8 +29,11 @@ AuditLogTimeInterval.MINUTE.getValue() * 5), // ? VDS_ALREADY_IN_REQUESTED_STATUS(493, AuditLogSeverity.WARNING), VDS_MANUAL_FENCE_STATUS(494), + VDS_AUTO_FENCE_STATUS(539), VDS_MANUAL_FENCE_STATUS_FAILED(495, AuditLogSeverity.ERROR), + VDS_AUTO_FENCE_STATUS_FAILED(540, AuditLogSeverity.ERROR), VDS_MANUAL_FENCE_FAILED_CALL_FENCE_SPM(530, AuditLogSeverity.WARNING), + VDS_AUTO_FENCE_FAILED_CALL_FENCE_SPM(541, AuditLogSeverity.WARNING), VDS_LOW_MEM(531, AuditLogSeverity.WARNING, AuditLogTimeInterval.MINUTE.getValue() * 30), VDS_HIGH_MEM_USE(532, AuditLogSeverity.WARNING, -- To view, visit http://gerrit.ovirt.org/26385 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I274ec95bb3f2c217bd9871afa9d761a1b975d793 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <emes...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches