mirror of https://github.com/apache/cloudstack.git
Fix searchcritera2 in agent monitor
get ha code back in agent manager
This commit is contained in:
parent
ef02c05c8c
commit
5d661c1e9d
|
|
@ -925,12 +925,11 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
|
|||
}
|
||||
|
||||
handleDisconnectWithoutInvestigation(attache, event);
|
||||
/*TODO: call HA manager in monitors
|
||||
* host = _hostDao.findById(host.getId());
|
||||
if (!event.equals(Event.PrepareUnmanaged) && !event.equals(Event.HypervisorVersionChanged) && (host.getStatus() == Status.Alert || host.getStatus() == Status.Down)) {
|
||||
_haMgr.scheduleRestartForVmsOnHost(host, investigate);
|
||||
host = _hostDao.findById(host.getId());
|
||||
if (host.getStatus() == Status.Alert || host.getStatus() == Status.Down) {
|
||||
_haMgr.scheduleRestartForVmsOnHost(host, true);
|
||||
}
|
||||
* */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ public class AgentMonitor extends Thread implements Listener {
|
|||
SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
|
||||
sc.selectField(sc.getEntity().getResourceState());
|
||||
sc.addAnd(sc.getEntity().getId(), Op.EQ, agentId);
|
||||
HostVO h = sc.find();
|
||||
HostVO h = sc.list().get(0);
|
||||
ResourceState resourceState = h.getResourceState();
|
||||
if (resourceState == ResourceState.Disabled || resourceState == ResourceState.Maintenance || resourceState == ResourceState.Unmanaged || resourceState == ResourceState.ErrorInMaintenance) {
|
||||
/* Host is in non-operation state, so no investigation and direct put agent to Disconnected */
|
||||
|
|
|
|||
Loading…
Reference in New Issue