CORD-129 Support access agent in VTN
- Add ACCESS_AGENT type instance based on the access agent location
- Populate flow rules to provider L2 connectivity with OLTs
- Don't check "tap" port name prefix considering container instance
- Changed table name ACCESS_TYPE to ACCESS, DST_IP to DST
Change-Id: I3854f94d371243cde3b1ca1ecfbfb68ef53e0759
diff --git a/src/main/java/org/opencord/cordvtn/impl/CordVtnNodeManager.java b/src/main/java/org/opencord/cordvtn/impl/CordVtnNodeManager.java
index 1926f03..82bb0a9 100644
--- a/src/main/java/org/opencord/cordvtn/impl/CordVtnNodeManager.java
+++ b/src/main/java/org/opencord/cordvtn/impl/CordVtnNodeManager.java
@@ -431,7 +431,8 @@
// adds existing instances to the host list
deviceService.getPorts(node.integrationBridgeId()).stream()
- .filter(port -> portName(port).startsWith(VPORT_PREFIX) &&
+ .filter(port -> !node.systemIfaces().contains(portName(port)) &&
+ !port.number().equals(PortNumber.LOCAL) &&
port.isEnabled())
.forEach(port -> instanceService.addInstance(connectPoint(port)));
@@ -752,14 +753,12 @@
log.info("Port {} is added to {}", portName, node.hostname());
- if (portName.startsWith(VPORT_PREFIX)) {
- if (isNodeStateComplete(node)) {
- instanceService.addInstance(connectPoint(port));
- } else {
- log.warn("VM is detected on incomplete node, ignore it.", portName);
- }
- } else if (node.systemIfaces().contains(portName)) {
+ if (node.systemIfaces().contains(portName)) {
setNodeState(node, getNodeState(node));
+ } else if (isNodeStateComplete(node)) {
+ instanceService.addInstance(connectPoint(port));
+ } else {
+ log.warn("Instance is detected on incomplete node, ignore it.", portName);
}
}
@@ -780,14 +779,12 @@
log.info("Port {} is removed from {}", portName, node.hostname());
- if (portName.startsWith(VPORT_PREFIX)) {
- if (isNodeStateComplete(node)) {
- instanceService.removeInstance(connectPoint(port));
- } else {
- log.warn("VM is vanished from incomplete node, ignore it.", portName);
- }
- } else if (node.systemIfaces().contains(portName)) {
+ if (node.systemIfaces().contains(portName)) {
setNodeState(node, NodeState.INCOMPLETE);
+ } else if (isNodeStateComplete(node)) {
+ instanceService.removeInstance(connectPoint(port));
+ } else {
+ log.warn("VM is vanished from incomplete node, ignore it.", portName);
}
}
}