Eli Mesika has uploaded a new change for review.

Change subject: core: Provide informations about fencing in RHEV-M
......................................................................

core: Provide informations about fencing in RHEV-M

This patch adds missing logging in both log file and audit log for
fencing flow.

Change-Id: I3f9aa1711f9b47b7a5a3b805da4002e3fbbe24be
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1070674
Signed-off-by: Eli Mesika <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
3 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/06/27706/1

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 e1bd45c..8c8be51 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
@@ -879,6 +879,8 @@
     VDS_ALERT_FENCE_STATUS_VERIFICATION_FAILED(9005, AuditLogSeverity.ALERT),
     CANNOT_HIBERNATE_RUNNING_VMS_AFTER_CLUSTER_CPU_UPGRADE(9006, 
AuditLogSeverity.WARNING),
     VDS_ALERT_SECONDARY_AGENT_USED_FOR_FENCE_OPERATION(9007, 
AuditLogSeverity.ALERT),
+    VDS_HOST_IN_CONNECTING_STATE(9008, AuditLogSeverity.WARNING),
+
 
     TASK_STOPPING_ASYNC_TASK(9500, AuditLogTimeInterval.MINUTE.getValue()),
     TASK_CLEARING_ASYNC_TASK(9501, AuditLogTimeInterval.MINUTE.getValue()),
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
index 3b4ba38..fd6c986 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -607,6 +607,7 @@
 VDS_ALERT_FENCE_NO_PROXY_HOST=There is no other host in the data center that 
can be used to test the power management settings.
 VDS_ALERT_FENCE_STATUS_VERIFICATION_FAILED=Failed to verify Host ${Host} 
${Status} status, Please ${Status} Host ${Host} manually.
 VDS_ALERT_SECONDARY_AGENT_USED_FOR_FENCE_OPERATION=Secondary fence agent was 
used to ${Operation} Host ${VdsName}
+VDS_HOST_NOT_RESPONDING_CONNECTING=Host ${VdsName} is not responding, Host 
will be in Connecting state for a grace period of ${Seconds}} Sec and after 
that an attempt to fence the Host will be issued.
 TASK_STOPPING_ASYNC_TASK=Stopping async task ${CommandName} that started at 
${Date}
 REFRESH_REPOSITORY_IMAGE_LIST_FAILED=Refresh image list failed for domain(s): 
${imageDomains}. Please check domain activity.
 REFRESH_REPOSITORY_IMAGE_LIST_SUCCEEDED=Refresh image list succeeded for 
domain(s): ${imageDomains}
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
index e90471a..98af542 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
@@ -671,6 +671,12 @@
     public boolean handleNetworkException(VDSNetworkException ex, VDS vds) {
         if (vds.getStatus() != VDSStatus.Down) {
             long timeoutToFence = calcTimeoutToFence(vds.getVmCount(), 
vds.getSpmStatus());
+            log.warnFormat("Host {0} is not responding, Host will be in 
Connecting state for a grace period of {1} Sec and after that an attempt to 
fence the Host will be issued.", vds.getName(), 
TimeUnit.MILLISECONDS.toSeconds(timeoutToFence));
+            // raise an alert that secondary agent was used
+            AuditLogableBase logable = new AuditLogableBase();
+            logable.setVdsId(vds.getId());
+            logable.addCustomValue("Seconds", new 
Long(TimeUnit.MILLISECONDS.toSeconds(timeoutToFence)).toString());
+            AuditLogDirector.log(logable, 
AuditLogType.VDS_HOST_IN_CONNECTING_STATE);
             if (mUnrespondedAttempts.get() < Config.<Integer> 
getValue(ConfigValues.VDSAttemptsToResetCount)
                     || (lastUpdate + timeoutToFence) > 
System.currentTimeMillis()) {
                 boolean result = false;
@@ -694,7 +700,7 @@
                     vds.getId(), vds.getName(), vds.getVmCount(), 
vds.getSpmStatus(),
                     TimeUnit.MILLISECONDS.toSeconds(timeoutToFence), 
ex.getMessage());
 
-            AuditLogableBase logable = new AuditLogableBase(vds.getId());
+            logable = new AuditLogableBase(vds.getId());
             logable.updateCallStackFromThrowable(ex);
             AuditLogDirector.log(logable, AuditLogType.VDS_FAILURE);
             boolean executeSshSoftFencing = false;


-- 
To view, visit http://gerrit.ovirt.org/27706
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f9aa1711f9b47b7a5a3b805da4002e3fbbe24be
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to