Eli Mesika has uploaded a new change for review.

Change subject: core: fixing dual sequential PM scenario
......................................................................

core: fixing dual sequential PM scenario

In case that dual sequential power management cards are defined PM
operations attempt to use the first card (primary) first and only if that
failed attempt to use the second card (secondary).
When the primary card is not defined correctly the secondary PM fails to
take place.
This patch fixes this issue by insuring that we have a valid proxy host
prior to the secondary PM card operation.

Change-Id: Id88b22f06241c02f12dbc0efe32eb7f04063ed06
Bug-Url : https://bugzilla.redhat.com/show_bug.cgi?id=1013654
Signed-off-by: Eli Mesika <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
1 file changed, 23 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/74/21774/1

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 2b56d12..ecf5c93 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
@@ -222,10 +222,10 @@
                 } else {
                     // set the executor to perform the action
                     executor = new FenceExecutor(getVds(), 
getParameters().getAction());
-                    tryOtherSequentialAgent(lastStatus);
+                    tryOtherSequentialAgent(lastStatus, vdsReturnValue);
                 }
             } else {
-                tryOtherSequentialAgent(lastStatus);
+                tryOtherSequentialAgent(lastStatus, vdsReturnValue);
             }
         }
         else {
@@ -238,25 +238,32 @@
      * fence the Host via the secondary agent if primary fails
      * @param lastStatus
      */
-    private void tryOtherSequentialAgent(VDSStatus lastStatus) {
-        VDSReturnValue vdsReturnValue = 
executor.fence(FenceAgentOrder.Secondary);
-        setFenceSucceeded(vdsReturnValue.getSucceeded());
-        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();
+    private void tryOtherSequentialAgent(VDSStatus lastStatus, VDSReturnValue 
vdsReturnValue) {
+        executor = new FenceExecutor(getVds(), getParameters().getAction());
+        if (executor.findProxyHost()) {
+            vdsReturnValue = executor.fence(FenceAgentOrder.Secondary);
+            setFenceSucceeded(vdsReturnValue.getSucceeded());
+            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 {
+                    handleWaitFailure(lastStatus, FenceAgentOrder.Secondary);
+                }
             }
             else {
-                handleWaitFailure(lastStatus, FenceAgentOrder.Secondary);
+                handleError(lastStatus, vdsReturnValue, 
FenceAgentOrder.Secondary);
             }
         }
         else {
-            handleError(lastStatus, vdsReturnValue, FenceAgentOrder.Secondary);
+            setFenceSucceeded(false);
+            vdsReturnValue.setSucceeded(false);
         }
     }
 


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

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