How to enable DEBUG in OVN Controller
Environment
- Red Hat OpenStack Platform (RHOSP) 16.2
- Red Hat OpenStack Platform (RHOSP) 17.0
- Red Hat OpenStack Platform (RHOSP) 17.1
Issue
- In a deployment that uses the OVN mechanism driver, how can I enable DEBUG in OVN Controller?
Resolution
You can choose from these alternate methods for enabling DEBUG in OVN Controller:
Method 1: Use Ansible playbooks. This approach was added to make the task easier. In most cases it provides better results.
Method 2: Use a manual procedure. This is the approach first published with this article. Use it if the Automated with Ansible approach is not appropriate for your situation.
METHOD 1: Use Ansible playbooks to enable DEBUG in OVN controller
-
Get the playbook:
[stack@director ~]$ mkdir -p ~/playbooks && curl -so ~/playbooks/ovn-debug.yaml https://raw.githubusercontent.com/enothen/rhosp-tools/refs/heads/main/playbooks/ovn-debug.yaml [stack@director ~]$
-
In RHOSP 16.2, create an inventory file (if not created yet). This task is not required in RHOSP 17.1, because a default inventory can be used.
[stack@director.test.lab ~]$ source stackrc (undercloud) [stack@director.test.lab ~]$ tripleo-ansible-inventory --static-yaml-inventory ~/inventory.yaml (undercloud) [stack@director.test.lab ~]$
-
Run the playbook using either the inventory created in the previous step, or in case of RHOSP 17.1, the default inventory. Use
-l
to limit nodes where to enable debug. Otherwise, the playbook will enable debug in all overcloud nodes (except nodes with role CephStorage):(undercloud) [stack@director ~]$ ansible-playbook -i /home/stack/overcloud-deploy/overcloud/tripleo-ansible-inventory.yaml playbooks/ovn-debug.yaml -l overcloud-controller-0 [WARNING]: Could not match supplied host pattern, ignoring: CephStorage PLAY [This playbook enables/disables debug in ovn_controller and ovs-vswitchd] *************************************** TASK [Enable/Disable debug in ovn_controller modules] **************************************************************** changed: [overcloud-controller-0] => (item=binding) changed: [overcloud-controller-0] => (item=chassis) changed: [overcloud-controller-0] => (item=encaps) changed: [overcloud-controller-0] => (item=if_status) changed: [overcloud-controller-0] => (item=inc_proc_eng) changed: [overcloud-controller-0] => (item=lport) changed: [overcloud-controller-0] => (item=main) changed: [overcloud-controller-0] => (item=ofctrl) changed: [overcloud-controller-0] => (item=physical) changed: [overcloud-controller-0] => (item=pinctrl) TASK [Enable/Disable debug in ovs-vswitchd modules] ****************************************************************** changed: [overcloud-controller-0] => (item=bridge) changed: [overcloud-controller-0] => (item=flow) changed: [overcloud-controller-0] => (item=vswitchd) PLAY RECAP *********************************************************************************************************** overcloud-controller-0 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
-
Verify changes running the playbook again, this time with
--tags display
:(undercloud) [stack@director ~]$ ansible-playbook -i /home/stack/overcloud-deploy/overcloud/tripleo-ansible-inventory.yaml playbooks/ovn-debug.yaml -l overcloud-controller-0 --tags display [WARNING]: Could not match supplied host pattern, ignoring: CephStorage PLAY [This playbook enables/disables debug in ovn_controller and ovs-vswitchd] *************************************** TASK [Get ovn modules in debug] ************************************************************************************** changed: [overcloud-controller-0] TASK [Display ovn modules in debug] ********************************************************************************** ok: [overcloud-controller-0] => { "ovn_output.stdout_lines": [ " console syslog file", " ------- ------ ------", "binding INFO INFO DBG", "chassis INFO INFO DBG", "encaps INFO INFO DBG", "if_status INFO INFO DBG", "inc_proc_eng INFO INFO DBG", "lport INFO INFO DBG", "main INFO INFO DBG", "ofctrl INFO INFO DBG", "physical INFO INFO DBG", "pinctrl INFO INFO DBG" ] } TASK [Get ovs modules in debug] ************************************************************************************** changed: [overcloud-controller-0] TASK [Display ovs modules in debug] ********************************************************************************** ok: [overcloud-controller-0] => { "ovs_output.stdout_lines": [ " console syslog file", " ------- ------ ------", "bridge OFF ERR DBG", "flow OFF ERR DBG", "vswitchd OFF ERR DBG" ] } PLAY RECAP *********************************************************************************************************** overcloud-controller-0 : ok=4 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
-
When troubleshooting is complete, disable debug by reverting the modules back to the default level of “INFO”:
(undercloud) [stack@director ~]$ ansible-playbook -i /home/stack/overcloud-deploy/overcloud/tripleo-ansible-inventory.yaml playbooks/ovn-debug.yaml -l overcloud-controller-0 -e 'mode=INFO' [WARNING]: Could not match supplied host pattern, ignoring: CephStorage PLAY [This playbook enables/disables debug in ovn_controller and ovs-vswitchd] *************************************** TASK [Enable/Disable debug in ovn_controller modules] **************************************************************** changed: [overcloud-controller-0] => (item=binding) changed: [overcloud-controller-0] => (item=chassis) changed: [overcloud-controller-0] => (item=encaps) changed: [overcloud-controller-0] => (item=if_status) changed: [overcloud-controller-0] => (item=inc_proc_eng) changed: [overcloud-controller-0] => (item=lport) changed: [overcloud-controller-0] => (item=main) changed: [overcloud-controller-0] => (item=ofctrl) changed: [overcloud-controller-0] => (item=physical) changed: [overcloud-controller-0] => (item=pinctrl) TASK [Enable/Disable debug in ovs-vswitchd modules] ****************************************************************** changed: [overcloud-controller-0] => (item=bridge) changed: [overcloud-controller-0] => (item=flow) changed: [overcloud-controller-0] => (item=vswitchd) PLAY RECAP *********************************************************************************************************** overcloud-controller-0 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
EXAMPLE: customizing the list of modules through Ansible extra-vars
-
Setting: It is possible to customize the list of modules for which to change the output level to debug, using Ansible extra vars
ovn_modules
andovs_modules
. Note that both of them need to be defined as lists. For example:[stack@director.test.lab ~]$ ansible-playbook -i inventory.yaml playbooks/ovn-debug.yaml -l overcloud-controller-0 -e '{"ovn_modules": [binding, chassis, encaps], "ovs_modules": [bridge, vswitchd] }' PLAY [This playbook enables/disables debug in ovn_controller containers] ********************************************************* Saturday 01 February 2025 12:35:25 +0100 (0:00:00.063) 0:00:00.063 ***** Saturday 01 February 2025 12:35:25 +0100 (0:00:00.062) 0:00:00.062 ***** TASK [Enable/Disable debug in ovn_controller modules] **************************************************************************** changed: [overcloud-controller-0] => (item=binding) changed: [overcloud-controller-0] => (item=chassis) changed: [overcloud-controller-0] => (item=encaps) Saturday 01 February 2025 12:35:27 +0100 (0:00:02.385) 0:00:02.448 ***** Saturday 01 February 2025 12:35:27 +0100 (0:00:02.386) 0:00:02.448 ***** TASK [Enable/Disable debug in ovs-vswitchd modules] ****************************************************************************** changed: [overcloud-controller-0] => (item=bridge) changed: [overcloud-controller-0] => (item=vswitchd) PLAY RECAP *********************************************************************************************************************** overcloud-controller-0 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Saturday 01 February 2025 12:35:28 +0100 (0:00:00.740) 0:00:03.189 ***** =============================================================================== command ----------------------------------------------------------------- 3.13s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ total ------------------------------------------------------------------- 3.13s Saturday 01 February 2025 12:35:28 +0100 (0:00:00.740) 0:00:03.189 ***** =============================================================================== Enable/Disable debug in ovn_controller modules ---------------------------------------------------------------------------- 2.39s Enable/Disable debug in ovs-vswitchd modules ------------------------------------------------------------------------------ 0.74s Playbook run took 0 days, 0 hours, 0 minutes, 3 seconds
-
Displaying:
[stack@director.test.lab ~]$ ansible-playbook -i inventory.yaml playbooks/ovn-debug.yaml -l overcloud-controller-0 --tags display PLAY [This playbook enables/disables debug in ovn_controller containers] ********************************************************* Saturday 01 February 2025 12:36:02 +0100 (0:00:00.064) 0:00:00.064 ***** Saturday 01 February 2025 12:36:02 +0100 (0:00:00.064) 0:00:00.064 ***** TASK [Get ovn modules in debug] ************************************************************************************************** changed: [overcloud-controller-0] Saturday 01 February 2025 12:36:03 +0100 (0:00:01.510) 0:00:01.575 ***** Saturday 01 February 2025 12:36:03 +0100 (0:00:01.510) 0:00:01.575 ***** TASK [Display ovn modules in debug] ********************************************************************************************** ok: [overcloud-controller-0] => { "ovn_output.stdout_lines": [ " console syslog file", " ------- ------ ------", "binding INFO INFO DBG", "chassis INFO INFO DBG", "encaps INFO INFO DBG" ] } Saturday 01 February 2025 12:36:03 +0100 (0:00:00.123) 0:00:01.698 ***** Saturday 01 February 2025 12:36:03 +0100 (0:00:00.123) 0:00:01.698 ***** TASK [Get ovs modules in debug] ************************************************************************************************** changed: [overcloud-controller-0] Saturday 01 February 2025 12:36:04 +0100 (0:00:00.392) 0:00:02.091 ***** Saturday 01 February 2025 12:36:04 +0100 (0:00:00.392) 0:00:02.091 ***** TASK [Display ovs modules in debug] ********************************************************************************************** ok: [overcloud-controller-0] => { "ovs_output.stdout_lines": [ " console syslog file", " ------- ------ ------", "bridge OFF ERR DBG", "vswitchd OFF ERR DBG" ] } PLAY RECAP *********************************************************************************************************************** overcloud-controller-0 : ok=4 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Saturday 01 February 2025 12:36:04 +0100 (0:00:00.119) 0:00:02.211 ***** =============================================================================== shell ------------------------------------------------------------------- 1.90s debug ------------------------------------------------------------------- 0.24s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ total ------------------------------------------------------------------- 2.15s Saturday 01 February 2025 12:36:04 +0100 (0:00:00.119) 0:00:02.210 ***** =============================================================================== Get ovn modules in debug -------------------------------------------------------------------------------------------------- 1.51s Get ovs modules in debug -------------------------------------------------------------------------------------------------- 0.39s Display ovn modules in debug ---------------------------------------------------------------------------------------------- 0.12s Display ovs modules in debug ---------------------------------------------------------------------------------------------- 0.12s Playbook run took 0 days, 0 hours, 0 minutes, 2 seconds
-
Rolling back: Use the ansible extra var
mode=INFO
to rollback the changes fromDBG
toINFO
(default). If you previously added a list of customovn_modules
, also include the same list when rolling back:[stack@director.test.lab ~]$ ansible-playbook -i inventory.yaml playbooks/ovn-debug.yaml -l overcloud-controller-0 -e '{"ovn_modules": [binding, chassis, encaps], "ovs_modules": [bridge, vswitchd], mode="INFO" }' PLAY [This playbook enables/disables debug in ovn_controller containers] ********************************************************* Saturday 01 February 2025 12:36:40 +0100 (0:00:00.071) 0:00:00.071 ***** Saturday 01 February 2025 12:36:40 +0100 (0:00:00.070) 0:00:00.070 ***** TASK [Enable/Disable debug in ovn_controller modules] **************************************************************************** changed: [overcloud-controller-0] => (item=binding) changed: [overcloud-controller-0] => (item=chassis) changed: [overcloud-controller-0] => (item=encaps) Saturday 01 February 2025 12:36:42 +0100 (0:00:01.942) 0:00:02.013 ***** Saturday 01 February 2025 12:36:42 +0100 (0:00:01.942) 0:00:02.012 ***** TASK [Enable/Disable debug in ovs-vswitchd modules] ****************************************************************************** changed: [overcloud-controller-0] => (item=bridge) changed: [overcloud-controller-0] => (item=vswitchd) PLAY RECAP *********************************************************************************************************************** overcloud-controller-0 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Saturday 01 February 2025 12:36:43 +0100 (0:00:00.627) 0:00:02.640 ***** =============================================================================== command ----------------------------------------------------------------- 2.57s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ total ------------------------------------------------------------------- 2.57s Saturday 01 February 2025 12:36:43 +0100 (0:00:00.627) 0:00:02.640 ***** =============================================================================== Enable/Disable debug in ovn_controller modules ---------------------------------------------------------------------------- 1.94s Enable/Disable debug in ovs-vswitchd modules ------------------------------------------------------------------------------ 0.63s Playbook run took 0 days, 0 hours, 0 minutes, 2 seconds
METHOD 2: Use manual procedure to enable DEBUG in OVN controller
- The ovn-controller
service runs in a container, so you must set the DEBUG
option inside the container.
-
Verify the status of
tripleo_ovn_controller
service isActive
:# systemctl is-active tripleo_ovn_controller active
-
Inside the container, use
ovn-appctl
to verifylist-commands
offered forovn-controller
.ovn-appctl
is a tool for communicating with running OVN services such as ovn-controller and ovn-northd. Note that in the output, the set of commands that begin withvlog
are used to configure the logging mechanism of OVN services.# podman exec -it -u root ovn_controller ovn-appctl list-commands The available commands are: connection-status coverage/read-counter COUNTER coverage/show ct-zone-list debug/delay-nb-cfg-report SECONDS debug/dump-lflow-conj-ids debug/dump-local-bindings debug/pause debug/resume debug/status dpif-netlink/dispatch-mode exit flush-lflow-cache [deprecated] group-table-list inc-engine/clear-stats inc-engine/recompute inc-engine/show-stats inject-pkt MICROFLOW lflow-cache/flush lflow-cache/show-stats list-commands memory/show meter-table-list recompute [deprecated] sb-cluster-state-reset stopwatch/reset [NAME] stopwatch/show [NAME] tnl/egress_port_range min max version vlog/close vlog/disable-rate-limit [module]... vlog/enable-rate-limit [module]... vlog/list vlog/list-pattern vlog/reopen vlog/set {spec | PATTERN:destination:pattern}
-
Verify the logging pattern for
ovn-controller
.
Note that each 'ovn-controller` module has its own logging configuration. You can enable logging for all modules or for specific modules. Generally it is better to enable logging for specific modules, because logging for all modules makes it difficult to find the information you need. Engineering can help you decide which module logs to enable for a specific case or problem.# podman exec -it -u root ovn_controller ovn-appctl vlog/list-pattern prefix format ------ ------ SYSLOG <%B> %D{%h %e %T} %E %A: ovs|%05N|%c%T|%p|%m CONSOLE none %D{%Y-%m-%dT%H:%M:%SZ}|%05N|%c%T|%p|%m FILE none %D{%Y-%m-%dT%H:%M:%S.###Z}|%05N|%c%T|%p|%m
-
Review the list of
ovn-controller
modules that are available for configuration:# podman exec -it -u root ovn_controller ovn-appctl vlog/list console syslog file ------- ------ ------ acl_log INFO INFO INFO actions INFO INFO INFO backtrace INFO INFO INFO binding INFO INFO INFO bundle INFO INFO INFO chassis INFO INFO INFO command_line INFO INFO INFO conntrack INFO INFO INFO conntrack_tp INFO INFO INFO coverage INFO INFO INFO ct_dpif INFO INFO INFO daemon INFO INFO INFO daemon_unix INFO INFO INFO dns_resolve INFO INFO INFO dpdk INFO INFO INFO dpif INFO INFO INFO dpif_lookup_autovalidator INFO INFO INFO dpif_lookup_generic INFO INFO INFO dpif_mfex_extract_study INFO INFO INFO dpif_netdev INFO INFO INFO dpif_netdev_extract INFO INFO INFO dpif_netdev_impl INFO INFO INFO dpif_netdev_lookup INFO INFO INFO dpif_netlink INFO INFO INFO dpif_netlink_rtnl INFO INFO INFO encaps INFO INFO INFO entropy INFO INFO INFO expr INFO INFO INFO extend_table INFO INFO INFO fatal_signal INFO INFO INFO features INFO INFO INFO flow INFO INFO INFO ha_chassis INFO INFO INFO hmap INFO INFO INFO if_status INFO INFO INFO inc_proc_eng INFO INFO INFO ipf INFO INFO INFO jsonrpc INFO INFO INFO lb INFO INFO INFO ldata INFO INFO INFO lflow INFO INFO INFO lflow_cache INFO INFO INFO lockfile INFO INFO INFO lport INFO INFO INFO mac_learn INFO INFO INFO main INFO INFO INFO memory INFO INFO INFO meta_flow INFO INFO INFO native_tnl INFO INFO INFO netdev INFO INFO INFO netdev_linux INFO INFO INFO netdev_offload INFO INFO INFO netdev_offload_tc INFO INFO INFO netdev_vport INFO INFO INFO netlink INFO INFO INFO netlink_conntrack INFO INFO INFO netlink_notifier INFO INFO INFO netlink_socket INFO INFO INFO nx_match INFO INFO INFO odp_execute INFO INFO INFO odp_util INFO INFO INFO ofctrl INFO INFO INFO ofp_actions INFO INFO INFO ofp_bundle INFO INFO INFO ofp_connection INFO INFO INFO ofp_errors INFO INFO INFO ofp_flow INFO INFO INFO ofp_group INFO INFO INFO ofp_match INFO INFO INFO ofp_meter INFO INFO INFO ofp_monitor INFO INFO INFO ofp_msgs INFO INFO INFO ofp_packet INFO INFO INFO ofp_port INFO INFO INFO ofp_protocol INFO INFO INFO ofp_queue INFO INFO INFO ofp_table INFO INFO INFO ofp_util INFO INFO INFO ovn_bfd INFO INFO INFO ovn_util INFO INFO INFO ovs_numa INFO INFO INFO ovs_rcu INFO INFO INFO ovs_replay INFO INFO INFO ovs_router INFO INFO INFO ovs_thread INFO INFO INFO ovsdb_cs INFO INFO INFO ovsdb_error INFO INFO INFO ovsdb_idl INFO INFO INFO ovsport INFO INFO INFO ox_stat INFO INFO INFO patch INFO INFO INFO physical INFO INFO INFO pinctrl INFO INFO INFO pmd_perf INFO INFO INFO poll_loop INFO INFO INFO process INFO INFO INFO rconn INFO INFO INFO reconnect INFO INFO INFO route_table INFO INFO INFO signals INFO INFO INFO socket_util INFO INFO INFO socket_util_unix INFO INFO INFO stopwatch INFO INFO INFO stream INFO INFO INFO stream_fd INFO INFO INFO stream_replay INFO INFO INFO stream_ssl INFO INFO INFO stream_tcp INFO INFO INFO stream_unix INFO INFO INFO svec INFO INFO INFO tc INFO INFO INFO timeval INFO INFO INFO unixctl INFO INFO INFO userspace_tso INFO INFO INFO util INFO INFO INFO uuid INFO INFO INFO vconn INFO INFO INFO vconn_stream INFO INFO INFO vif_plug INFO INFO INFO vif_plug_dummy INFO INFO INFO vif_plug_provider INFO INFO INFO vlog INFO INFO INFO
-
Use the following
ovn-appctl
syntax to customize vlog:ovn-appctl vlog/set module:facility:level
Values for
facility
includekern, user, mail, daemon, auth, syslog, lpr, news, uucp, clock, ftp, ntp, audit, alert, clock2, local0, local1, local2, local3, local4, local5, local6 and local7.
Values forlevel
include:off, emer, err, warn, info, dbg.
For more information, see https://man7.org/linux/man-pages/man8/ovn-appctl.8.html. -
Example 1: verify OVN module
chassis
.# podman exec -it -u root ovn_controller ovn-appctl vlog/list | grep chassis chassis INFO INFO INFO
-
Example 2: enable debug for OVN
chassis
module. Before using this command, note the previous settings so you can restore them.
Note that this is just a sample command. Each case or problem might require looking at a different set of modules.
Note that changes to logging configurations are not persistent across service restarts. They are reset after a service restart.podman exec -it -u root ovn_controller ovn-appctl vlog/set chassis:file:dbg
-
Review the debug log from the following
/var/log/containers/openvswitch/ovn-controller.log
location.2022-08-22T08:38:49.845Z|17330|inc_proc_eng|DBG|controller/ovn-controller.c:975: node: SB_chassis, old_state Stale, new_state Unchanged 2022-08-22T08:38:49.845Z|17368|inc_proc_eng|DBG|lib/inc-proc-eng.c:323: node: SB_chassis, old_state Unchanged, new_state Stale 2022-08-22T08:38:49.845Z|17399|inc_proc_eng|DBG|controller/ovn-controller.c:975: node: SB_chassis, old_state Stale, new_state Unchanged 2022-08-22T08:38:49.974Z|17433|inc_proc_eng|DBG|lib/inc-proc-eng.c:323: node: SB_chassis, old_state Unchanged, new_state Stale 2022-08-22T08:38:49.974Z|17464|inc_proc_eng|DBG|controller/ovn-controller.c:975: node: SB_chassis, old_state Stale, new_state Unchanged
-
Example of how to disable debug for OVN
chassis
module. Note: to prevent excessive logging and storage of debug messages, you should disable the debug mode when you are done collecting data.podman exec -it -u root ovn_controller ovn-appctl vlog/set chassis:file:info
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments