Skip to content

Commit

Permalink
update openvswitch notebook to work with NIC_Basic
Browse files Browse the repository at this point in the history
  • Loading branch information
kthare10 committed Apr 10, 2024
1 parent 6b9fe87 commit 544a6c5
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions fabric_examples/complex_recipes/openvswitch/openvswitch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"\n",
"<img src=\"./figs/openvswitch-single.png\" width=\"70%\"><br>\n",
"\n",
"### Limitation\n",
"Due to NVIDIA/Mellanox limitation, it appears the desired bridged virtual function forwarding behavior is not something currently supported for SRIOV functions i.e. `NIC_Basic`. VM hosting OVS bridge is required to use Dedicated NICs i.e. `NIC_ConnectX_5` or `NIC_ConnectX_6`.\n",
"### Host Placement Considerations\n",
"Because of constraints imposed by NVIDIA/Mellanox, when utilizing `NIC_Basic` for an OVS bridge experiment, it is advisable to deploy the VM responsible for running the bridge on a separate host from the VMs linked to the bridge.\n",
"\n",
"We are working on an alternate solution, which would be available in the upcoming release."
"Additionally, it's worth noting that this condition does not apply to `NIC_ConnectX_5` and `NIC_ConnectX_6` configurations."
]
},
{
Expand Down Expand Up @@ -65,24 +65,27 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"metadata": {},
"outputs": [],
"source": [
"slice_name= \"MySlice-openvswitch\"\n",
"\n",
"# we will use CX5 to generate traffic so need sites that have CX5 for this example.\n",
"cx5_column_name = 'nic_connectx_5_available'\n",
"\n",
"# find two sites with available ConnectX-5 \n",
"sites = [site1] = fablib.get_random_sites(count=1, filter_function=lambda x: x[cx5_column_name] > 0)\n",
"sites = [site1] = fablib.get_random_sites(count=1)\n",
"print(f\"Sites: {sites}\")\n",
"\n",
"site_node_count = 2\n",
"bridge1_name = 'bridge1'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"site1=\"EDUKY\""
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -104,7 +107,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Add Bridge1"
"### Add Bridge1\n",
"\n",
"Because of constraints imposed by NVIDIA/Mellanox, when utilizing `NIC_Basic` for an OVS bridge experiment, it is advisable to deploy the VM responsible for running the bridge on a separate host from the VMs linked to the bridge.\n",
"\n",
"`bridge1` in the example below is requested on host `{site1..lower()}-w1.fabric-testbed.net`"
]
},
{
Expand All @@ -113,15 +120,18 @@
"metadata": {},
"outputs": [],
"source": [
"bridge1 = slice.add_node(name=bridge1_name, site=site1, cores=4, ram=8, disk=50, image=default_image)\n",
"bridge1_nic = bridge1.add_component(model='NIC_ConnectX_5', name='nic_local')"
"bridge1 = slice.add_node(name=bridge1_name, site=site1, cores=4, ram=8, disk=50, image=default_image, host=f\"{site1.lower()}-w1.fabric-testbed.net\")\n",
"bridge1_nic1 = bridge1.add_component(model='NIC_Basic', name='nic_local_1')\n",
"bridge1_nic2 = bridge1.add_component(model='NIC_Basic', name='nic_local_2')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Add Host Nodes"
"### Add Host Nodes\n",
"\n",
"Host nodes are required to be located on a host other than `bridge1`, specifically on `{site1.lower()}-w2.fabric-testbed.net`. These nodes can be distributed across any other host, or all hosted on the same host, provided it is not the `bridge1` host."
]
},
{
Expand All @@ -135,12 +145,12 @@
"for node_num in range(site_node_count):\n",
" node_name = f\"{site1.lower()}{node_num+1}\"\n",
"\n",
" node = slice.add_node(name=node_name, site=site1, cores=4, ram=8, disk=50, image=default_image)\n",
" node = slice.add_node(name=node_name, site=site1, cores=4, ram=8, disk=50, image=default_image, host=f\"{site1.lower()}-w2.fabric-testbed.net\")\n",
" iface = node.add_component(model='NIC_Basic', name='nic_local').get_interfaces()[0] \n",
" net = slice.add_l2network(name=f\"net{node_num}\")\n",
"\n",
" net.add_interface(iface)\n",
" net.add_interface(bridge1_nic.get_interfaces()[i])\n",
" net.add_interface(bridge1.get_interfaces()[i])\n",
" i += 1"
]
},
Expand Down

0 comments on commit 544a6c5

Please sign in to comment.