bug 11105: Fix router with disconnected host

We keep the stopped router there, but continue with the ones we can use.

status bug 11105: resolved fixed
This commit is contained in:
Sheng Yang 2011-08-12 19:10:15 -07:00
parent 20e28d67bf
commit 70be9c6ed1
1 changed files with 7 additions and 4 deletions

View File

@ -1053,11 +1053,14 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
}
for (DomainRouterVO router : routers) {
State state = router.getState();
if (state != State.Running) {
router = startVirtualRouter(router, _accountService.getSystemUser(), _accountService.getSystemAccount(), params);
HostVO host = _hostDao.findById(router.getHostId());
if (host != null && host.getStatus() == Status.Up) {
State state = router.getState();
if (state != State.Running) {
router = startVirtualRouter(router, _accountService.getSystemUser(), _accountService.getSystemAccount(), params);
}
runningRouters.add(router);
}
runningRouters.add(router);
}
return runningRouters;
}