Este contenido no está disponible en el idioma seleccionado.
Chapter 4. Monitoring OVN
You can use the ovn-trace command to monitor and troubleshoot OVN logical flows, and you can use the ovs-ofctl dump-flows command to monitor and troubleshoot OpenFlows.
4.1. Creating aliases for OVN troubleshooting commands Copiar enlaceEnlace copiado en el portapapeles!
OVN database commands (such as ovn-nbctl show) run on the ovn_controller container. The container runs on the controller node and compute nodes. To simplify your access to the commands, create and source a script that defines aliases.
Prerequisites
- Deployment of Red Hat OpenStack Platform 13 with ML2/OVN as the mechanism driver.
Creating and using OVN database command aliases
- Create a shell script file in the appropriate directory on the overcloud node where you want to run the ovn commands. For example, log in to the controller node as heat-admin and create the file ovn-alias.sh in the heat-admin user’s ~/bin directory.
Save the following commands in the script file.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Source the script file. For example, log in to the controller node as heat-admin and run the following command.
source ovn-alias.sh
# source ovn-alias.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow Validate an alias. For example, show the northbound database.
ovn-nbctl show
ovn-nbctl showCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2. Monitoring OVN logical flows Copiar enlaceEnlace copiado en el portapapeles!
OVN uses logical flows that are tables of flows with a priority, match, and actions. These logical flows are distributed to the ovn-controller running on each Compute node. You can use the ovn-sbctl lflow-list command on the Controller node to view the full set of logical flows, as shown in this example.
Key differences between OVN and OpenFlow include:
- OVN ports are logical entities that reside somewhere on a network, not physical ports on a single switch.
- OVN gives each table in the pipeline a name in addition to its number. The name describes the purpose of that stage in the pipeline.
- The OVN match syntax supports complex Boolean expressions.
- The actions supported in OVN logical flows extend beyond those of OpenFlow. You can implement higher level features, such as DHCP, in the OVN logical flow syntax.
ovn-trace
The ovn-trace command can simulate how a packet travels through the OVN logical flows, or help you determine why a packet is dropped. Provide the ovn-trace command with the following parameters:
- DATAPATH
- The logical switch or logical router where the simulated packet starts.
- MICROFLOW
-
The simulated packet, in the syntax used by the
ovn-sbdatabase.
This example displays the --minimal output option on a simulated packet and shows that the packet reaches its destination:
ovn-trace --minimal sw0 'inport == "sw0-port1" && eth.src == 00:00:00:00:00:01 && eth.dst == 00:00:00:00:00:02'
$ ovn-trace --minimal sw0 'inport == "sw0-port1" && eth.src == 00:00:00:00:00:01 && eth.dst == 00:00:00:00:00:02'
# reg14=0x1,vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,dl_type=0x0000
output("sw0-port2");
In more detail, the --summary output for this same simulated packet shows the full execution pipeline:
The example output shows:
-
The packet enters the
sw0network from thesw0-port1port and runs the ingress pipeline. -
The outport variable is set to
sw0-port2indicating that the intended destination for this packet issw0-port2. -
The packet is output from the ingress pipeline, which brings it to the egress pipeline for
sw0with the outport variable set tosw0-port2. -
The output action is executed in the egress pipeline, which outputs the packet to the current value of the outport variable, which is
sw0-port2.
See the ovn-trace man page for complete details.
4.3. Monitoring OpenFlows Copiar enlaceEnlace copiado en el portapapeles!
You can use ovs-ofctl dump-flows command to monitor the OpenFlow flows on a logical switch in your network.