Eli Mesika has uploaded a new change for review.

Change subject: core: Cannot confirm Host has been rebooted when..
......................................................................

core: Cannot confirm Host has been rebooted when..

Cannot confirm Host has been rebooted when having a single host in the system.

This patch removes the SPM Host mark in the DC in case that Host is
non-responsive and is the only Host in the DC.

This enables to put the Host in Maintenance and remove it if needed.

Two scenarios tested
1) Making the Host responsive again => Host is SPM back
2) Adding another Host => New Host is SPM

This patch is not handling the case in which the problematic Host has
running VMs, only the scenario reported in 6the BZ was handled

Change-Id: I8264d91d6dc5f33e4684d3bef86624b6f424a64b
Signed-off-by: Eli Mesika <emes...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=837539
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/FenceVdsManualyCommand.java
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/45/13045/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 60decd3..aec60a3 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
@@ -8,13 +8,14 @@
 import org.ovirt.engine.core.bll.LockIdNameAttribute;
 import org.ovirt.engine.core.bll.LockMessagesMatchUtil;
 import org.ovirt.engine.core.bll.job.ExecutionHandler;
-import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
+import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.FenceVdsManualyParameters;
 import org.ovirt.engine.core.common.action.VdcActionType;
 import org.ovirt.engine.core.common.action.VdsActionParameters;
 import org.ovirt.engine.core.common.businessentities.SpmStatusResult;
+import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.StorageDomainStatus;
 import org.ovirt.engine.core.common.businessentities.StorageDomainType;
 import org.ovirt.engine.core.common.businessentities.StoragePoolStatus;
@@ -22,7 +23,7 @@
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSStatus;
 import org.ovirt.engine.core.common.businessentities.VdsSpmStatus;
-import org.ovirt.engine.core.common.businessentities.StorageDomain;
+import org.ovirt.engine.core.common.businessentities.storage_pool;
 import org.ovirt.engine.core.common.utils.Pair;
 import 
org.ovirt.engine.core.common.vdscommands.FenceSpmStorageVDSCommandParameters;
 import org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters;
@@ -91,9 +92,17 @@
     @Override
     protected void executeCommand() {
         boolean result = true;
+        boolean isSingleHostInDC = 
getVdsDAO().getAllForStoragePool(getStoragePool().getId()).size() == 1;
         setVdsName(_problematicVds.getName());
         if (_problematicVds.getSpmStatus() == VdsSpmStatus.SPM) {
             result = ActivateDataCenter();
+            if (isSingleHostInDC) {
+                //reset SPM flag fot this Host
+                storage_pool sp = getStoragePool();
+                sp.setspm_vds_id(null);
+                getStoragePoolDAO().update(sp);
+                result = true;
+            }
         }
         if ((getParameters()).getClearVMs() && result) {
             VdsActionParameters tempVar = new 
VdsActionParameters(_problematicVds.getId());


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

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

Reply via email to