diff --git a/api/src/com/cloud/host/Status.java b/api/src/com/cloud/host/Status.java index 732a06617c9..73e6cc9185a 100755 --- a/api/src/com/cloud/host/Status.java +++ b/api/src/com/cloud/host/Status.java @@ -31,7 +31,8 @@ public enum Status { Alert(true, true, true), Removed(true, false, true), Error(true, false, true), - Rebalancing(true, false, true); + Rebalancing(true, false, true), + Unknown(false, false, false); // null private final boolean updateManagementServer; private final boolean checkManagementServer; diff --git a/server/src/com/cloud/ha/AbstractInvestigatorImpl.java b/server/src/com/cloud/ha/AbstractInvestigatorImpl.java index b222386bcb7..04343fc21bf 100755 --- a/server/src/com/cloud/ha/AbstractInvestigatorImpl.java +++ b/server/src/com/cloud/ha/AbstractInvestigatorImpl.java @@ -90,9 +90,9 @@ public abstract class AbstractInvestigatorImpl extends AdapterBase implements In Answer pingTestAnswer = _agentMgr.send(hostId, new PingTestCommand(testHostIp)); if (pingTestAnswer == null) { if (s_logger.isDebugEnabled()) { - s_logger.debug("host (" + testHostIp + ") returns null answer"); + s_logger.debug("host (" + testHostIp + ") returns Unknown (null) answer"); } - return Status.Alert; + return Status.Unknown; } if (pingTestAnswer.getResult()) { @@ -103,20 +103,20 @@ public abstract class AbstractInvestigatorImpl extends AdapterBase implements In return Status.Up; } else { if (s_logger.isDebugEnabled()) { - s_logger.debug("host (" + testHostIp + ") cannot be pinged, returning Alert state"); + s_logger.debug("host (" + testHostIp + ") cannot be pinged, returning Unknown (I don't know) state"); } - return Status.Alert; + return Status.Unknown; } } catch (AgentUnavailableException e) { if (s_logger.isDebugEnabled()) { - s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", returning Disconnected state"); + s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", trapped AgentUnavailableException returning Unknown state"); } - return Status.Disconnected; + return Status.Unknown; } catch (OperationTimedoutException e) { if (s_logger.isDebugEnabled()) { - s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", returning Alert state"); + s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", trapped OperationTimedoutException returning Unknown state"); } - return Status.Alert; + return Status.Unknown; } } } diff --git a/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java b/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java index 95e803f54ac..45912377c1b 100644 --- a/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java +++ b/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java @@ -78,7 +78,7 @@ public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl { List otherHosts = findHostByPod(vmHost.getPodId(), vm.getHostId()); for (Long otherHost : otherHosts) { Status vmState = testIpAddress(otherHost, nic.getIp4Address()); - if (vmState == null) { + if (vmState == null || vmState == Status.Unknown) { // can't get information from that host, try the next one continue; } @@ -91,7 +91,7 @@ public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl { // We can't ping the VM directly...if we can ping the host, then report the VM down. // If we can't ping the host, then we don't have enough information. Status vmHostState = testIpAddress(otherHost, vmHost.getPrivateIpAddress()); - if ((vmHostState != null) && (vmHostState == Status.Up)) { + if ((vmHostState != null) && (vmHostState != Status.Unknown) && (vmHostState == Status.Up)) { if (s_logger.isDebugEnabled()) { s_logger.debug("successfully pinged vm's host IP (" + vmHost.getPrivateIpAddress() + "), but could not ping VM, returning that the VM is down"); diff --git a/server/src/com/cloud/ha/UserVmDomRInvestigator.java b/server/src/com/cloud/ha/UserVmDomRInvestigator.java index d6f72790f93..48ee2836d88 100644 --- a/server/src/com/cloud/ha/UserVmDomRInvestigator.java +++ b/server/src/com/cloud/ha/UserVmDomRInvestigator.java @@ -121,7 +121,7 @@ public class UserVmDomRInvestigator extends AbstractInvestigatorImpl { s_logger.debug("sending ping from (" + hostId + ") to agent's host ip address (" + agent.getPrivateIpAddress() + ")"); } Status hostState = testIpAddress(hostId, agent.getPrivateIpAddress()); - if (hostState == null) { + if (hostState == null || hostState == Status.Unknown) { continue; } if (hostState == Status.Up) {