use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project netvirt by opendaylight.
the class NeutronSubnetChangeListener method remove.
@Override
public void remove(InstanceIdentifier<Subnet> identifier, Subnet input) {
LOG.trace("Removing subnet : key: {}, value={}", identifier, input);
Uuid networkId = input.getNetworkId();
Uuid subnetId = input.getUuid();
Network network = neutronvpnUtils.getNeutronNetwork(networkId);
handleNeutronSubnetDeleted(subnetId, networkId, input.getCidr().stringValue());
if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) {
LOG.warn("neutron vpn received a subnet remove() for a network without a provider extension augmentation " + "or with an unsupported network type for the subnet {} which is part of network {}", subnetId.getValue(), network);
} else {
externalSubnetHandler.handleExternalSubnetRemoved(network, subnetId);
}
neutronvpnUtils.removeFromSubnetCache(input);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project netvirt by opendaylight.
the class NeutronSubnetChangeListener method add.
@Override
public void add(InstanceIdentifier<Subnet> identifier, Subnet input) {
LOG.trace("Adding Subnet : key: {}, value={}", identifier, input);
Uuid networkId = input.getNetworkId();
Uuid subnetId = input.getUuid();
Network network = neutronvpnUtils.getNeutronNetwork(networkId);
if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) {
LOG.warn("neutron vpn received a subnet add() for a network without a provider extension augmentation " + "or with an unsupported network type for the subnet {} which is part of network {}", subnetId.getValue(), network);
return;
}
neutronvpnUtils.addToSubnetCache(input);
handleNeutronSubnetCreated(input, network);
externalSubnetHandler.handleExternalSubnetAdded(network, subnetId, null);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project netvirt by opendaylight.
the class NeutronPortChangeListener method remove.
@Override
public void remove(InstanceIdentifier<Port> identifier, Port input) {
LOG.trace("Removing Port : key: {}, value={}", identifier, input);
Network network = neutronvpnUtils.getNeutronNetwork(input.getNetworkId());
// network from NN returns null, but the deletion process for port needs to continue
if (network != null && !NeutronvpnUtils.isNetworkTypeSupported(network)) {
String portName = input.getUuid().getValue();
LOG.warn("neutron vpn received a port remove() for a network without a provider extension augmentation " + "or with an unsupported network type for the port {} which is part of network {}", portName, network);
return;
}
neutronvpnUtils.removeFromPortCache(input);
NeutronUtils.deletePortStatus(input.getUuid().getValue(), dataBroker);
if (!Strings.isNullOrEmpty(input.getDeviceOwner()) && !Strings.isNullOrEmpty(input.getDeviceId())) {
if (NeutronConstants.DEVICE_OWNER_ROUTER_INF.equals(input.getDeviceOwner())) {
handleRouterInterfaceRemoved(input);
/* nothing else to do here */
return;
} else if (NeutronConstants.DEVICE_OWNER_GATEWAY_INF.equals(input.getDeviceOwner()) || NeutronConstants.DEVICE_OWNER_FLOATING_IP.equals(input.getDeviceOwner())) {
handleRouterGatewayUpdated(input, true);
elanService.removeKnownL3DmacAddress(input.getMacAddress().getValue(), input.getNetworkId().getValue());
}
}
if (input.getFixedIps() != null) {
handleNeutronPortDeleted(input);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project netvirt by opendaylight.
the class NeutronPortChangeListener method add.
@Override
public void add(InstanceIdentifier<Port> identifier, Port input) {
LOG.trace("Received port add event: port={}", input);
String portName = input.getUuid().getValue();
LOG.trace("Adding Port : key: {}, value={}", identifier, input);
Network network = neutronvpnUtils.getNeutronNetwork(input.getNetworkId());
if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) {
LOG.warn("neutron vpn received a port add() for a network without a provider extension augmentation " + "or with an unsupported network type for the port {} which is part of network {}", portName, network);
return;
}
neutronvpnUtils.addToPortCache(input);
String portStatus = NeutronUtils.PORT_STATUS_DOWN;
if (!Strings.isNullOrEmpty(input.getDeviceOwner()) && !Strings.isNullOrEmpty(input.getDeviceId())) {
if (NeutronConstants.DEVICE_OWNER_ROUTER_INF.equals(input.getDeviceOwner())) {
handleRouterInterfaceAdded(input);
NeutronUtils.createPortStatus(input.getUuid().getValue(), NeutronUtils.PORT_STATUS_ACTIVE, dataBroker);
return;
}
if (NeutronConstants.DEVICE_OWNER_GATEWAY_INF.equals(input.getDeviceOwner())) {
handleRouterGatewayUpdated(input, false);
portStatus = NeutronUtils.PORT_STATUS_ACTIVE;
} else if (NeutronConstants.DEVICE_OWNER_FLOATING_IP.equals(input.getDeviceOwner())) {
handleFloatingIpPortUpdated(null, input);
portStatus = NeutronUtils.PORT_STATUS_ACTIVE;
}
}
// in order to validate the supported vnic types from the hostconfig
if (input.getFixedIps() != null && !input.getFixedIps().isEmpty() && (!isPortTypeSwitchdev(input) || isPortBound(input))) {
handleNeutronPortCreated(input);
}
NeutronUtils.createPortStatus(input.getUuid().getValue(), portStatus, dataBroker);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project netvirt by opendaylight.
the class NeutronvpnManager method createL3InternalVpn.
public void createL3InternalVpn(Uuid vpnId, String name, Uuid tenantId, List<String> rdList, List<String> irtList, List<String> ertList, Uuid routerId, List<Uuid> networksList) {
IpVersionChoice ipVersChoices = neutronvpnUtils.getIpVersionChoicesFromRouterUuid(routerId);
// Update VPN Instance node
updateVpnInstanceNode(vpnId, rdList, irtList, ertList, false, /*isL2Vpn*/
0, /*l3vni*/
ipVersChoices);
// Update local vpn-subnet DS
updateVpnMaps(vpnId, name, routerId, tenantId, networksList);
if (routerId != null) {
Uuid existingVpn = neutronvpnUtils.getVpnForRouter(routerId, 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 {}", vpnId.getValue(), routerId.getValue(), existingVpn.getValue());
return;
}
associateRouterToInternalVpn(vpnId, routerId);
}
}
Aggregations