@Override protected void finalizeIpAssocForNetwork( final Commands cmds, final VirtualRouter domainRouterVO, final Provider provider, final Long guestNetworkId, final Map<String, String> vlanMacAddress) { if (domainRouterVO.getVpcId() == null) { super.finalizeIpAssocForNetwork( cmds, domainRouterVO, provider, guestNetworkId, vlanMacAddress); return; } if (domainRouterVO.getState() == State.Starting || domainRouterVO.getState() == State.Running) { final ArrayList<? extends PublicIpAddress> publicIps = getPublicIpsToApply(domainRouterVO, provider, guestNetworkId, IpAddress.State.Releasing); if (publicIps != null && !publicIps.isEmpty()) { s_logger.debug( "Found " + publicIps.size() + " ip(s) to apply as a part of domR " + domainRouterVO + " start."); // Re-apply public ip addresses - should come before PF/LB/VPN _commandSetupHelper.createVpcAssociatePublicIPCommands( domainRouterVO, publicIps, cmds, vlanMacAddress); } } }
@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 void finalizeStop(final VirtualMachineProfile profile, final Answer answer) { super.finalizeStop(profile, answer); // Mark VPN connections as Disconnected final DomainRouterVO router = _routerDao.findById(profile.getId()); final Long vpcId = router.getVpcId(); if (vpcId != null) { _s2sVpnMgr.markDisconnectVpnConnByVpc(vpcId); } }