### Simulate Hypervisors and Configure OVN Ports Source: https://github.com/ovn-org/ovn/blob/main/Documentation/ref/ovn-sim.1.md This example demonstrates simulating multiple hypervisors, attaching them to a network, and configuring OVN logical ports. It involves starting OVN, adding a logical switch, and iterating through hypervisors to set up bridges, attach them, and add logical switch ports with MAC and IP addresses. ```bash ovn_start ovn-nbctl ls-add lsw0 net_add n1 for i in 0 1; do sim_add hv$i as hv$i ovs-vsctl add-br br-phys ovn_attach n1 br-phys 192.168.`expr $i + 1` ovs-vsctl add-port br-int vif$i -- \ set Interface vif$i external-ids:iface-id=lp$i ovn-nbctl lsp-add lsw0 lp$i ovn-nbctl lsp-set-addresses lp$i f0:00:00:00:00:0$i done ``` -------------------------------- ### Configure OVN with Custom Installation Paths Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Customize the installation directories for OVN files, state, and configuration. This example sets the prefix to /usr, localstatedir to /var, and sysconfdir to /etc. ```bash $ ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc ``` -------------------------------- ### Install OVN Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Run 'make install' to install OVN executables and manpages. By default, installation occurs under /usr/local. ```bash $ sudo make install ``` -------------------------------- ### Install OVN Host Package Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/debian.md Installs the OVN controller component for each host or hypervisor using apt-get. ```bash $ sudo apt-get install ovn-host ``` -------------------------------- ### Install Python Dependencies with Pip Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/documentation.md Sets up a Python virtual environment and installs project dependencies from requirements.txt using pip. ```bash $ python3 -m venv .venv $ source .venv/bin/activate $ pip install -r Documentation/requirements.txt ``` -------------------------------- ### Start OVN Controller Source: https://github.com/ovn-org/ovn/blob/main/Documentation/howto/docker.md Command to start the OVN controller. This command needs to be executed on every boot. ```bash $ /usr/share/ovn/scripts/ovn-ctl start_controller ``` -------------------------------- ### Install git-pw Tool Source: https://github.com/ovn-org/ovn/blob/main/Documentation/internals/patchwork.md Install the git-pw tool using pip. This command should be run with the --user flag to install it in the user's home directory. ```default $ pip install --user git-pw ``` -------------------------------- ### Install OVN Host Node Packages Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/fedora.md Use 'dnf' to install the 'ovn-host' package on each host or hypervisor to run ovn-controller. ```bash $ sudo dnf install ovn-host ``` -------------------------------- ### DevStack Initialization Output Example Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md This is an example of the expected output upon successful completion of stack.sh, showing host IP, dashboard URL, and service endpoints. ```text This is your host IP address: 172.16.189.6 This is your host IPv6 address: ::1 Horizon is now available at http://172.16.189.6/dashboard Keystone is serving at http://172.16.189.6/identity/ The default users are: admin and demo The password: password 2017-03-09 15:10:54.117 | stack.sh completed in 2110 seconds. ``` -------------------------------- ### Start OVN Sandbox Environment Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-sandbox.md Run this command to initialize the OVN sandbox environment. It sets up databases, starts daemons, and makes utilities available. ```bash $ make sandbox ``` -------------------------------- ### Install Additional OVN Packages Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/fedora.md Install shared components, VTEP support, or bridge controller packages using 'dnf'. ```bash $ sudo dnf install ovn # shared components ``` ```bash $ sudo dnf install ovn-vtep # VTEP gateway support ``` ```bash $ sudo dnf install ovn-br-controller # bridge controller ``` -------------------------------- ### Create Network and Connect Container Source: https://github.com/ovn-org/ovn/blob/main/Documentation/howto/docker.md This example demonstrates creating a new logical switch and then connecting an existing container to it. ```bash $ docker network create -d openvswitch --subnet=192.168.2.0/24 bar $ docker network connect bar busybox ``` -------------------------------- ### Install Sphinx on Debian/Ubuntu Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/documentation.md Installs the Sphinx documentation generator using the apt-get package manager. ```bash $ sudo apt-get install python3-sphinx ``` -------------------------------- ### Install Sphinx on RHEL/Fedora Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/documentation.md Installs the Sphinx documentation generator using the dnf package manager. ```bash $ sudo dnf install python3-sphinx ``` -------------------------------- ### Install OVN RPM Packages Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/fedora.md Install the built OVN RPM packages using 'rpm -i'. Superuser privileges are required for installation. ```bash $ sudo rpm -i ovn-*.rpm ``` -------------------------------- ### Install Development Tools and Build Dependencies Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/fedora.md Install RPM tools and generic build dependencies required for building OVN RPM packages. ```bash $ sudo dnf install @'Development Tools' rpm-build dnf-plugins-core ``` -------------------------------- ### Start OVN Daemons using ovn-ctl Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Use the ovn-ctl script to start OVN northd and controller daemons. Ensure the script is in your PATH. ```bash $ export PATH=$PATH:/usr/local/share/ovn/scripts $ ovn-ctl start_northd $ ovn-ctl start_controller ``` -------------------------------- ### Run OVN Setup Script Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-sandbox.md Execute the ovn-setup.sh script from the OVN source tree to automate the creation of OVN resources. ```bash $ ./ovn-setup.sh ``` -------------------------------- ### Install Debian Packaging Tools and OVN Build Dependencies Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/debian.md Installs essential tools for Debian packaging and the specific build dependencies required for OVN. ```bash $ sudo apt-get install build-essential fakeroot devscripts ``` ```bash $ sudo apt-get install graphviz autoconf automake bzip2 \ debhelper dh-autoreconf dh-python libssl-dev libtool \ openssl procps python3-all python3-sphinx \ python3-twisted python3-zope.interface \ libunbound-dev libunwind-dev ``` -------------------------------- ### Start Interconnection Databases Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-interconnection.md Starts the OVN IC-NB and IC-SB databases. Use '--db-ic-nb-create-insecure-remote=yes' and '--db-ic-sb-create-insecure-remote=yes' for standalone mode with TCP connections. ```bash $ ovn-ctl [options] start_ic_ovsdb ``` ```bash $ ovn-ctl --db-ic-nb-create-insecure-remote=yes \ --db-ic-sb-create-insecure-remote=yes start_ic_ovsdb ``` -------------------------------- ### Install Required Python Packages Source: https://github.com/ovn-org/ovn/blob/main/Documentation/howto/docker.md Install the 'python-neutronclient' and 'Flask' libraries required for the OVN Docker network driver. ```bash $ pip install python-neutronclient $ pip install Flask ``` -------------------------------- ### Start OVN Controller and Connect to OVSDB Relay Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-ovsdb-relay.md Configures the ovn-controller to connect to the OVSDB Relay using SSL and then starts the ovn-controller service. ```bash ovs-vsctl set external_ids:ovn-remote="ssl:127.0.0.1:6642" /usr/share/ovn/scripts/ovn-ctl start_controller ``` -------------------------------- ### Start OVN Northbound Daemon using ovn-ctl Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Initiate the ovn-northd service using the ovn-ctl utility. Ensure the script is in your PATH. ```bash > $ export PATH=$PATH:/usr/local/share/ovn/scripts > $ ovn-ctl start_northd ``` -------------------------------- ### Install Additional OVN Packages Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/debian.md Installs supplementary OVN packages like shared components and VTEP gateway support. ```bash $ sudo apt-get install ovn-common # shared components ``` ```bash $ sudo apt-get install ovn-controller-vtep # VTEP gateway support ``` -------------------------------- ### Install OVN Specific Build Dependencies Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/fedora.md Install OVN-specific build dependencies using 'dnf builddep' with the temporary SPEC file. ```bash $ sudo dnf builddep /tmp/ovn.spec ``` -------------------------------- ### OVN Trace Ingress Pipeline Example Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md Example output of an OVN trace showing the ingress pipeline processing for an IPv6 packet. ```text ingress(dp="n1", inport="ap") ----------------------------- 0. ls_in_port_sec_l2 (northd.c:3234): inport == "ap" && eth.src == {fa:16:3e:a9:4c:c7}, priority 50, uuid 6dcc418a next; 1. ls_in_port_sec_ip (northd.c:2390): inport == "ap" && eth.src == fa:16:3e:a9:4c:c7 && ip6.src == {fe80::f816:3eff:fea9:4cc7, fc11::5}, priority 90, uuid 604810ea next; 3. ls_in_pre_acl (northd.c:2646): ip, priority 100, uuid 46c089e6 reg0[0] = 1; next; 5. ls_in_pre_stateful (northd.c:2764): reg0[0] == 1, priority 100, uuid d1941634 ct_next; ct_next(ct_state=est|trk /* default (use --ct to customize) */) --------------------------------------------------------------- 6. ls_in_acl (northd.c:2925): !ct.new && ct.est && !ct.rpl && ct_label.blocked == 0 && (inport == "ap" && ip6), priority 2002, uuid 7fdd607e next; 13. ls_in_l2_lkup (northd.c:3529): eth.dst == fa:16:3e:ef:2f:8b, priority 50, uuid e1d87fc5 outport = "ad952e"; output; egres(dp="n1", inport="ap", outport="ad952e") ---------------------------------------------- 1. ls_out_pre_acl (northd.c:2626): ip && outport == "ad952e", priority 110, uuid 88f68988 next; 8. ls_out_port_sec_l2 (northd.c:3654): outport == "ad952e", priority 50, uuid 5935755e output; /* output to "ad952e", type "patch" */ ingress(dp="r", inport="lrp-ad952e") ------------------------------------ 0. lr_in_admission (northd.c:4071): eth.dst == fa:16:3e:ef:2f:8b && inport == "lrp-ad952e", priority 50, uuid ddfeb712 next; 5. lr_in_ip_routing (northd.c:3782): ip6.dst == fc22::/64, priority 129, uuid cc2130ec ip.ttl--; xxreg0 = ip6.dst; xxreg1 = fc22::1; eth.src = fa:16:3e:06:de:ad; outport = "lrp-1a8162"; flags.loopback = 1; next; ``` -------------------------------- ### OVN Scale Test Setup Source: https://github.com/ovn-org/ovn/blob/main/Documentation/ref/ovn-sim.1.md A primitive OVN scale test setup that simulates a large number of hypervisors and configures them with clustered OVN databases. It uses background processes for adding hypervisors and configures logical ports with dynamically generated MAC addresses. ```bash n=200; export n ovn_start --sbdb-model=clustered net_add n1 ovn-nbctl ls-add br0 for i in `seq $n`; do (sim_add hv$i as hv$i ovs-vsctl add-br br-phys y=$(expr $i / 256) x=$(expr $i % 256) ovn_attach n1 br-phys 192.168.$y.$x ovs-vsctl add-port br-int vif$i -- \ set Interface vif$i external-ids:iface-id=lp$i) & case $i in *50|*00) echo $i; wait ;; esac done wait for i in `seq $n`; do yy=$(printf %02x $(expr $i / 256)) xx=$(printf %02x $(expr $i % 256)) ovn-nbctl lsp-add br0 lp$i ovn-nbctl lsp-set-addresses br0 lp$i f0:00:00:00:$yy:$xx done ``` -------------------------------- ### Install Git on CentOS 7 (Shell) Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md Install the Git package on a CentOS 7 system. This is a prerequisite for cloning DevStack and Neutron repositories. ```shell $ sudo yum install git ``` -------------------------------- ### Install OVN Central Node Packages Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/fedora.md Use 'dnf' to install the 'ovn-central' package for a central OVN node that runs databases and ovn-northd. ```bash $ sudo dnf install ovn-central ``` -------------------------------- ### Example Patch Format Source: https://github.com/ovn-org/ovn/blob/main/Documentation/internals/contributing/submitting-patches.md This is an example of a patch in `diff -up` format, generated using Git with `-M -C` options. Ensure patches are inline in emails and follow the project's coding style. ```default From fa29a1c2c17682879e79a21bb0cdd5bbe67fa7c0 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Thu, 8 Dec 2011 13:17:24 -0800 Subject: [PATCH] datapath: Alphabetize include/net/ipv6.h compat header. Signed-off-by: Jesse Gross --- datapath/linux/Modules.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk index fdd952e..f6cb88e 100644 --- a/datapath/linux/Modules.mk +++ b/datapath/linux/Modules.mk @@ -56,11 +56,11 @@ openvswitch_headers += linux/compat/include/net/dst.h \ linux/compat/include/net/genetlink.h \ linux/compat/include/net/ip.h \ + linux/compat/include/net/ipv6.h \ linux/compat/include/net/net_namespace.h \ linux/compat/include/net/netlink.h \ linux/compat/include/net/protocol.h \ linux/compat/include/net/route.h \ - linux/compat/include/net/ipv6.h \ linux/compat/genetlink.inc both_modules += brcompat -- 1.7.7.3 ``` -------------------------------- ### Get git-pw Help Source: https://github.com/ovn-org/ovn/blob/main/Documentation/internals/patchwork.md Display help information for the git-pw command to understand available subcommands and options. ```default $ git pw --help ``` -------------------------------- ### Start OVN Northbound ovsdb-server Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Manually start the OVN Northbound ovsdb-server, configuring it to use the created database, listen on a Unix domain socket, and use SSL/TLS settings. Omit SSL/TLS options if built without support. ```bash $ sudo mkdir -p /usr/local/var/run/ovn $ sudo ovsdb-server /usr/local/etc/ovn/ovnnb_db.db --remote=punix:/usr/local/var/run/ovn/ovnnb_db.sock \ --remote=db:OVN_Northbound,NB_Global,connections \ --private-key=db:OVN_Northbound,SSL,private_key \ --certificate=db:OVN_Northbound,SSL,certificate \ --bootstrap-ca-cert=db:OVN_Northbound,SSL,ca_cert \ --pidfile=/usr/local/var/run/ovn/ovnnb-server.pid --detach --log-file=/usr/local/var/log/ovn/ovnnb-server.log ``` -------------------------------- ### Start and Enable Firewall for IPsec Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-ipsec.md On Fedora, RHEL, and CentOS, start and enable the firewall service to allow ESP and IKE traffic for IPsec. ```bash # systemctl start firewalld # firewall-cmd --add-service ipsec ``` ```bash # systemctl enable firewalld # firewall-cmd --permanent --add-service ipsec ``` -------------------------------- ### Start OVN Controller Service Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Start the `ovn-controller` service on each chassis. This service connects to the local OVS instance and requires specific configuration keys like `system-id`, `ovn-remote`, `ovn-encap-type`, and `ovn-encap-ip`. ```bash $ ovn-controller --pidfile --detach --log-file ``` -------------------------------- ### Start Docker Daemon with Cluster Store Source: https://github.com/ovn-org/ovn/blob/main/Documentation/howto/docker.md Start the Docker daemon with a distributed key-value store like Consul for multi-host networking. Replace `$HOST_IP` with your host's IP address. ```bash $ docker daemon --cluster-store=consul://127.0.0.1:8500 \ --cluster-advertise=$HOST_IP:0 ``` -------------------------------- ### Start OVN Databases and northd Source: https://github.com/ovn-org/ovn/blob/main/Documentation/ref/ovn-sim.1.md Initializes and starts the central OVN databases (northbound and southbound) and the ovn-northd process. Supports different database models like standalone, backup, and clustered. ```bash ovn_start ``` ```bash ovn_start --nbdb-model=clustered --nbdb-servers=5 --sbdb-model=backup ``` -------------------------------- ### OVS Commit History Example Source: https://github.com/ovn-org/ovn/blob/main/Documentation/internals/ovs_submodule.md Illustrates a simplified OVS commit history to explain submodule versioning for OVN releases. This is a conceptual example, not executable code. ```text (Newest) Commit 4 | | Commit 2 ------------------------------- Commit 3 (used to create OVS branch-Y) (latest stable release on OVS branch-Y) | | Commit 1 (Oldest) ``` -------------------------------- ### Start OVN Southbound ovsdb-server Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Manually start the OVN Southbound ovsdb-server, configuring it to use the created database, listen on a Unix domain socket, and use SSL/TLS settings. Omit SSL/TLS options if built without support. ```bash $ sudo ovsdb-server /usr/local/etc/ovn/ovnsb_db.db --remote=punix:/usr/local/var/run/ovn/ovnsb_db.sock \ --remote=db:OVN_Southbound,SB_Global,connections \ --private-key=db:OVN_Southbound,SSL,private_key \ --certificate=db:OVN_Southbound,SSL,certificate \ --bootstrap-ca-cert=db:OVN_Southbound,SSL,ca_cert \ --pidfile=/usr/local/var/run/ovn/ovnsb-server.pid --detach --log-file=/usr/local/var/log/ovn/ovnsb-server.log ``` -------------------------------- ### Start Intermediate OVSDB Relay in Two-Tier Multi-Group Deployment Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-ovsdb-relay.md Starts an intermediate OVSDB Relay server in a two-tier multi-group setup. The '--db-sb-relay-use-remote-in-db=no' option is crucial here. ```bash /usr/share/ovn/scripts/ovn-ctl start_sb_relay_ovsdb \ --db-sb-relay-remote=tcp:127.0.0.1:16642 \ --db-sb-relay-use-remote-in-db=no \ --ovn-sb-relay-db-ssl-key=/path/to/ovsdb/relay/ssl-key.pem \ --ovn-sb-relay-db-ssl-cert=/path/to/ovsdb/relay/ssl-cert.pem \ --ovn-sb-relay-db-ssl-ca-cert=/path/to/ovsdb/relay/ssl-ca-cert.pem \ -- --remote=pssl:26642 ``` -------------------------------- ### Copy firewalld Service Files from Source Source: https://github.com/ovn-org/ovn/blob/main/Documentation/howto/firewalld.md Copy the firewalld service XML files to the firewalld services directory when installing OVN from source. ```bash $ cp rhel/usr_lib_firewalld_services_ovn-central-firewall-service.xml \ /etc/firewalld/services/ $ cp rhel/usr_lib_firewalld_services_ovn-host-firewall-service.xml \ /etc/firewalld/services/ ``` -------------------------------- ### Get VM Instance ID Source: https://github.com/ovn-org/ovn/blob/main/Documentation/howto/docker.md Retrieves the ID of a VM instance, which is a prerequisite for identifying its network interface in the underlay mode setup. ```bash $ nova list ``` -------------------------------- ### Display Configure Help Options Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Invoke the configure script with the --help option to see all available configuration options. ```bash $ ./configure --help ``` -------------------------------- ### Start OVN Docker Overlay Driver Source: https://github.com/ovn-org/ovn/blob/main/Documentation/howto/docker.md Starts the Open vSwitch driver for Docker networking. This driver replaces the default Linux bridge and enables OVN's logical networking features for containers. Ensure `$OVS_PYTHON_LIBS_PATH` is correctly set if OVS Python modules were not installed via standard packages or pip. ```bash $ PYTHONPATH=$OVS_PYTHON_LIBS_PATH ovn-docker-overlay-driver --detach ``` -------------------------------- ### IPv4 NAT Rule Example Source: https://github.com/ovn-org/ovn/blob/main/Documentation/ref/ovn-logical-flows.7.md Flow for distributed NAT rules with IPv4, matching source IP and chassis residency. ```ovn-sbctl priority 90 ip4.src = A && is_chassis_resident(P) \ actions get_arp(outport, reg0); next; ``` -------------------------------- ### IPv6 NAT Rule Example Source: https://github.com/ovn-org/ovn/blob/main/Documentation/ref/ovn-logical-flows.7.md Flow for distributed NAT rules with IPv6, matching source IP and chassis residency. ```ovn-sbctl priority 90 ip6.src = A && is_chassis_resident(P) \ actions get_nd(outport, xxreg0); next; ``` -------------------------------- ### Build and Run ovn-sim Source: https://github.com/ovn-org/ovn/blob/main/Documentation/ref/ovn-sim.1.md This snippet shows the steps to clone, build, and run ovn-sim from source. It requires building both Open vSwitch and OVN, and configuring OVN with the OVS source directory. ```bash git clone https://github.com/openvswitch/ovs.git cd ovs ./boot.sh && ./configure && make cd .. git clone https://github.com/ovn-org/ovn.git cd ovn ./boot.sh && ./configure --with-ovs-source=${PWD}/../ovs make utilities/ovn-sim ``` -------------------------------- ### Set Open vSwitch System ID Source: https://github.com/ovn-org/ovn/blob/main/Documentation/howto/docker.md Ensures each Open vSwitch instance has a unique, persistent identifier. This is automatically handled by distribution packages or `ovs-ctl`, but manual setup is required for manual Open vSwitch starts. ```bash $ id_file=/etc/openvswitch/system-id.conf $ test -e $id_file || uuidgen > $id_file $ ovs-vsctl set Open_vSwitch . external_ids:system-id=$(cat $id_file) ``` -------------------------------- ### Install Non-PAE Kernel for 32-bit VM (Shell) Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md If using a 32-bit VM, install the non-PAE kernel and reboot. This is necessary for DevStack to install properly on such systems. ```shell $ sudo yum install kernel-core kernel-devel $ sudo reboot ``` -------------------------------- ### Prepare Open vSwitch Submodule Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Before configuring OVN, prepare the Open vSwitch sources using the included submodule. This involves updating the submodule, navigating into the ovs directory, and running its build and configure scripts. ```bash $ git submodule update --init $ cd ovs $ ./boot.sh $ ./configure $ make $ cd .. ``` -------------------------------- ### Configure OVN Build Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Run the configure script to prepare OVN for building. This is a standard step after bootstrapping. ```bash $ ./configure ``` -------------------------------- ### Initialize DevStack Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md Run the stack.sh script to initialize DevStack and download necessary software. This process can take a significant amount of time on the first run. ```bash $ ./stack.sh ``` -------------------------------- ### Bootstrap OVN from Source Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Run this script if you have pulled OVN sources directly from a Git tree or obtained a Git tree snapshot. This builds the 'configure' script. ```bash $ ./boot.sh ``` -------------------------------- ### Start OVS Traffic vSwitchd Source: https://github.com/ovn-org/ovn/blob/main/Documentation/topics/test-development.md The `OVS_TRAFFIC_VSWITCHD_START` macro initializes `ovsdb-server` and `ovs-vswitchd`, creates a bridge `br0`, and allows for additional `ovs-vsctl` commands. Use `=override` as the third argument to enable 'system' devices. ```shell OVS_TRAFFIC_VSWITCHD_START([vsctl-args], [vsctl-output], [=override]) ``` -------------------------------- ### Start OVN Cluster Mode Containers (Node 1) Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Initiate OVN cluster mode on the first node by running `ovn-nb-cluster-create`, `ovn-sb-cluster-create`, and `ovn-northd-cluster` Docker containers. Configure host IP, database ports, and specify the database connection strings for all nodes. ```bash $ docker run -e "host_ip=" -e "nb_db_port=" -itd \ --name=ovn-nb-raft --net=host --privileged : \ ovn-nb-cluster-create $ docker run -e "host_ip=" -e "sb_db_port=" -itd \ --name=ovn-sb-raft --net=host --privileged : \ ovn-sb-cluster-create $ docker run -e "OVN_NB_DB=tcp::6641,tcp::6641,\n tcp::6641" -e "OVN_SB_DB=tcp::6642,tcp::6642,\n tcp::6642" -itd --name=ovn-northd-raft : \ ovn-northd-cluster ``` -------------------------------- ### Start OVN Interconnection Services Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Start the OVN Interconnection (OVN IC) databases and daemon if OVN IC is used in the deployment. ```bash $ ovn-ctl start_ic_ovsdb $ ovn-ctl start_ic ``` -------------------------------- ### Start Simulated OVN Instance Source: https://github.com/ovn-org/ovn/blob/main/Documentation/topics/test-development.md Use `sim_add` to create a new simulated Open vSwitch instance. Subsequent commands can then be run within this instance's context using the `as` command. ```shell sim_add hv0 # Create sandbox hv0. as hv0 # Set hv0 as default sandbox. ovs-vsctl add-br br0 # Add bridge br0 inside hv0. ``` ```shell sim_add hv0 as hv0 ovs-vsctl add-br br0 ``` -------------------------------- ### Create SSH Keypair for VMs Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md Creates an SSH keypair named 'demo' and saves the private key to ~/id_rsa_demo. Ensure the private key has restricted permissions. ```bash $ openstack keypair create demo > ~/id_rsa_demo $ chmod 600 ~/id_rsa_demo ``` -------------------------------- ### Install OVN Central Node Package Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/debian.md Installs the OVN central node components, including OVN databases and ovn-northd, using apt-get. ```bash $ sudo apt-get install ovn-central ``` -------------------------------- ### Start OVN Northbound Daemon Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Start the `ovn-northd` daemon, specifying connection to OVN DB servers via Unix domain socket. ```bash $ ovn-northd --pidfile --detach --log-file ``` -------------------------------- ### Prepare OVN Submodules and Configure OVN Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/documentation.md Updates OVN submodules, configures the OVS submodule, and then configures the main OVN project before building documentation. ```bash $ git submodule update --init $ cd ovs $ ./boot.sh && ./configure $ cd .. $ ./boot.sh && ./configure ``` -------------------------------- ### Graphic Table Example in reStructuredText Source: https://github.com/ovn-org/ovn/blob/main/Documentation/internals/contributing/documentation-style.md This example demonstrates how to create a graphic table in reStructuredText for displaying structured data. The table role can be omitted. ```rst .. table:: OVS-Linux kernel compatibility ============ ============== Open vSwitch Linux kernel ============ ============== 1.4.x 2.6.18 to 3.2 1.5.x 2.6.18 to 3.2 1.6.x 2.6.18 to 3.2 ============ ============== ``` -------------------------------- ### Configure Guest Architecture in local.conf Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md If using a 32-bit i386 guest, specify the CIRROS_ARCH in local.conf. This ensures compatibility with the guest environment. ```default CIRROS_ARCH=i386 ``` -------------------------------- ### Add Swap Space in VM (Shell) Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md Use these commands to add 2GB of swap space to a VM with limited RAM, preventing out-of-memory errors during DevStack setup. Ensure to update /etc/fstab for persistence. ```shell $ sudo dd if=/dev/zero of=/swapfile bs=1M count=2048 $ sudo mkswap /swapfile $ sudo swapon /swapfile ``` ```shell /swapfile swap swap defaults 0 0 ``` -------------------------------- ### Start OVSDB Southbound Relay and Connect to Cluster Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-ovsdb-relay.md Starts the OVSDB Southbound Relay and connects it to the OVSDB cluster. Ensure SSL certificates are correctly configured. ```bash /usr/share/ovn/scripts/ovn-ctl start_sb_relay_ovsdb \ --db-sb-relay-remote=tcp:127.0.0.1:16642 \ --ovn-sb-relay-db-ssl-key=/path/to/ovsdb/relay/ssl-key.pem \ --ovn-sb-relay-db-ssl-cert=/path/to/ovsdb/relay/ssl-cert.pem \ --ovn-sb-relay-db-ssl-ca-cert=/path/to/ovsdb/relay/ssl-ca-cert.pem ``` -------------------------------- ### Create Logical Topology for Gateway Router Source: https://github.com/ovn-org/ovn/blob/main/Documentation/topics/dynamic-routing/configuration-examples.md Sets up the basic logical router and switch infrastructure for a gateway scenario. Includes router ports for internal and fabric networks, and a localnet port for physical connectivity. ```bash $ ovn-nbctl lr-add lr-gw $ ovn-nbctl ls-add ls-internal $ ovn-nbctl ls-add ls-fabric # Router port toward the internal network. $ ovn-nbctl lrp-add lr-gw lrp-internal \ 00:00:00:00:00:01 10.0.0.1/24 $ ovn-nbctl lsp-add-router-port ls-internal \ lsp-internal-to-gw lrp-internal # Router port toward the fabric. $ ovn-nbctl lrp-add lr-gw lrp-fabric \ 00:00:00:00:00:02 192.168.1.1/24 $ ovn-nbctl lsp-add-router-port ls-fabric \ lsp-fabric-to-gw lrp-fabric # Localnet port for physical connectivity. $ ovn-nbctl lsp-add-localnet-port ls-fabric \ lsp-fabric-ln physnet-fabric ``` -------------------------------- ### Start Last-Level OVSDB Relay in Two-Tier Multi-Group Deployment Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-ovsdb-relay.md Starts the last-level OVSDB Relay servers that ovn-controllers will connect to. SSL certificates are required for secure communication. ```bash /usr/share/ovn/scripts/ovn-ctl start_sb_relay_ovsdb \ --db-sb-relay-remote=tcp:127.0.0.1:26642 \ --ovn-sb-relay-db-ssl-key=/path/to/ovsdb/relay/ssl-key.pem \ --ovn-sb-relay-db-ssl-cert=/path/to/ovsdb/relay/ssl-cert.pem \ --ovn-sb-relay-db-ssl-ca-cert=/path/to/ovsdb/relay/ssl-ca-cert.pem ``` -------------------------------- ### Initialize OVN Databases Source: https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.md Initialize the OVN Northbound and Southbound databases. This is typically done once after creating the databases. ```bash $ ovn-nbctl --no-wait init $ ovn-sbctl init ``` -------------------------------- ### Start OVSDB Southbound Relay with SSL/TLS Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-ovsdb-relay.md Starts the OVSDB Southbound Relay using SSL/TLS for communication with the cluster and configures ovn-controller to connect to the relay via SSL/TLS. ```bash # start OVSDB Southbound Relay and connect to cluster /usr/share/ovn/scripts/ovn-ctl start_sb_relay_ovsdb \ --db-sb-relay-remote=tcp:127.0.0.1:16642 \ --ovn-sb-relay-db-ssl-key=/path/to/ovsdb/relay/ssl-key.pem \ --ovn-sb-relay-db-ssl-cert=/path/to/ovsdb/relay/ssl-cert.pem \ --ovn-sb-relay-db-ssl-ca-cert=/path/to/ovsdb/relay/ssl-ca-cert.pem \ -- --remote=pssl:6642 # start ovn-controller and connect to OVSDB Relay ovs-vsctl set external_ids:ovn-remote="ssl:127.0.0.1:6642" ovs-vsctl set-ssl <...> /usr/share/ovn/scripts/ovn-ctl start_controller ``` -------------------------------- ### Create and Configure Router Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md Commands to create an OpenStack router and attach it to existing subnets. ```bash $ openstack router create r $ openstack router add subnet r n1subnet $ openstack router add subnet r n2subnet ``` -------------------------------- ### OVN Logical Flow Example Source: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-openstack.md Example of an OVN logical flow entry, showing table, priority, match conditions, and actions. This is obtained using `ovn-sbctl lflow-list`. ```text Datapath: "neutron-5b6baf" aka "n1" (a8a758) Pipeline: ingress table=0 (ls_in_port_sec_l2 ), priority=50 , match=(inport == "820c08" && eth.src == {fa:16:3e:a9:4c:c7}), action=(next;) ```