Search in sources :

Example 41 with ProviderTypes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ProviderTypes in project netvirt by opendaylight.

the class NeutronNetworkChangeListener method add.

@Override
protected void add(InstanceIdentifier<Network> identifier, Network input) {
    LOG.trace("Adding Network : key: {}, value={}", identifier, input);
    String networkId = input.getUuid().getValue();
    if (!NeutronvpnUtils.isNetworkTypeSupported(input)) {
        LOG.error("Neutronvpn doesn't support the provider type for given network {}", networkId);
        return;
    }
    Class<? extends NetworkTypeBase> networkType = input.getAugmentation(NetworkProviderExtension.class).getNetworkType();
    if (NeutronvpnUtils.isVlanOrVxlanNetwork(networkType) && NeutronUtils.getSegmentationIdFromNeutronNetwork(input, networkType) == null) {
        LOG.error("Segmentation ID is null for configured provider network {} of type {}. Abandoning any further " + "processing for the network", input.getUuid().getValue(), networkType);
        return;
    }
    neutronvpnUtils.addToNetworkCache(input);
    // Create ELAN instance for this network
    ElanInstance elanInstance = createElanInstance(input);
    if (NeutronvpnUtils.getIsExternal(input)) {
        // Create ELAN interface and IETF interfaces for the physical network
        elanService.createExternalElanNetwork(elanInstance);
        ProviderTypes providerNwType = NeutronvpnUtils.getProviderNetworkType(input);
        if (providerNwType == null) {
            LOG.error("Unable to get Network Provider Type for network {}", networkId);
            return;
        }
        LOG.trace("External Network Provider Type for network {} is {}", networkId, providerNwType.getName());
        nvpnNatManager.addExternalNetwork(input);
        if (NeutronvpnUtils.isFlatOrVlanNetwork(input)) {
            nvpnManager.createL3InternalVpn(input.getUuid(), null, null, null, null, null, null, null);
            nvpnManager.createExternalVpnInterfaces(input.getUuid());
        }
    }
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) ProviderTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ProviderTypes) NetworkProviderExtension(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.provider.ext.rev150712.NetworkProviderExtension)

Aggregations

Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)29 ProviderTypes (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ProviderTypes)29 BigInteger (java.math.BigInteger)19 ArrayList (java.util.ArrayList)13 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)8 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)8 Routers (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ext.routers.Routers)8 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)8 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)7 InstructionGotoTable (org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable)7 MatchTunnelId (org.opendaylight.genius.mdsalutil.matches.MatchTunnelId)7 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)7 Instruction (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction)7 CreateFibEntryInput (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fib.rpc.rev160121.CreateFibEntryInput)7 CreateFibEntryInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fib.rpc.rev160121.CreateFibEntryInputBuilder)7 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)6 List (java.util.List)6 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)6 ActionNxResubmit (org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit)6 Optional (com.google.common.base.Optional)5