bug 11122: Fix router startup

The new created router got hostId = 0.

status 11122: resolved fixed
This commit is contained in:
Sheng Yang 2011-08-13 00:08:21 -07:00 committed by alena
parent 5fcc2616a1
commit d1721669ea
1 changed files with 8 additions and 4 deletions

View File

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