How to enable DEBUG in OVN Controller?

Solution Verified - Updated -

Environment

  • Red Hat OpenStack Platform 16.2
  • Red Hat OpenStack Platform 17.0

Issue

  • In OVN based environment, how to enable DEBUG in OVN Controller?

Resolution

  • ForOVN level debugging, it uses native OVN built-in logging to enable debug for OVN module.

  • The ovn-controller service runs in a container, so it is required to set the DEBUG option inside the container.

  • Verify the status of ovn_controller container status and it should be UP state.

    # podman ps | grep ovn_controller
    e4163cdd502b  registry-proxy.engineering.redhat.com/rh-osbs/rhosp16-openstack-ovn-controller:16.2_20220603.1              kolla_start           5 days ago  Up 5 days ago          ovn_controller
    
  • Inside the container, verify list-commands offered for ovn-controller.

    # 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.

    # 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 available debug option for ovn-controller.

    # 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
    
  • As such a syntax of ovn-appctl to customize vlog is as follows:

    ovn-appctl vlog/set module:facility:level
    
  • Sample example to verify OVN module chassis.

    # podman exec -it -u root ovn_controller ovn-appctl vlog/list | grep chassis
    chassis           INFO       INFO       INFO
    
  • Sample example to enable debug for OVN chassis module.

    podman exec -it -u root ovn_controller ovn-appctl vlog/set chassis:file:dbg
    
  • Review the debug log from 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
    
  • Sample example to disable debug for OVN chassis module.

    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