Uploaded image for project: 'netvirt'
  1. netvirt
  2. NETVIRT-821

VPN Interface for external network remains in Operational DS after network is deleted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • None
    • Carbon
    • General
    • None
    • Operating System: All
      Platform: All

    • 8930

      When deleting the external network, the VPNInterface isn't removed from the Operational DS. The VPNInterface is deleted in Config DS though.

      Steps:

      1) Stack fresh both Opendaylight and ODL

      2) Create external network:
      neutron net-create ext-net --router:external --provider:physical_network public --provider:network_type flat

      3) The VPNInterface is created in the Operational DS
      {
      "vpn-interfaces": {
      "vpn-interface": [

      { "dpn-id": 259602484679796, "name": "259602484679796:eth2:trunk", "scheduled-for-remove": false, "vpn-instance-name": "78cdc60a-1e9d-4f0b-8cf3-c51700f5e67e" }

      ]
      }
      }

      4) delete external network:

      neutron net-delete ext-net

      5) The VPNInterface remains in the Operational DS with attribute "scheduled-for-remove" is set to "true". It should be removed as well:

      "vpn-interfaces": {
      "vpn-interface": [

      { "dpn-id": 259602484679796, "name": "259602484679796:eth2:trunk", "scheduled-for-remove": true, "vpn-instance-name": "78cdc60a-1e9d-4f0b-8cf3-c51700f5e67e" }

      }

      This issue is similar to the NETVIRT-452 (which had been fixed) except for in this case the VPN interface belongs to the external network.

      The Op VPNInterface is cleaned up in the VRFEntryListener when the VRFEntry is removed from the Config DS. However, for external network is created without any router, there is no VRFEntry to be removed. Hence the OP VPNInterface is not removed.

      Consequently, if we recreate the same external network, in VPNInterfaceManager::processVpnInterfaceUp, the stale Op VPN interface is retrieved when checking if the associated VRFEntries have been removed. The stale OpVPNInterface doesn't have any adjacencies, and the error is thrown as in the below code snippets:

      VpnInterface opVpnInterface = VpnUtil.getOperationalVpnInterface(dataBroker, vpnInterface.getName());
      if (opVpnInterface != null) {
      String opVpnName = opVpnInterface.getVpnInstanceName();
      String primaryInterfaceIp = null;
      if (opVpnName.equals(vpnName)) {
      // Please check if the primary VRF Entry does not exist for VPNInterface
      // If so, we have to process ADD, as this might be a DPN Restart with Remove and Add triggered
      // back to back
      // However, if the primary VRF Entry for this VPNInterface exists, please continue bailing out !
      List<Adjacency> adjs = VpnUtil.getAdjacenciesForVpnInterfaceFromConfig(dataBroker, interfaceName);
      if (adjs == null) {
      LOG.error(
      "VPN Interface {} addition failed as adjacencies for this vpn interface could not be "
      + "obtained", interfaceName);
      return;
      }
      ~

            vinh.nguyen@hcl.com Vinh Nguyen
            vinh.nguyen@hcl.com Vinh Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: