mirror of https://github.com/apache/cloudstack.git
KVM HA: Fix CheckOnHostAnswer success flag when there is no heartbeat (#13373)
This commit is contained in:
parent
9e8855a6f5
commit
4262c026d0
|
|
@ -55,7 +55,7 @@ public final class LibvirtCheckOnHostCommandWrapper extends CommandWrapper<Check
|
|||
if (hasHeartBeat) {
|
||||
return new CheckOnHostAnswer(command, true, "Heart is beating");
|
||||
} else {
|
||||
return new CheckOnHostAnswer(command, "Heart is not beating");
|
||||
return new CheckOnHostAnswer(command, false, "Heart is not beating");
|
||||
}
|
||||
} catch (final InterruptedException e) {
|
||||
return new CheckOnHostAnswer(command, "CheckOnHostCommand: can't get status of host: InterruptedException");
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ public class KVMHostActivityChecker extends AdapterBase implements ActivityCheck
|
|||
}
|
||||
|
||||
Status hostStatusFromNeighbour = checkHostStatusWithNeighbourHosts(host);
|
||||
logger.debug("{} status reported from itself: {} and neighbor: {}", host.toString(), hostStatusFromItself, hostStatusFromNeighbour);
|
||||
Status hostStatus = hostStatusFromItself;
|
||||
if (hostStatusFromNeighbour == Status.Up && (hostStatusFromItself == Status.Disconnected || hostStatusFromItself == Status.Down)) {
|
||||
hostStatus = Status.Disconnected;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ import javax.xml.xpath.XPathConstants;
|
|||
import javax.xml.xpath.XPathExpressionException;
|
||||
import javax.xml.xpath.XPathFactory;
|
||||
|
||||
import com.cloud.agent.api.CheckOnHostAnswer;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
|
|
@ -3130,7 +3131,9 @@ public class LibvirtComputingResourceTest {
|
|||
assertNotNull(wrapper);
|
||||
|
||||
final Answer answer = wrapper.execute(command, libvirtComputingResourceMock);
|
||||
assertFalse(answer.getResult());
|
||||
assertTrue(answer.getResult());
|
||||
assertTrue(answer instanceof CheckOnHostAnswer);
|
||||
assertFalse(((CheckOnHostAnswer)answer).isAlive());
|
||||
|
||||
verify(libvirtComputingResourceMock, times(1)).getMonitor();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5807,7 +5807,7 @@ public class VmwareResource extends ServerResourceBase implements StoragePoolRes
|
|||
}
|
||||
|
||||
protected Answer execute(CheckOnHostCommand cmd) {
|
||||
return new CheckOnHostAnswer(cmd, null, "Not Implmeneted");
|
||||
return new CheckOnHostAnswer(cmd, null, "Not Implemented");
|
||||
}
|
||||
|
||||
protected Answer execute(ModifySshKeysCommand cmd) {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,6 @@ public final class CitrixCheckOnHostCommandWrapper extends CommandWrapper<CheckO
|
|||
|
||||
@Override
|
||||
public Answer execute(final CheckOnHostCommand command, final CitrixResourceBase citrixResourceBase) {
|
||||
return new CheckOnHostAnswer(command, "Not Implmeneted");
|
||||
return new CheckOnHostAnswer(command, "Not Implemented");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue