@Override protected void finalizeNetworkRulesForNetwork( final Commands cmds, final DomainRouterVO domainRouterVO, final Provider provider, final Long guestNetworkId) { super.finalizeNetworkRulesForNetwork(cmds, domainRouterVO, provider, guestNetworkId); if (domainRouterVO.getVpcId() != null) { if (domainRouterVO.getState() == State.Starting || domainRouterVO.getState() == State.Running) { if (_networkModel.isProviderSupportServiceInNetwork( guestNetworkId, Service.NetworkACL, Provider.VPCVirtualRouter)) { final List<NetworkACLItemVO> networkACLs = _networkACLMgr.listNetworkACLItems(guestNetworkId); if (networkACLs != null && !networkACLs.isEmpty()) { s_logger.debug( "Found " + networkACLs.size() + " network ACLs to apply as a part of VPC VR " + domainRouterVO + " start for guest network id=" + guestNetworkId); _commandSetupHelper.createNetworkACLsCommands( networkACLs, domainRouterVO, cmds, guestNetworkId, false); } } } } }
@Override public boolean destroyPrivateGateway(final PrivateGateway gateway, final VirtualRouter router) throws ConcurrentOperationException, ResourceUnavailableException { if (!_networkModel.isVmPartOfNetwork(router.getId(), gateway.getNetworkId())) { s_logger.debug( "Router doesn't have nic for gateway " + gateway + " so no need to removed it"); return true; } final Network privateNetwork = _networkModel.getNetwork(gateway.getNetworkId()); s_logger.debug("Releasing private ip for gateway " + gateway + " from " + router); boolean result = setupVpcPrivateNetwork( router, false, _networkModel.getNicProfile(router, privateNetwork.getId(), null)); if (!result) { s_logger.warn("Failed to release private ip for gateway " + gateway + " on router " + router); return false; } // revoke network acl on the private gateway. if (!_networkACLMgr.revokeACLItemsForPrivateGw(gateway)) { s_logger.debug("Failed to delete network acl items on " + gateway + " from router " + router); return false; } s_logger.debug( "Removing router " + router + " from private network " + privateNetwork + " as a part of delete private gateway"); result = result && _itMgr.removeVmFromNetwork(router, privateNetwork, null); s_logger.debug("Private gateawy " + gateway + " is removed from router " + router); return result; }