CreateLogicalRouterCommand cmd =
new CreateLogicalRouterCommand(niciraNvpHost.getDetail("l3gatewayserviceuuid"), vlanid, BroadcastDomainType.getValue(network.getBroadcastUri()),
"router-" + network.getDisplayText(), publicCidr, sourceNatIp.getGateway(), internalCidr, context.getDomain().getName() + "-" +
context.getAccount().getAccountName());
CreateLogicalRouterAnswer answer = (CreateLogicalRouterAnswer)_agentMgr.easySend(niciraNvpHost.getId(), cmd);
if (answer.getResult() == false) {
s_logger.error("Failed to create Logical Router for network "
+ network.getDisplayText());
return false;
}
// Store the uuid so we can easily find it during cleanup
NiciraNvpRouterMappingVO routermapping =
new NiciraNvpRouterMappingVO(answer.getLogicalRouterUuid(), network.getId());
_niciraNvpRouterMappingDao.persist(routermapping);
}
return true;
}