use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project netvirt by opendaylight.
the class ElanL2GatewayUtils method createItmTunnels.
public static void createItmTunnels(DataBroker dataBroker, ItmRpcService itmRpcService, String hwvtepId, String psName, IpAddress tunnelIp) {
AddL2GwDeviceInputBuilder builder = new AddL2GwDeviceInputBuilder();
builder.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
builder.setNodeId(HwvtepSouthboundUtils.createManagedNodeId(new NodeId(hwvtepId), psName).getValue());
builder.setIpAddress(tunnelIp);
try {
deleteStaleTunnelsOfHwvtepInITM(dataBroker, itmRpcService, hwvtepId, psName, tunnelIp);
Future<RpcResult<Void>> result = itmRpcService.addL2GwDevice(builder.build());
RpcResult<Void> rpcResult = result.get();
if (rpcResult.isSuccessful()) {
LOG.info("Created ITM tunnels for {}", hwvtepId);
} else {
LOG.error("Failed to create ITM Tunnels: {}", rpcResult.getErrors());
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("RPC to create ITM tunnels failed", e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project netvirt by opendaylight.
the class L2gwServiceProvider method provisionItmAndL2gwConnection.
@Override
public void provisionItmAndL2gwConnection(L2GatewayDevice l2GwDevice, String psName, String hwvtepNodeId, IpAddress tunnelIpAddr) {
elanClusterUtils.runOnlyInOwnerNode(hwvtepNodeId, "Handling Physical Switch add create itm tunnels ", () -> {
ElanL2GatewayUtils.createItmTunnels(dataBroker, itmRpcService, hwvtepNodeId, psName, tunnelIpAddr);
return Collections.emptyList();
});
List<L2gatewayConnection> l2GwConns = L2GatewayConnectionUtils.getAssociatedL2GwConnections(dataBroker, l2GwDevice.getL2GatewayIds());
LOG.debug("L2GatewayConnections associated for {} physical switch", psName);
for (L2gatewayConnection l2GwConn : l2GwConns) {
LOG.trace("L2GatewayConnection {} changes executed on physical switch {}", l2GwConn.getL2gatewayId(), psName);
l2GatewayConnectionUtils.addL2GatewayConnection(l2GwConn, psName);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project netvirt by opendaylight.
the class ElanUtils method isTunnelInLogicalGroup.
public boolean isTunnelInLogicalGroup(String interfaceName) {
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface configIface = interfaceManager.getInterfaceInfoFromConfigDataStore(interfaceName);
IfTunnel ifTunnel = configIface.getAugmentation(IfTunnel.class);
if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
ParentRefs refs = configIface.getAugmentation(ParentRefs.class);
if (refs != null && !Strings.isNullOrEmpty(refs.getParentInterface())) {
// multiple VxLAN tunnels enabled, i.e. only logical tunnel should be treated
return true;
}
}
return false;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project netvirt by opendaylight.
the class UnderlayNetworkDpnListener method remove.
@Override
protected void remove(InstanceIdentifier<DpnToInterface> key, DpnToInterface dpnToInterface) {
String underlayNetwork = key.firstKeyOf(UnderlayNetwork.class).getNetworkName();
BigInteger dpId = dpnToInterface.getDpId();
List<TunnelInterface> tunnelInterfaces = dpnToInterface.getTunnelInterface();
LOG.info("DPN {} removed from underlay network {} with tunnels {}", dpId, underlayNetwork, tunnelInterfaces);
List<PolicyProfile> profiles = policyServiceUtil.getUnderlayNetworkPolicyProfiles(underlayNetwork);
if (profiles == null || profiles.isEmpty()) {
LOG.debug("No policy profiles found for underlay network {}", underlayNetwork);
return;
}
populatePolicyGroupBucketsToDpn(underlayNetwork, profiles, tunnelInterfaces, dpId, NwConstants.DEL_FLOW);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels in project netvirt by opendaylight.
the class UnderlayNetworkDpnListener method add.
@Override
protected void add(InstanceIdentifier<DpnToInterface> key, DpnToInterface dpnToInterface) {
String underlayNetwork = key.firstKeyOf(UnderlayNetwork.class).getNetworkName();
BigInteger dpId = dpnToInterface.getDpId();
List<TunnelInterface> tunnelInterfaces = dpnToInterface.getTunnelInterface();
LOG.info("DPN {} added to underlay network {} with tunnels {}", dpId, underlayNetwork, tunnelInterfaces);
List<PolicyProfile> profiles = policyServiceUtil.getUnderlayNetworkPolicyProfiles(underlayNetwork);
if (profiles == null || profiles.isEmpty()) {
LOG.debug("No policy profiles found for underlay network {}", underlayNetwork);
return;
}
populatePolicyGroupsToDpn(profiles, tunnelInterfaces, dpId, NwConstants.ADD_FLOW);
populatePolicyGroupBucketsToDpn(underlayNetwork, profiles, tunnelInterfaces, dpId, NwConstants.ADD_FLOW);
populatePolicyAclRulesToDpn(dpId, profiles, NwConstants.ADD_FLOW);
populatePolicyRoutesToDpn(profiles, tunnelInterfaces, dpId, NwConstants.ADD_FLOW);
}
Aggregations