failed to run "ovs-appctl or ovs-dpctl" command in openvswitch container

Bug #1697570 reported by MarginHu
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
kolla
Fix Released
Low
Michal Nasiadka
Train
Fix Released
Low
Michal Nasiadka

Bug Description

Hi Guys:

"ovs-appctl" is import tools for trace packet flow about openvswitch (refer:http://therandomsecurityguy.com/openvswitch-cheat-sheet/), but I found I
failed to run "ovs-appctl or ovs-dpctl" command in openvswitch container.

[root@cloud-sz-compute-f19-01 openvswitch]# docker exec -it -u root --privileged openvswitch_vswitchd bash

(openvswitch-vswitchd)[root@cloud-sz-compute-f19-01 openvswitch]# ovs-appctl show
2017-06-13T00:36:30Z|00001|daemon_unix|WARN|/var/run/openvswitch/ovs-vswitchd.pid: open: No such file or directory
ovs-appctl: cannot read pidfile "/var/run/openvswitch/ovs-vswitchd.pid" (No such file or directory)

Revision history for this message
Eduardo Gonzalez (egonzalez90) wrote :

Need to select the target for appctl commands:

[root@compute1 ~]# docker exec openvswitch_vswitchd ls /var/run/openvswitch/
db.sock
ovs-vswitchd.5.ctl
ovsdb-server.12.ctl
ovsdb-server.14.ctl
[root@compute1 ~]# docker exec openvswitch_vswitchd ovs-appctl -t /var/run/openvswitch/ovsdb-server.14.ctl memory/show
cells:16 json-caches:1 monitors:1 sessions:1

Revision history for this message
Eduardo Gonzalez (egonzalez90) wrote :

dpctl commands works fine without target.

[root@compute1 ~]# docker exec openvswitch_vswitchd ovs-dpctl show
system@ovs-system:
 lookups: hit:133 missed:72 lost:0
 flows: 0
 masks: hit:315 total:1 hit/pkt:1.54
 port 0: ovs-system (internal)
 port 1: br-int (internal)
 port 2: br-tun (internal)

Revision history for this message
Eduardo Gonzalez (egonzalez90) wrote :

To avoid having to use targets, can add into ovs containers startup commands:
--pidfile=/var/run/openvswitch/ovs-vswitchd.pid

This works, however i'm not sure about if this can cause issues. Will need to investigate more.

Revision history for this message
MarginHu (margin2017) wrote :

thanks, it works well after add "--pidfile=/var/run/openvswitch/ovs-vswitchd.pid" .

Revision history for this message
sean mooney (sean-k-mooney) wrote :

if we create a pid file we may need to have the same pid namespace between
nova-compute(for os-vif to do pluging)
neutron-openvsiwtch-agent
neutron-l3-agent
neutron-dhcp-agent
openvswitch_vswitchd
openvswitch_db

otherwise the pid file will only work in the
openvswitch_vswitchd

also if you are in the openvswitch_vswitchd container
this ovs-vsctl,ovs-ofctl and ovs-dpctl should already work without
the target or pid file being specifed so its only ovs-appctl that is not working.

Changed in kolla:
status: New → Invalid
Changed in kolla:
status: Invalid → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

Fix proposed to branch: master
Review: https://review.opendev.org/668630

Changed in kolla:
assignee: nobody → Michal Nasiadka (mnasiadka)
status: Confirmed → In Progress
Changed in kolla:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (master)

Reviewed: https://review.opendev.org/668630
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=0ec7017f7a358553158dc927285ab9f4af1a641a
Submitter: Zuul
Branch: master

commit 0ec7017f7a358553158dc927285ab9f4af1a641a
Author: Michal Nasiadka <email address hidden>
Date: Tue Jul 2 10:11:02 2019 +0200

    Fix ovs-appctl by adding --pidfile to ovsdb command.

    Change-Id: I8927ce98d669480866d6fcddaf7b08ef3cbbc37e
    Closes-Bug: #1697570

Changed in kolla:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/677385

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/677386

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/677387

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (stable/stein)

Reviewed: https://review.opendev.org/677385
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=0e78cbb84c895eb14d8d6e63989d6cfc88474b98
Submitter: Zuul
Branch: stable/stein

commit 0e78cbb84c895eb14d8d6e63989d6cfc88474b98
Author: Michal Nasiadka <email address hidden>
Date: Tue Jul 2 10:11:02 2019 +0200

    Fix ovs-appctl by adding --pidfile to ovsdb command.

    Change-Id: I8927ce98d669480866d6fcddaf7b08ef3cbbc37e
    Closes-Bug: #1697570
    (cherry picked from commit 0ec7017f7a358553158dc927285ab9f4af1a641a)

tags: added: in-stable-stein
tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (stable/rocky)

Reviewed: https://review.opendev.org/677386
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=fc806d33a8601059455790527782989dbb2f56e9
Submitter: Zuul
Branch: stable/rocky

commit fc806d33a8601059455790527782989dbb2f56e9
Author: Michal Nasiadka <email address hidden>
Date: Tue Jul 2 10:11:02 2019 +0200

    Fix ovs-appctl by adding --pidfile to ovsdb command.

    Change-Id: I8927ce98d669480866d6fcddaf7b08ef3cbbc37e
    Closes-Bug: #1697570
    (cherry picked from commit 0ec7017f7a358553158dc927285ab9f4af1a641a)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (stable/queens)

Reviewed: https://review.opendev.org/677387
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=13ad3974560dfb9cc89b0f966a61f7a592efee30
Submitter: Zuul
Branch: stable/queens

commit 13ad3974560dfb9cc89b0f966a61f7a592efee30
Author: Michal Nasiadka <email address hidden>
Date: Tue Jul 2 10:11:02 2019 +0200

    Fix ovs-appctl by adding --pidfile to ovsdb command.

    Change-Id: I8927ce98d669480866d6fcddaf7b08ef3cbbc37e
    Closes-Bug: #1697570
    (cherry picked from commit 0ec7017f7a358553158dc927285ab9f4af1a641a)

Revision history for this message
panticz.de (panticz.de) wrote :

Thank you, the workaround with specification of pidfile works fine:

docker exec -it openvswitch_vswitchd ovs-appctl \
  -t /var/run/openvswitch/ovs-vswitchd.*.ctl fdb/show br-int

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 6.2.3

This issue was fixed in the openstack/kolla 6.2.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 7.0.4

This issue was fixed in the openstack/kolla 7.0.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 8.0.1

This issue was fixed in the openstack/kolla 8.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 9.0.0.0rc1

This issue was fixed in the openstack/kolla 9.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.