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



##########
File path: 
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/kvm/ha/KVMHostActivityChecker.java
##########
@@ -81,7 +98,63 @@ public boolean isActive(Host r, DateTime suspectTime) throws 
HACheckerException
 
     @Override
     public boolean isHealthy(Host r) {
-        return isAgentActive(r);
+        boolean isHealthy = true;
+        boolean isHostServedByNfsPool = isHostServedByNfsPool(r);
+        boolean isKvmHaWebserviceEnabled = isKvmHaWebserviceEnabled(r);
+
+        isHealthy = isHealthViaNfs(r);
+
+        if (!isKvmHaWebserviceEnabled) {
+            return isHealthy;
+        }
+
+        //TODO
+
+
+        if (isVmActivtyOnHostViaKvmHaWebservice(r) && !isHealthy) {
+            isHealthy = true;
+        }
+
+        return isHealthy;
+    }
+
+    /**
+     * Checks the host health via an web-service that retrieves Running KVM 
instances via Libvirt. <br>
+     * The health-check is executed on the KVM node and verifies the amount of 
VMs running and if the Libvirt service is running.
+     */
+    private boolean isVmActivtyOnHostViaKvmHaWebservice(Host host) {
+        KvmHaAgentClient kvmHaAgentClient = new KvmHaAgentClient(host);
+        return kvmHaAgentClient.isKvmHaAgentHealthy(host, vmInstanceDao);
+    }
+
+    //TODO

Review comment:
       empty TODO comment ^^^




-- 
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