rp- commented on code in PR #10059:
URL: https://github.com/apache/cloudstack/pull/10059#discussion_r1877991178
##########
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:
True what @slavkap said, and now I'm a bit confused what actual the original
issue was?
Wouldn't it be not just a noop if the host is already down and fence it
again?
--
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]