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());
}
}
}
Aggregations