Moti Asayag has uploaded a new change for review.

Change subject: engine: Collect stats before activating host
......................................................................

engine: Collect stats before activating host

If the non-operational reason of a host is a nic
failed state, the host statistics will be collected
again and examined before attempting to activate
the host.

Change-Id: Id3de8a3ccb1084f8be8f9c3213f797146f8f0b36
Bug-Url: https://bugzilla.redhat.com/1070260
Signed-off-by: Moti Asayag <masa...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AutoRecoveryManager.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
3 files changed, 10 insertions(+), 13 deletions(-)


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

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AutoRecoveryManager.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AutoRecoveryManager.java
index 4eb0c96..68131ce 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AutoRecoveryManager.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AutoRecoveryManager.java
@@ -10,11 +10,14 @@
 import org.ovirt.engine.core.common.action.VdcActionType;
 import org.ovirt.engine.core.common.action.VdsActionParameters;
 import org.ovirt.engine.core.common.businessentities.BusinessEntity;
+import org.ovirt.engine.core.common.businessentities.NonOperationalReason;
 import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.config.Config;
 import org.ovirt.engine.core.common.config.ConfigValues;
 import org.ovirt.engine.core.common.utils.Pair;
+import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
+import 
org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase;
 import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.dal.dbbroker.DbFacade;
 import org.ovirt.engine.core.dao.AutoRecoverDAO;
@@ -71,6 +74,11 @@
                         List<VDS> filtered = new ArrayList<>(list.size());
 
                         for (VDS vds : list) {
+                            if (vds.getNonOperationalReason() == 
NonOperationalReason.NETWORK_INTERFACE_IS_DOWN) {
+                                
getBackend().getResourceManager().RunVdsCommand(VDSCommandType.GetStats,
+                                        new 
VdsIdAndVdsVDSCommandParametersBase(vds));
+                            }
+
                             Pair<List<String>, List<String>> problematicNics =
                                     
VdsUpdateRunTimeInfo.determineProblematicNics(getDbFacade().getInterfaceDao()
                                             
.getAllInterfacesForVds(vds.getId()), getDbFacade().getNetworkDao()
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
index ca53003..adda7f1 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
@@ -22,10 +22,9 @@
     CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER(14),
     GLUSTER_HOST_UUID_ALREADY_EXISTS(15),
     ARCHITECTURE_INCOMPATIBLE_WITH_CLUSTER(16),
-    NETWORK_INTERFACE_IS_DOWN(17, true);
+    NETWORK_INTERFACE_IS_DOWN(17);
 
     private final int value;
-    private boolean collectStats;
 
     private static final Map<Integer, NonOperationalReason> valueMap = new 
HashMap<Integer, NonOperationalReason>(
             values().length);
@@ -40,17 +39,8 @@
         this.value = value;
     }
 
-    private NonOperationalReason(int value, boolean collectStats) {
-        this(value);
-        this.collectStats = collectStats;
-    }
-
     public int getValue() {
         return value;
-    }
-
-    public boolean shouldCollectStats() {
-        return collectStats;
     }
 
     public static NonOperationalReason forValue(int value) {
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
index fbdbd5e..96fa3a2 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
@@ -37,8 +37,7 @@
     @Override
     public boolean isMonitoringNeeded(VDS vds) {
         // No need to update the run-time info for hosts that don't run VMs, 
depends on the non-operational reason
-        return vds.getStatus() != VDSStatus.NonOperational || vds.getVmCount() 
> 0
-                || (vds.getNonOperationalReason() != null && 
vds.getNonOperationalReason().shouldCollectStats());
+        return vds.getStatus() != VDSStatus.NonOperational || vds.getVmCount() 
> 0;
     }
 
     @Override


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

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

Reply via email to