Eli Mesika has uploaded a new change for review.

Change subject: core:  PRD32 - RFE: Multi-Tier fencing in RHEV-M
......................................................................

core:  PRD32 - RFE: Multi-Tier fencing in RHEV-M

1) Removing the status check in the canDoAction such that for sequential
multiple agents secondary agent will still be used even tough the
primary agent is not reachable.
Also added an Alert in case that a primary agent failed to function and
a secondary agent is used in the case of sequential multiple agents.

Change-Id: Ieb5a3a8edeb58f74f0e74d3e54911f0cdb614762
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=773108
Signed-off-by: Eli Mesika <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.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
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
5 files changed, 12 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/98/13698/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
index fd3111a..21f8b04 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
@@ -173,15 +173,6 @@
     }
 
     /**
-     * Check if the proxy can be used to fence the host successfully.
-     * @return Whether the proxy host can be used to fence the host 
successfully.
-     */
-    public boolean checkProxyHostConnectionToHost() {
-        return runFenceAction(FenceActionType.Status, 
FenceAgentOrder.Primary).getSucceeded();
-    }
-
-
-    /**
      * Run the specified fence action.
      * @param actionType The action to run.
      * @return The result of running the fence command.
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
index dbc30ef..8545142 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
@@ -118,13 +118,12 @@
                         :
                         
DbFacade.getInstance().getAuditLogDao().getTimeToWaitForNextPmOp(getVds().getName(),
 event);
                 if (secondsLeftToNextPmOp <= 0) {
-                    // try to get vds status
+                    // Check for proxy
                     executor = createExecutorForProxyCheck();
                     if (executor.findProxyHost()) {
-                        if (!(retValue = 
executor.checkProxyHostConnectionToHost())) {
-                            
addCanDoActionMessage(VdcBllMessages.VDS_FAILED_FENCE_VIA_PROXY_CONNECTION);
-                        }
-                    } else {
+                        retValue = true;
+                    }
+                    else {
                         
addCanDoActionMessage(VdcBllMessages.VDS_NO_VDS_PROXY_FOUND);
                     }
                 } else {
@@ -234,6 +233,11 @@
         if (getFenceSucceeded()) {
             executor = new FenceExecutor(getVds(), FenceActionType.Status);
             if (waitForStatus(getVds().getName(), 
getParameters().getAction(),FenceAgentOrder.Secondary)) {
+                // raise an alert that secondary agent was used
+                AuditLogableBase logable = new AuditLogableBase();
+                logable.setVdsId(getVds().getId());
+                logable.addCustomValue("Operation", 
getParameters().getAction().name());
+                AuditLogDirector.log(logable, 
AuditLogType.VDS_ALERT_SECONDARY_AGENT_USED_FOR_FENCE_OPERATION);
                 handleSpecificCommandActions();
             }
             else {
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 cc135ec..88e5524 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
@@ -661,6 +661,7 @@
     VDS_ALERT_FENCE_NO_PROXY_HOST(9004),
     VDS_ALERT_FENCE_STATUS_VERIFICATION_FAILED(9005),
     CANNOT_HIBERNATE_RUNNING_VMS_AFTER_CLUSTER_CPU_UPGRADE(9006),
+    VDS_ALERT_SECONDARY_AGENT_USED_FOR_FENCE_OPERATION(9007),
 
     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/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 c820e33..fdb7510 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
@@ -223,6 +223,7 @@
         severities.put(AuditLogType.VDS_ALERT_FENCE_OPERATION_FAILED, 
AuditLogSeverity.ALERT);
         severities.put(AuditLogType.VDS_ALERT_FENCE_OPERATION_SKIPPED, 
AuditLogSeverity.ALERT);
         
severities.put(AuditLogType.VDS_ALERT_FENCE_STATUS_VERIFICATION_FAILED, 
AuditLogSeverity.ALERT);
+        
severities.put(AuditLogType.VDS_ALERT_SECONDARY_AGENT_USED_FOR_FENCE_OPERATION, 
AuditLogSeverity.ALERT);
         severities.put(AuditLogType.VDS_RUN_IN_NO_KVM_MODE, 
AuditLogSeverity.ERROR);
         severities.put(AuditLogType.VDS_VERSION_NOT_SUPPORTED_FOR_CLUSTER, 
AuditLogSeverity.ERROR);
         severities.put(AuditLogType.VDS_CPU_LOWER_THAN_CLUSTER, 
AuditLogSeverity.WARNING);
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 f997356..3be9ebd 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -515,6 +515,7 @@
 VDS_ALERT_FENCE_OPERATION_SKIPPED=Host ${VdsName} became non-responsive. It 
has no power management configured. Please check the host status, manually 
reboot it, and click "Confirm Host Has Been Rebooted"
 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}
 TASK_STOPPING_ASYNC_TASK=Stopping async task ${CommandName} that started at 
${Date}
 REFRESH_REPOSITORY_FILE_LIST_FAILED=Failed to refresh the following Iso 
domains :${isoDomains}. Please check domain activity.
 REFRESH_REPOSITORY_FILE_LIST_SUCCEEDED=Succeeded to refresh Iso domain : 
${isoDomains}


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb5a3a8edeb58f74f0e74d3e54911f0cdb614762
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