use of org.onosproject.net.behaviour.PatchDescription in project onos by opennetworkinglab.
the class DefaultK8sHostHandler method createTunnelPatchInterfaces.
private void createTunnelPatchInterfaces(DeviceId ovsdb, K8sBridge bridge, K8sNode k8sNode) {
Device device = deviceService.getDevice(ovsdb);
if (device == null || !device.is(InterfaceConfig.class)) {
log.error("Failed to create patch interface on {}", ovsdb);
return;
}
InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
// tunnel bridge -> k8s integration bridge
PatchDescription brTunIntPatchDesc = DefaultPatchDescription.builder().deviceId(bridge.name()).ifaceName(k8sNode.tunToIntgPatchPortName()).peer(k8sNode.intgToTunPatchPortName()).build();
ifaceConfig.addPatchMode(k8sNode.tunToIntgPatchPortName(), brTunIntPatchDesc);
}
use of org.onosproject.net.behaviour.PatchDescription in project onos by opennetworkinglab.
the class DefaultK8sHostHandler method createRouterPatchInterfaces.
private void createRouterPatchInterfaces(DeviceId ovsdb, K8sBridge bridge, K8sNode k8sNode) {
Device device = deviceService.getDevice(ovsdb);
if (device == null || !device.is(InterfaceConfig.class)) {
log.error("Failed to create patch interface on {}", ovsdb);
return;
}
InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
// router bridge -> external bridge
PatchDescription brRouterExtPatchDesc = DefaultPatchDescription.builder().deviceId(bridge.name()).ifaceName(k8sNode.routerToExtPatchPortName()).peer(k8sNode.extToRouterPatchPortName()).build();
ifaceConfig.addPatchMode(k8sNode.tunToIntgPatchPortName(), brRouterExtPatchDesc);
}
use of org.onosproject.net.behaviour.PatchDescription in project onos by opennetworkinglab.
the class KubevirtNetworkHandler method createPatchTenantInterface.
private void createPatchTenantInterface(KubevirtNode node, KubevirtNetwork network) {
Device device = deviceService.getDevice(node.ovsdb());
if (device == null || !device.is(InterfaceConfig.class)) {
log.error("Failed to create patch interface on {}", node.ovsdb());
return;
}
InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
String tenantToTunIntf = TENANT_TO_TUNNEL_PREFIX + segmentIdHex(network.segmentId());
String tunToTenantIntf = TUNNEL_TO_TENANT_PREFIX + segmentIdHex(network.segmentId());
if (!hasPort(network.tenantDeviceId(node.hostname()), tenantToTunIntf)) {
// patch ports for tenant bridge -> tunnel bridge
PatchDescription brTenantTunPatchDesc = DefaultPatchDescription.builder().deviceId(network.tenantBridgeName()).ifaceName(tenantToTunIntf).peer(tunToTenantIntf).build();
ifaceConfig.addPatchMode(tenantToTunIntf, brTenantTunPatchDesc);
waitFor(1);
}
if (!hasPort(node.tunBridge(), tunToTenantIntf)) {
// tunnel bridge -> tenant bridge
PatchDescription brTunTenantPatchDesc = DefaultPatchDescription.builder().deviceId(TUNNEL_BRIDGE).ifaceName(tunToTenantIntf).peer(tenantToTunIntf).build();
ifaceConfig.addPatchMode(tunToTenantIntf, brTunTenantPatchDesc);
waitFor(1);
}
}
Aggregations