use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project genius by opendaylight.
the class HwVTEPInterfaceStateUpdateHelper method startBfdMonitoring.
public static List<ListenableFuture<Void>> startBfdMonitoring(ManagedNewTransactionRunner txRunner, InstanceIdentifier<Tunnels> tunnelsInstanceIdentifier, Tunnels tunnelsNew) {
LOG.debug("starting bfd monitoring for the hwvtep {}", tunnelsInstanceIdentifier);
TunnelsBuilder tunnelsBuilder = new TunnelsBuilder();
tunnelsBuilder.setKey(new TunnelsKey(tunnelsNew.getLocalLocatorRef(), tunnelsNew.getRemoteLocatorRef()));
tunnelsBuilder.setLocalLocatorRef(tunnelsNew.getLocalLocatorRef());
tunnelsBuilder.setRemoteLocatorRef(tunnelsNew.getLocalLocatorRef());
List<BfdParams> bfdParams = new ArrayList<>();
SouthboundUtils.fillBfdParameters(bfdParams, null);
tunnelsBuilder.setBfdParams(bfdParams);
return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.put(LogicalDatastoreType.CONFIGURATION, tunnelsInstanceIdentifier, tunnelsBuilder.build(), WriteTransaction.CREATE_MISSING_PARENTS)));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project genius by opendaylight.
the class SouthboundUtils method createTunnelsInstanceIdentifier.
public static InstanceIdentifier<Tunnels> createTunnelsInstanceIdentifier(InstanceIdentifier<Node> nodeId, InstanceIdentifier<TerminationPoint> localTEPInstanceIdentifier, InstanceIdentifier<TerminationPoint> remoteTEPInstanceIdentifier) {
TunnelsKey tunnelsKey = new TunnelsKey(new HwvtepPhysicalLocatorRef(localTEPInstanceIdentifier), new HwvtepPhysicalLocatorRef(remoteTEPInstanceIdentifier));
InstanceIdentifier<Tunnels> tunnelInstanceId = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(HWVTEP_TOPOLOGY_ID)).child(Node.class, new NodeKey(nodeId.firstKeyOf(Node.class))).augmentation(PhysicalSwitchAugmentation.class).child(Tunnels.class, tunnelsKey).build();
return tunnelInstanceId;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project genius by opendaylight.
the class OvsInterfaceConfigUpdateHelper method handleTunnelMonitorUpdates.
/*
* if the tunnel monitoring attributes have changed, handle it based on the
* tunnel type. As of now internal vxlan tunnels use LLDP monitoring and
* external tunnels use BFD monitoring.
*/
private void handleTunnelMonitorUpdates(WriteTransaction transaction, Interface interfaceNew, Interface interfaceOld) {
LOG.debug("tunnel monitoring attributes modified for interface {}", interfaceNew.getName());
// update termination point on switch, if switch is connected
BridgeRefEntry bridgeRefEntry = interfaceMetaUtils.getBridgeReferenceForInterface(interfaceNew);
IfTunnel ifTunnel = interfaceNew.getAugmentation(IfTunnel.class);
if (SouthboundUtils.isMonitorProtocolBfd(ifTunnel) && interfaceMetaUtils.bridgeExists(bridgeRefEntry)) {
SouthboundUtils.updateBfdParamtersForTerminationPoint(bridgeRefEntry.getBridgeReference().getValue(), interfaceNew.getAugmentation(IfTunnel.class), interfaceNew.getName(), transaction);
} else {
// update lldp tunnel monitoring attributes for an internal vxlan
// tunnel interface
alivenessMonitorUtils.handleTunnelMonitorUpdates(interfaceOld, interfaceNew);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project genius by opendaylight.
the class InterfaceInventoryStateListener method update.
@Override
protected void update(InstanceIdentifier<FlowCapableNodeConnector> key, FlowCapableNodeConnector fcNodeConnectorOld, FlowCapableNodeConnector fcNodeConnectorNew) {
if (interfacemgrProvider.isItmDirectTunnelsEnabled() && interfaceManagerCommonUtils.isTunnelInternal(fcNodeConnectorNew.getName())) {
LOG.debug("ITM Direct Tunnels is enabled, ignoring node connector Update for internal tunnel {}", fcNodeConnectorNew.getName());
return;
}
if (!entityOwnershipUtils.isEntityOwner(IfmConstants.INTERFACE_CONFIG_ENTITY, IfmConstants.INTERFACE_CONFIG_ENTITY)) {
return;
}
LOG.debug("Received NodeConnector Update Event: {}, {}, {}", key, fcNodeConnectorOld, fcNodeConnectorNew);
NodeConnectorId nodeConnectorId = InstanceIdentifier.keyOf(key.firstIdentifierOf(NodeConnector.class)).getId();
String portName = InterfaceManagerCommonUtils.getPortNameForInterface(nodeConnectorId, fcNodeConnectorNew.getName());
InterfaceStateUpdateWorker portStateUpdateWorker = new InterfaceStateUpdateWorker(key, fcNodeConnectorOld, fcNodeConnectorNew, portName);
coordinator.enqueueJob(portName, portStateUpdateWorker, IfmConstants.JOB_MAX_RETRIES);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project genius by opendaylight.
the class InterfaceInventoryStateListener method add.
@Override
protected void add(InstanceIdentifier<FlowCapableNodeConnector> key, FlowCapableNodeConnector fcNodeConnectorNew) {
if (interfacemgrProvider.isItmDirectTunnelsEnabled() && interfaceManagerCommonUtils.isTunnelInternal(fcNodeConnectorNew.getName())) {
LOG.debug("ITM Direct Tunnels is enabled, ignoring node connector add for internal tunnel {}", fcNodeConnectorNew.getName());
return;
}
if (!entityOwnershipUtils.isEntityOwner(IfmConstants.INTERFACE_CONFIG_ENTITY, IfmConstants.INTERFACE_CONFIG_ENTITY)) {
return;
}
LOG.debug("Received NodeConnector Add Event: {}, {}", key, fcNodeConnectorNew);
NodeConnectorId nodeConnectorId = InstanceIdentifier.keyOf(key.firstIdentifierOf(NodeConnector.class)).getId();
LOG.trace("Adding entry for portid {} portname {} in map", nodeConnectorId.getValue(), fcNodeConnectorNew.getName());
portNameCache.put(nodeConnectorId.getValue(), fcNodeConnectorNew.getName());
String portName = InterfaceManagerCommonUtils.getPortNameForInterface(nodeConnectorId, fcNodeConnectorNew.getName());
if (InterfaceManagerCommonUtils.isNovaPort(portName) || InterfaceManagerCommonUtils.isK8SPort(portName)) {
NodeConnectorId nodeConnectorIdOld = FlowBasedServicesUtils.getNodeConnectorIdFromInterface(portName, interfaceManagerCommonUtils);
if (nodeConnectorIdOld != null && !nodeConnectorId.equals(nodeConnectorIdOld)) {
BigInteger dpnIdOld = IfmUtil.getDpnFromNodeConnectorId(nodeConnectorIdOld);
BigInteger dpnIdNew = IfmUtil.getDpnFromNodeConnectorId(nodeConnectorId);
if (!Objects.equals(dpnIdOld, dpnIdNew)) {
if (fcNodeConnectorNew.getReason() != PortReason.Add) {
LOG.error("Dropping Port update event for {}, as DPN id is changed from {} to {}", fcNodeConnectorNew.getName(), dpnIdOld, dpnIdNew);
return;
}
} else {
LOG.warn("Port number update detected for {}", fcNodeConnectorNew.getName());
}
// VM Migration or Port Number Update: Delete existing interface entry for older DPN
LOG.debug("Triggering NodeConnector Remove Event for the interface: {}, {}, {}", portName, nodeConnectorId, nodeConnectorIdOld);
remove(nodeConnectorId, nodeConnectorIdOld, fcNodeConnectorNew, portName, false);
// for processing remove before add
try {
Thread.sleep(IfmConstants.DELAY_TIME_IN_MILLISECOND);
} catch (final InterruptedException e) {
LOG.error("Error while waiting for the vm migration remove events to get processed");
}
}
}
InterfaceStateAddWorker ifStateAddWorker = new InterfaceStateAddWorker(idManager, nodeConnectorId, fcNodeConnectorNew, portName);
coordinator.enqueueJob(portName, ifStateAddWorker, IfmConstants.JOB_MAX_RETRIES);
}
Aggregations