GutoVeronezi commented on a change in pull request #4978:
URL: https://github.com/apache/cloudstack/pull/4978#discussion_r629568449



##########
File path: 
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/kvm/ha/KVMHostActivityChecker.java
##########
@@ -151,20 +203,33 @@ private boolean isVMActivtyOnHost(Host agent, DateTime 
suspectTime) throws HAChe
         if (agent.getHypervisorType() != Hypervisor.HypervisorType.KVM && 
agent.getHypervisorType() != Hypervisor.HypervisorType.LXC) {
             throw new IllegalStateException(String.format("Calling KVM 
investigator for non KVM Host of type [%s].", agent.getHypervisorType()));
         }
-        boolean activityStatus = true;
-        HashMap<StoragePool, List<Volume>> poolVolMap = 
getVolumeUuidOnHost(agent);
-        for (StoragePool pool : poolVolMap.keySet()) {
-            activityStatus = verifyActivityOfStorageOnHost(poolVolMap, pool, 
agent, suspectTime, activityStatus);
-            if (!activityStatus) {
-                LOG.warn(String.format("It seems that the storage pool [%s] 
does not have activity on %s.", pool.getId(), agent.toString()));
-                break;
+        boolean activityStatus = false;
+        if (isHostServedByNfsPool(agent)) {
+            HashMap<StoragePool, List<Volume>> poolVolMap = 
getVolumeUuidOnHost(agent);
+            for (StoragePool pool : poolVolMap.keySet()) {
+                if (Storage.StoragePoolType.NetworkFilesystem == 
pool.getPoolType() || Storage.StoragePoolType.ManagedNFS == pool.getPoolType()) 
{

Review comment:
       We could create a collection and verify if `contains` the pool type, 
like: 
   ```java
   private final Set<Storage.StoragePoolType> <insertNameHere> = new 
HashSet<>(Arrays.asList(Storage.StoragePoolType.NetworkFilesystem, 
Storage.StoragePoolType.ManagedNFS));
   ...
   if (<insertNameHere>.contains(pool.getPoolType())) {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to