Moti Asayag has uploaded a new change for review.

Change subject: engine: Collect stats based on non-operational reason
......................................................................

engine: Collect stats based on non-operational reason

If a host become non-operational due to network
issue, the statistics will not be collected any
more. Therefore any attempt to activate the host
by the Auto-Recovery manager will be skipped.
Even if the network issue will be solved, the host
will remain non-operational unless activated by
the user.

This patch will allow to examine the cause for the non-
operational status and continue stats collection to
assure a network issue was solved and re-attempt to
activate the host.

Change-Id: I407d165e1cf13bbd1ba50811eaed4771c3f36f1a
Bug-Url: https://bugzilla.redhat.com/1070260
Signed-off-by: Moti Asayag <[email protected]>
---
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
2 files changed, 14 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/34/25234/1

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 311f553..ee62c8a 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
@@ -9,7 +9,7 @@
     GENERAL(1),
     CPU_TYPE_INCOMPATIBLE_WITH_CLUSTER(2),
     STORAGE_DOMAIN_UNREACHABLE(3),
-    NETWORK_UNREACHABLE(4),
+    NETWORK_UNREACHABLE(4, true),
     VERSION_INCOMPATIBLE_WITH_CLUSTER(5),
     KVM_NOT_RUNNING(6),
     TIMEOUT_RECOVERING_FROM_CRASH(7),
@@ -24,6 +24,7 @@
     ARCHITECTURE_INCOMPATIBLE_WITH_CLUSTER(16);
 
     private final int value;
+    private boolean collectStats;
 
     private static final Map<Integer, NonOperationalReason> valueMap = new 
HashMap<Integer, NonOperationalReason>(
             values().length);
@@ -38,10 +39,19 @@
         this.value = value;
     }
 
+    private NonOperationalReason(int value, boolean booleancollectStats) {
+        this(value);
+        this.collectStats = booleancollectStats;
+    }
+
     public int getValue() {
         return value;
     }
 
+    public boolean shouldCollectStats() {
+        return collectStats;
+    }
+
     public static NonOperationalReason forValue(int value) {
         return valueMap.get(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 6eca035..350dbec 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
@@ -36,8 +36,9 @@
 
     @Override
     public boolean isMonitoringNeeded(VDS vds) {
-        // No need to update the run-time info for hosts that don't run VMs
-        return (vds.getStatus() != VDSStatus.NonOperational || 
vds.getVmCount() > 0);
+        // 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());
     }
 
     @Override


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I407d165e1cf13bbd1ba50811eaed4771c3f36f1a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to