List<NicVO> nics = _nicDao.listByVmId(routerId);
for (NicVO nic : nics) {
if (!_networkMgr.startNetwork(nic.getNetworkId(), dest, context)) {
s_logger.warn("Failed to start network id=" + nic.getNetworkId() + " as a part of domR start");
throw new CloudRuntimeException("Failed to start network id=" + nic.getNetworkId() + " as a part of domR start");
}
}
UserVO user = _userDao.findById(UserContext.current().getCallerUserId());
Map<Param, Object> params = new HashMap<Param, Object>();
if (reprogramNetwork) {
params.put(Param.ReProgramGuestNetworks, true);
} else {
params.put(Param.ReProgramGuestNetworks, false);
}
VirtualRouter virtualRouter = startVirtualRouter(router, user, caller, params);
if(virtualRouter == null){
throw new CloudRuntimeException("Failed to start router with id " + routerId);
}
return virtualRouter;
}