import org.opendaylight.ovsdb.lib.table.Bridge;
import org.opendaylight.ovsdb.lib.table.Interface;
import org.opendaylight.ovsdb.lib.table.Port;
-import org.opendaylight.ovsdb.lib.table.internal.Table;
+import org.opendaylight.ovsdb.lib.table.Table;
import org.opendaylight.ovsdb.neutron.AdminConfigManager;
import org.opendaylight.ovsdb.neutron.InternalNetworkManager;
import org.opendaylight.ovsdb.neutron.TenantNetworkManager;
}
if (!InternalNetworkManager.getManager().isInternalNetworkOverlayReady(node)) {
- logger.error(node+" is not Overlay ready");
+ logger.warn("{} is not Overlay ready. It might be an OpenStack Controller Node", node);
return new Status(StatusCode.NOTACCEPTABLE, node+" is not Overlay ready");
}
if (tunIntf.getName().equals(this.getTunnelName(tunnelType, segmentationId, dst))) {
Set<BigInteger> of_ports = tunIntf.getOfport();
if (of_ports == null || of_ports.size() <= 0) {
- logger.error("Could NOT Identify Tunnel port {} on {}", tunIntf.getName(), node);
+ logger.warn("Could not Identify Tunnel port {} on {}. Don't panic. It might get converged soon...", tunIntf.getName(), node);
continue;
}
int tunnelOFPort = Long.valueOf(((BigInteger)of_ports.toArray()[0]).longValue()).intValue();
if (tunnelOFPort == -1) {
- logger.error("Could NOT Identify Tunnel port {} -> OF ({}) on {}", tunIntf.getName(), tunnelOFPort, node);
+ logger.warn("Tunnel Port {} on node {}: OFPort = -1 . Don't panic. It might get converged soon...", tunIntf.getName(), node);
return;
}
logger.debug("Identified Tunnel port {} -> OF ({}) on {}", tunIntf.getName(), tunnelOFPort, node);
}
@Override
- public Status deleteTunnels(String tunnelType, String tunnelKey, Node srcNode, Interface intf) {
+ public Status handleInterfaceDelete(String tunnelType, String tunnelKey, Node srcNode, Interface intf, boolean isLastInstanceOnNode) {
+ Status status = new Status(StatusCode.SUCCESS);
+
IConnectionServiceInternal connectionService = (IConnectionServiceInternal)ServiceHelper.getGlobalInstance(IConnectionServiceInternal.class, this);
List<Node> nodes = connectionService.getNodes();
nodes.remove(srcNode);
for (Node dstNode : nodes) {
- Status status;
InetAddress src = AdminConfigManager.getManager().getTunnelEndPoint(srcNode);
InetAddress dst = AdminConfigManager.getManager().getTunnelEndPoint(dstNode);
this.removeTunnelRules(tunnelType, tunnelKey, dst, srcNode, intf, true);
- status = deleteTunnelPort(srcNode, tunnelType, src, dst, tunnelKey);
+ if (isLastInstanceOnNode) {
+ status = deleteTunnelPort(srcNode, tunnelType, src, dst, tunnelKey);
+ }
this.removeTunnelRules(tunnelType, tunnelKey, src, dstNode, intf, false);
- if (status.isSuccess()) {
+ if (status.isSuccess() && isLastInstanceOnNode) {
deleteTunnelPort(dstNode, tunnelType, dst, src, tunnelKey);
}
}
- return new Status(StatusCode.SUCCESS);
+ return status;
}
private String getTunnelName(String tunnelType, String key, InetAddress dst) {
String tunnelPortUUID = this.getTunnelPortUuid(node, portName, bridgeUUID);
Status status = ovsdbTable.deleteRow(node, Port.NAME.getName(), tunnelPortUUID);
if (!status.isSuccess()) {
- logger.error("Failed to delete Tunnel port {} in {}", portName, bridgeUUID);
+ logger.error("Failed to delete Tunnel port {} in {} status : {}", portName, bridgeUUID, status);
return status;
}
private void initializeFlowRules(Node node, String bridgeName) {
String brIntId = this.getInternalBridgeUUID(node, bridgeName);
if (brIntId == null) {
- logger.error("Failed to initialize Flow Rules for {}", node);
+ if (bridgeName == AdminConfigManager.getManager().getExternalBridgeName()){
+ logger.debug("Failed to initialize Flow Rules for bridge {} on node {}. Is the Neutron L3 agent running on this node?");
+ }
+ else {
+ logger.debug("Failed to initialize Flow Rules for bridge {} on node {}", bridgeName, node);
+ }
return;
}