Search in sources :

Example 21 with Status

use of com.cloud.host.Status in project cloudstack by apache.

the class CheckOnHostCommandTest method testGetState.

@Test
public void testGetState() {
    Status s = host.getState();
    assertTrue(s == Status.Up);
}
Also used : Status(com.cloud.host.Status) Test(org.junit.Test)

Example 22 with Status

use of com.cloud.host.Status in project cloudstack by apache.

the class CheckOnHostCommandTest method testGetStatus.

@Test
public void testGetStatus() {
    Status s = host.getStatus();
    assertTrue(s == Status.Up);
}
Also used : Status(com.cloud.host.Status) Test(org.junit.Test)

Example 23 with Status

use of com.cloud.host.Status in project cloudstack by apache.

the class HighAvailabilityManagerImpl method investigate.

@Override
public Status investigate(final long hostId) {
    final HostVO host = _hostDao.findById(hostId);
    if (host == null) {
        return Status.Alert;
    }
    Status hostState = null;
    for (Investigator investigator : investigators) {
        hostState = investigator.isAgentAlive(host);
        if (hostState != null) {
            if (s_logger.isDebugEnabled()) {
                s_logger.debug(investigator.getName() + " was able to determine host " + hostId + " is in " + hostState.toString());
            }
            return hostState;
        }
        if (s_logger.isDebugEnabled()) {
            s_logger.debug(investigator.getName() + " unable to determine the state of the host.  Moving on.");
        }
    }
    return hostState;
}
Also used : Status(com.cloud.host.Status) HostVO(com.cloud.host.HostVO)

Aggregations

Status (com.cloud.host.Status)23 HostVO (com.cloud.host.HostVO)14 Answer (com.cloud.agent.api.Answer)9 NoTransitionException (com.cloud.utils.fsm.NoTransitionException)7 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)6 AgentControlAnswer (com.cloud.agent.api.AgentControlAnswer)5 PingAnswer (com.cloud.agent.api.PingAnswer)4 ReadyAnswer (com.cloud.agent.api.ReadyAnswer)4 StartupAnswer (com.cloud.agent.api.StartupAnswer)4 UnsupportedAnswer (com.cloud.agent.api.UnsupportedAnswer)4 ConnectionException (com.cloud.exception.ConnectionException)4 Host (com.cloud.host.Host)4 CheckOnHostCommand (com.cloud.agent.api.CheckOnHostCommand)3 AgentUnavailableException (com.cloud.exception.AgentUnavailableException)3 OperationTimedoutException (com.cloud.exception.OperationTimedoutException)3 Nic (com.cloud.vm.Nic)3 Test (org.junit.Test)3 AgentManager (com.cloud.agent.AgentManager)2 CheckHealthCommand (com.cloud.agent.api.CheckHealthCommand)2 Command (com.cloud.agent.api.Command)2