DaanHoogland commented on code in PR #10059:
URL: https://github.com/apache/cloudstack/pull/10059#discussion_r1878229691


##########
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/kvm/ha/KVMHAProvider.java:
##########
@@ -75,28 +76,34 @@ public boolean recover(Host r) throws HARecoveryException {
                 final OutOfBandManagementResponse resp = 
outOfBandManagementService.executePowerOperation(r, PowerOperation.RESET, null);
                 return resp.getSuccess();
             } else {
-                LOG.warn("OOBM recover operation failed for the host " + 
r.getName());
+                logger.warn("OOBM recover operation failed for the host " + 
r.getName());
                 return false;
             }
         } catch (Exception e){
-            LOG.warn("OOBM service is not configured or enabled for this host 
" + r.getName() + " error is " + e.getMessage());
+            logger.warn("OOBM service is not configured or enabled for this 
host " + r.getName() + " error is " + e.getMessage());
             throw new HARecoveryException(" OOBM service is not configured or 
enabled for this host " + r.getName(), e);
         }
     }
 
     @Override
     public boolean fence(Host r) throws HAFenceException {
-
         try {
-            if (outOfBandManagementService.isOutOfBandManagementEnabled(r)){
-                final OutOfBandManagementResponse resp = 
outOfBandManagementService.executePowerOperation(r, PowerOperation.OFF, null);
-                return resp.getSuccess();
+            // host exists and is managed OOB
+            if (r != null && 
outOfBandManagementService.isOutOfBandManagementEnabled(r)) {
+                // check host status
+                if (Status.Down.equals(r.getStatus())) {

Review Comment:
   ok, it is not part of outOfBandManagementService. 



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to