Omer Frenkel has uploaded a new change for review.

Change subject: core: don't migrate vms if host can't recover (#851840)
......................................................................

core: don't migrate vms if host can't recover (#851840)

https://bugzilla.redhat.com/show_bug.cgi?id=851840

if host moved to non-operational because it failed to recover
(recovery timeout passed)
there is no point in sending migrate for the vms,
as migrate command to the host would fail with same recovery error.

Change-Id: I9616436386ee03a68ba25efa57abd2ac90e7bc9b
Signed-off-by: Omer Frenkel <ofren...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
1 file changed, 13 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/38/7638/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
index 8d525c0..d77da13 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
@@ -8,9 +8,9 @@
 import org.ovirt.engine.core.common.businessentities.VDSStatus;
 import 
org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters;
 import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
+import org.ovirt.engine.core.dal.VdcBllMessages;
 import org.ovirt.engine.core.utils.log.Log;
 import org.ovirt.engine.core.utils.log.LogFactory;
-import org.ovirt.engine.core.dal.VdcBllMessages;
 import org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil;
 
 /**
@@ -35,20 +35,24 @@
                                     
getParameters().getNonOperationalReason()));
         }
 
-        ThreadPoolUtil.execute(new Runnable() {
-            @Override
-            public void run() {
-                // migrate vms according to cluster migrateOnError option
-                switch (getVdsGroup().getMigrateOnError()) {
+        // if host failed to recover, no point in sending migrate, as it would 
fail.
+        if (getParameters().getNonOperationalReason() != 
NonOperationalReason.TIMEOUT_RECOVERING_FROM_CRASH)
+        {
+            ThreadPoolUtil.execute(new Runnable() {
+                @Override
+                public void run() {
+                    // migrate vms according to cluster migrateOnError option
+                    switch (getVdsGroup().getMigrateOnError()) {
                     case YES:
                         MigrateAllVms(getExecutionContext());
                         break;
                     case HA_ONLY:
-                        MigrateAllVms(getExecutionContext(),true);
+                        MigrateAllVms(getExecutionContext(), true);
                         break;
+                    }
                 }
-            }
-        });
+            });
+        }
 
         if (getParameters().getNonOperationalReason() == 
NonOperationalReason.NETWORK_UNREACHABLE) {
             log.infoFormat("Host '{0}' is set to Non-Operational, it is 
missing the following networks: '{1}'",


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9616436386ee03a68ba25efa57abd2ac90e7bc9b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Omer Frenkel <ofren...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to