use of org.onosproject.net.behaviour.PatchDescription in project onos by opennetworkinglab.
the class DefaultK8sHostHandler method createInterPatchInterfaces.
private void createInterPatchInterfaces(DeviceId ovsdb, 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);
// openstack integration bridge -> k8s integration bridge
PatchDescription osIntK8sIntPatchDesc = DefaultPatchDescription.builder().deviceId(OS_INTEGRATION_BRIDGE).ifaceName(k8sNode.osToK8sIntgPatchPortName()).peer(k8sNode.k8sIntgToOsPatchPortName()).build();
ifaceConfig.addPatchMode(k8sNode.osToK8sIntgPatchPortName(), osIntK8sIntPatchDesc);
// openstack integration bridge -> k8s external bridge
PatchDescription osIntK8sExPatchDesc = DefaultPatchDescription.builder().deviceId(OS_INTEGRATION_BRIDGE).ifaceName(k8sNode.osToK8sExtPatchPortName()).peer(k8sNode.k8sExtToOsPatchPortName()).build();
ifaceConfig.addPatchMode(k8sNode.osToK8sExtPatchPortName(), osIntK8sExPatchDesc);
}
use of org.onosproject.net.behaviour.PatchDescription in project onos by opennetworkinglab.
the class DefaultKubevirtNodeHandler method createPhysicalPatchPorts.
private void createPhysicalPatchPorts(KubevirtNode node, KubevirtPhyInterface phyInterface) {
Device device = deviceService.getDevice(node.ovsdb());
if (device == null || !device.is(InterfaceConfig.class)) {
log.error("Failed to create patch interface on {}", node.ovsdb());
return;
}
String physicalDeviceId = BRIDGE_PREFIX + phyInterface.network();
String intToPhyPatchPort = structurePortName(INTEGRATION_TO_PHYSICAL_PREFIX + phyInterface.network());
String phyToIntPatchPort = structurePortName(phyInterface.network() + PHYSICAL_TO_INTEGRATION_SUFFIX);
// integration bridge -> physical bridge
PatchDescription intToPhyPatchDesc = DefaultPatchDescription.builder().deviceId(INTEGRATION_BRIDGE).ifaceName(intToPhyPatchPort).peer(phyToIntPatchPort).build();
// physical bridge -> integration bridge
PatchDescription phyToIntPatchDesc = DefaultPatchDescription.builder().deviceId(physicalDeviceId).ifaceName(phyToIntPatchPort).peer(intToPhyPatchPort).build();
InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
ifaceConfig.addPatchMode(INTEGRATION_TO_PHYSICAL_PREFIX + phyInterface.network(), intToPhyPatchDesc);
ifaceConfig.addPatchMode(phyInterface.network() + PHYSICAL_TO_INTEGRATION_SUFFIX, phyToIntPatchDesc);
addOrRemoveSystemInterface(node, physicalDeviceId, phyInterface.intf(), deviceService, true);
}
use of org.onosproject.net.behaviour.PatchDescription in project onos by opennetworkinglab.
the class DefaultKubevirtNodeHandler method createPatchInterfaceBetweenBrIntBrTun.
private void createPatchInterfaceBetweenBrIntBrTun(KubevirtNode node) {
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);
// int bridge -> tunnel bridge
PatchDescription brIntTunPatchDesc = DefaultPatchDescription.builder().deviceId(INTEGRATION_BRIDGE).ifaceName(INTEGRATION_TO_TUNNEL).peer(TUNNEL_TO_INTEGRATION).build();
ifaceConfig.addPatchMode(INTEGRATION_TO_TUNNEL, brIntTunPatchDesc);
// tunnel bridge -> int bridge
PatchDescription brTunIntPatchDesc = DefaultPatchDescription.builder().deviceId(TUNNEL_BRIDGE).ifaceName(TUNNEL_TO_INTEGRATION).peer(INTEGRATION_TO_TUNNEL).build();
ifaceConfig.addPatchMode(TUNNEL_TO_INTEGRATION, brTunIntPatchDesc);
}
use of org.onosproject.net.behaviour.PatchDescription in project onos by opennetworkinglab.
the class DefaultOpenstackNodeHandler method createPhysicalPatchPorts.
private void createPhysicalPatchPorts(OpenstackNode osNode, OpenstackPhyInterface phyInterface) {
Device device = deviceService.getDevice(osNode.ovsdb());
if (device == null || !device.is(InterfaceConfig.class)) {
log.error("Failed to create patch interface on {}", osNode.ovsdb());
return;
}
String physicalDeviceId = BRIDGE_PREFIX + phyInterface.network();
String intToPhyPatchPort = structurePortName(INTEGRATION_TO_PHYSICAL_PREFIX + phyInterface.network());
String phyToIntPatchPort = structurePortName(phyInterface.network() + PHYSICAL_TO_INTEGRATION_SUFFIX);
// integration bridge -> physical bridge
PatchDescription intToPhyPatchDesc = DefaultPatchDescription.builder().deviceId(INTEGRATION_BRIDGE).ifaceName(intToPhyPatchPort).peer(phyToIntPatchPort).build();
// physical bridge -> integration bridge
PatchDescription phyToIntPatchDesc = DefaultPatchDescription.builder().deviceId(physicalDeviceId).ifaceName(phyToIntPatchPort).peer(intToPhyPatchPort).build();
InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
ifaceConfig.addPatchMode(INTEGRATION_TO_PHYSICAL_PREFIX + phyInterface.network(), intToPhyPatchDesc);
ifaceConfig.addPatchMode(phyInterface.network() + PHYSICAL_TO_INTEGRATION_SUFFIX, phyToIntPatchDesc);
addOrRemoveSystemInterface(osNode, physicalDeviceId, phyInterface.intf(), deviceService, true);
}
use of org.onosproject.net.behaviour.PatchDescription in project onos by opennetworkinglab.
the class DefaultK8sNodeHandler method createPatchInterfaces.
private void createPatchInterfaces(K8sNode k8sNode) {
Device device = deviceService.getDevice(k8sNode.ovsdb());
if (device == null || !device.is(InterfaceConfig.class)) {
log.error("Failed to create patch interface on {}", k8sNode.ovsdb());
return;
}
// integration bridge -> external bridge
PatchDescription brIntExtPatchDesc = DefaultPatchDescription.builder().deviceId(k8sNode.intgBridgeName()).ifaceName(k8sNode.intgToExtPatchPortName()).peer(k8sNode.extToIntgPatchPortName()).build();
// integration bridge -> tunnel bridge
PatchDescription brIntTunPatchDesc = DefaultPatchDescription.builder().deviceId(k8sNode.intgBridgeName()).ifaceName(k8sNode.intgToTunPatchPortName()).peer(k8sNode.tunToIntgPatchPortName()).build();
// external bridge -> integration bridge
PatchDescription brExtIntPatchDesc = DefaultPatchDescription.builder().deviceId(k8sNode.extBridgeName()).ifaceName(k8sNode.extToIntgPatchPortName()).peer(k8sNode.intgToExtPatchPortName()).build();
// integration bridge -> local bridge
PatchDescription brIntLocalPatchDesc = DefaultPatchDescription.builder().deviceId(k8sNode.intgBridgeName()).ifaceName(k8sNode.intgToLocalPatchPortName()).peer(k8sNode.localToIntgPatchPortName()).build();
// local bridge -> integration bridge
PatchDescription brLocalIntPatchDesc = DefaultPatchDescription.builder().deviceId(k8sNode.localBridgeName()).ifaceName(k8sNode.localToIntgPatchPortName()).peer(k8sNode.intgToLocalPatchPortName()).build();
InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
ifaceConfig.addPatchMode(k8sNode.intgToExtPatchPortName(), brIntExtPatchDesc);
ifaceConfig.addPatchMode(k8sNode.extToIntgPatchPortName(), brExtIntPatchDesc);
ifaceConfig.addPatchMode(k8sNode.intgToLocalPatchPortName(), brIntLocalPatchDesc);
ifaceConfig.addPatchMode(k8sNode.localToIntgPatchPortName(), brLocalIntPatchDesc);
ifaceConfig.addPatchMode(k8sNode.intgToTunPatchPortName(), brIntTunPatchDesc);
if (k8sNode.mode() == NORMAL) {
// tunnel bridge -> integration bridge
PatchDescription brTunIntPatchDesc = DefaultPatchDescription.builder().deviceId(k8sNode.tunBridgeName()).ifaceName(k8sNode.tunToIntgPatchPortName()).peer(k8sNode.intgToTunPatchPortName()).build();
ifaceConfig.addPatchMode(k8sNode.tunToIntgPatchPortName(), brTunIntPatchDesc);
} else {
// k8s integration bridge -> openstack integration bridge
PatchDescription k8sIntOsIntPatchDesc = DefaultPatchDescription.builder().deviceId(k8sNode.intgBridgeName()).ifaceName(k8sNode.k8sIntgToOsPatchPortName()).peer(k8sNode.osToK8sIntgPatchPortName()).build();
ifaceConfig.addPatchMode(k8sNode.k8sIntgToOsPatchPortName(), k8sIntOsIntPatchDesc);
// k8s external bridge -> openstack integration bridge
PatchDescription k8sExtOsIntPatchDesc = DefaultPatchDescription.builder().deviceId(k8sNode.extBridgeName()).ifaceName(k8sNode.k8sExtToOsPatchPortName()).peer(k8sNode.osToK8sExtPatchPortName()).build();
ifaceConfig.addPatchMode(k8sNode.k8sExtToOsPatchPortName(), k8sExtOsIntPatchDesc);
// external bridge -> router bridge
PatchDescription extRouterPatchDesc = DefaultPatchDescription.builder().deviceId(k8sNode.extBridgeName()).ifaceName(k8sNode.extToRouterPatchPortName()).peer(k8sNode.routerToExtPatchPortName()).build();
ifaceConfig.addPatchMode(k8sNode.extToRouterPatchPortName(), extRouterPatchDesc);
}
}
Aggregations