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 M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java 3 files changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/43/26743/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 f502caf..bd706c3 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,19 @@ @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; + } } /** @@ -234,6 +245,7 @@ getActionType().getActionGroup())); } + @Override protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__MANUAL_FENCE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__HOST); 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 ecac38b..4f5862f 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 @@ -24,8 +24,11 @@ VDS_SLOW_STORAGE_RESPONSE_TIME(123, AuditLogTimeInterval.MINUTE.getValue() * 5), // ? VDS_ALREADY_IN_REQUESTED_STATUS(493), VDS_MANUAL_FENCE_STATUS(494), + VDS_AUTO_FENCE_STATUS(539), VDS_MANUAL_FENCE_STATUS_FAILED(495), + VDS_AUTO_FENCE_STATUS_FAILED(540), VDS_MANUAL_FENCE_FAILED_CALL_FENCE_SPM(530), + VDS_AUTO_FENCE_FAILED_CALL_FENCE_SPM(541), VDS_LOW_MEM(531, AuditLogTimeInterval.MINUTE.getValue() * 30), VDS_HIGH_MEM_USE(532, AuditLogTimeInterval.MINUTE.getValue() * 30), @Deprecated diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java index 2ed8ad8..e5b3298 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java @@ -347,8 +347,11 @@ severities.put(AuditLogType.IRS_HOSTED_ON_VDS, AuditLogSeverity.NORMAL); severities.put(AuditLogType.VDS_ALREADY_IN_REQUESTED_STATUS, AuditLogSeverity.WARNING); severities.put(AuditLogType.VDS_MANUAL_FENCE_STATUS, AuditLogSeverity.NORMAL); + severities.put(AuditLogType.VDS_AUTO_FENCE_STATUS, AuditLogSeverity.NORMAL); severities.put(AuditLogType.VDS_MANUAL_FENCE_STATUS_FAILED, AuditLogSeverity.ERROR); + severities.put(AuditLogType.VDS_AUTO_FENCE_STATUS_FAILED, AuditLogSeverity.ERROR); severities.put(AuditLogType.VDS_MANUAL_FENCE_FAILED_CALL_FENCE_SPM, AuditLogSeverity.WARNING); + severities.put(AuditLogType.VDS_AUTO_FENCE_FAILED_CALL_FENCE_SPM, AuditLogSeverity.WARNING); severities.put(AuditLogType.USER_VDS_MAINTENANCE, AuditLogSeverity.NORMAL); severities.put(AuditLogType.VDS_ALERT_FENCE_NO_PROXY_HOST, AuditLogSeverity.NORMAL); severities.put(AuditLogType.VDS_LOW_MEM, AuditLogSeverity.WARNING); -- To view, visit http://gerrit.ovirt.org/26743 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I274ec95bb3f2c217bd9871afa9d761a1b975d793 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.4 Gerrit-Owner: Eli Mesika <emes...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches