The FDP team is no longer accepting new bugs in Bugzilla. Please report your issues under FDP project in Jira. Thanks.
Bug 1731553 - ovs-vsctl exit code when port being added is unable to work
Summary: ovs-vsctl exit code when port being added is unable to work
Keywords:
Status: POST
Alias: None
Product: Red Hat Enterprise Linux Fast Datapath
Classification: Red Hat
Component: openvswitch2.11
Version: RHEL 7.7
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Aaron Conole
QA Contact: qding
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-19 18:14 UTC by Marcelo Ricardo Leitner
Modified: 2023-07-13 07:25 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FD-141 0 None None None 2023-06-17 17:43:34 UTC

Description Marcelo Ricardo Leitner 2019-07-19 18:14:33 UTC
Description of problem:
When navigating through https://bugzilla.redhat.com/show_bug.cgi?id=1725596, I've seen this behaviour in my scripts:

[root@wsfd-netdev19 ~]# ovs-vsctl add-port br0 gre0 -- set interface gre0 type=ip6gre options:key=100 options:remote_ip=2001::2
ovs-vsctl: Error detected while setting up 'gre0': could not add network device gre0 to ofproto (Address family not supported by protocol).  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/var/log/openvswitch".
[root@wsfd-netdev19 ~]# echo $?
0

Well, it's is correct because the port actually was added:
[root@wsfd-netdev19 ~]# ovs-vsctl show
e904851c-9eed-4041-8dd6-af304d379ca0
    Bridge ovs-sriov
        Port "eth0"
            Interface "eth0"
        Port "bond9"
            Interface "bond9"
        Port ovs-sriov
            Interface ovs-sriov
                type: internal
    Bridge "br0"
        Port "br0"
            Interface "br0"
                type: internal
        Port "ns2-veth-ab"
            Interface "ns2-veth-ab"
        Port "gre0"
            Interface "gre0"
                type: "ip6gre"
                options: {key="100", remote_ip="2001::2"}
                error: "could not add network device gre0 to ofproto (Address family not supported by protocol)"
    ovs_version: "2.11.0"


This happens with unknown interfaces as well:

[root@wsfd-netdev19 ~]# ovs-vsctl add-port br0 foobar
ovs-vsctl: Error detected while setting up 'foobar': could not open network device foobar (No such device).  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/var/log/openvswitch".
[root@wsfd-netdev19 ~]# ovs-vsctl show
e904851c-9eed-4041-8dd6-af304d379ca0
    Bridge ovs-sriov
        Port "eth0"
            Interface "eth0"
        Port "bond9"
            Interface "bond9"
        Port ovs-sriov
            Interface ovs-sriov
                type: internal
    Bridge "br0"
        Port "br0"
            Interface "br0"
                type: internal
        Port foobar
            Interface foobar
                error: "could not open network device foobar (No such device)"


But this is also bad because the script cannot easily detect such error condition, and so would OSP and others when adding this tunnel interface.

Is there a way to make this operation more strict, and error out on such conditions? Is it actually wanted?
Or to query (without parsing ovs-vsctl output) if a port is at least minimally functional?


Version-Release number of selected component (if applicable):
openvswitch2.11-2.11.0-14.el7fdp.x86_64

Comment 1 Matteo Croce 2019-09-20 14:57:15 UTC
If the whole transaction succeded, the command is supposed to succeed too.
Hence a 0 exit status looks reasonable.

Comment 2 Matteo Croce 2019-10-04 16:02:15 UTC
It can be triggered by an invalid ip too:

root@rhel8:~# ovs-vsctl add-port br0 gre0 -- set interface gre0 type=ip6gre options:key=100 options:remote_ip=192.168.0.300
ovs-vsctl: Error detected while setting up 'gre0': gre0: bad ip6gre 'remote_ip'
gre0: ip6gre type requires valid 'remote_ip' argument.  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/var/log/openvswitch".

root@rhel8:~# echo $?
0

Comment 4 Flavio Leitner 2023-06-17 17:43:03 UTC
Posted upstream: http://patchwork.ozlabs.org/project/openvswitch/list/?series=360149

Comment 5 Flavio Leitner 2023-07-05 11:48:48 UTC
Posted v3 upstream: http://patchwork.ozlabs.org/project/openvswitch/list/?series=362382


Note You need to log in before you can comment on or make changes to this bug.