Search in sources :

Example 1 with RouterInterfacesMap

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.RouterInterfacesMap in project netvirt by opendaylight.

the class NeutronvpnManager method createL3InternalVpn.

public void createL3InternalVpn(Uuid vpn, String name, Uuid tenant, List<String> rd, List<String> irt, List<String> ert, Uuid router, List<Uuid> networks) {
    IpVersionChoice ipVersChoices = neutronvpnUtils.getIpVersionChoicesFromRouterUuid(router);
    // Update VPN Instance node
    updateVpnInstanceNode(vpn, rd, irt, ert, VpnInstance.Type.L3, 0, /*l3vni*/
    ipVersChoices);
    // Update local vpn-subnet DS
    updateVpnMaps(vpn, name, router, tenant, networks);
    if (router != null) {
        Uuid existingVpn = neutronvpnUtils.getVpnForRouter(router, true);
        if (existingVpn != null) {
            // use case when a cluster is rebooted and router add DCN is received, triggering #createL3InternalVpn
            // if before reboot, router was already associated to VPN, should not proceed associating router to
            // internal VPN. Adding to RouterInterfacesMap is also not needed since it's a config DS and will be
            // preserved upon reboot.
            // For a non-reboot case #associateRouterToInternalVPN already takes care of adding to
            // RouterInterfacesMap via #createVPNInterface call.
            LOG.info("Associating router to Internal VPN skipped for VPN {} due to router {} already associated " + "to external VPN {}", vpn.getValue(), router.getValue(), existingVpn.getValue());
            return;
        }
        associateRouterToInternalVpn(vpn, router);
    }
}
Also used : Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) IpVersionChoice(org.opendaylight.netvirt.neutronvpn.api.enums.IpVersionChoice)

Aggregations

IpVersionChoice (org.opendaylight.netvirt.neutronvpn.api.enums.IpVersionChoice)1 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)1