Bug 2182767

Summary: external-id.hostname is overwritten on each openvswtich service start with ovs 3.1
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Alfredo Moralejo <amoralej>
Component: openvswitch3.1Assignee: Timothy Redaelli <tredaelli>
Status: CLOSED ERRATA QA Contact: Rick Alongi <ralongi>
Severity: high Docs Contact:
Priority: high    
Version: RHEL 9.0CC: apevec, ctrautma, dalvarez, fleitner, jhsiao, noonedeadpunk, ralongi, tredaelli
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openvswitch3.1-3.1.0-13.el9fdp Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-06 19:17:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alfredo Moralejo 2023-03-29 14:57:34 UTC
Description of problem:

When using openvswitch3.1 provided in CentOS NFV SIG, the external-id.hostname is overwritten on each service restart. This has changed the behavior of previous versions of ovs from 2.15:

https://github.com/openvswitch/ovs/commit/2221e8b034298bd77dc9282895c4b32fd11583e8


Version-Release number of selected component (if applicable):

openvswitch3.1-3.1.0-3.el9s.x86_64

How reproducible:

Always


Actual results:

example (note i'm setting short name amoralej3 and it overwrites it to amoralej3.example.com fqdn on restart)

[root@amoralej3 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=amoralej3.example.com, rundir="/var/run/openvswitch", system-id="b0bf030c-70a5-4ee7-8fb6-aa295f61a767"}
[root@amoralej3 ~]# sudo ovs-vsctl set open_vswitch . external-ids:hostname=amoralej3
[root@amoralej3 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=amoralej3, rundir="/var/run/openvswitch", system-id="b0bf030c-70a5-4ee7-8fb6-aa295f61a767"}
[root@amoralej3 ~]# systemctl restart openvswitch
[root@amoralej3 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=amoralej3.example.com, rundir="/var/run/openvswitch", system-id="b0bf030c-70a5-4ee7-8fb6-aa295f61a767"}
[root@amoralej3 ~]# 



Expected results:

external-id.hostname should be preserved once it's set initially.

Same example as previous one with openvswitch2.17:

[root@amoralej3 ~]# rpm -q openvswitch2.17
openvswitch2.17-2.17.0-72.el9s.x86_64
[root@amoralej3 ~]# systemctl start openvswitch
[root@amoralej3 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=amoralej3.example.com, rundir="/var/run/openvswitch", system-id="b0bf030c-70a5-4ee7-8fb6-aa295f61a767"}
[root@amoralej3 ~]# 
[root@amoralej3 ~]# sudo ovs-vsctl set open_vswitch . external-ids:hostname=amoralej3
[root@amoralej3 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=amoralej3, rundir="/var/run/openvswitch", system-id="b0bf030c-70a5-4ee7-8fb6-aa295f61a767"}
[root@amoralej3 ~]# systemctl restart openvswitch
[root@amoralej3 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=amoralej3, rundir="/var/run/openvswitch", system-id="b0bf030c-70a5-4ee7-8fb6-aa295f61a767"}
[root@amoralej3 ~]# 


Additional info:

Comment 1 Daniel Alvarez Sanchez 2023-03-29 15:17:12 UTC
Reverting b8bf410a5 fixes the issue. The offending patch is:

https://github.com/openvswitch/ovs/commit/b8bf410a5c94173da02279b369d75875c4035959

Which is in v3.1.0+

Comment 2 Daniel Alvarez Sanchez 2023-03-29 16:21:01 UTC
Sent a patch here [0]. Quickly tested it locally and seems to do the trick.

[0] https://mail.openvswitch.org/pipermail/ovs-dev/2023-March/403255.html

Comment 3 ovs-bugzilla 2023-04-03 22:30:30 UTC
* Mon Apr 03 2023 Open vSwitch CI <ovs-ci> - 3.1.0-13
- Merging upstream branch-3.1 [RH git: bd072cf805]
    Commit list:
    b184a68a20 netdev-offload-tc: Del ufid mapping if device not exist.
    037e2d9161 db-ctl-base: Partially revert b8bf410a5. (#2182767)

Comment 6 Rick Alongi 2023-05-26 11:23:44 UTC
# Reproduce issue:

[root@netqe40 ~]# rpm -q openvswitch3.1
openvswitch3.1-3.1.0-2.el9fdp.x86_64
[root@netqe40 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=netqe40.knqe.lab.eng.bos.redhat.com, rundir="/var/run/openvswitch", system-id="3d4e8d7c-d288-4f34-bf18-7a52974fc5b7"}
[root@netqe40 ~]# ovs-vsctl set open_vswitch . external-ids:hostname=netqe40
[root@netqe40 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=netqe40, rundir="/var/run/openvswitch", system-id="3d4e8d7c-d288-4f34-bf18-7a52974fc5b7"}
[root@netqe40 ~]# systemctl restart openvswitch
[root@netqe40 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=netqe40.knqe.lab.eng.bos.redhat.com, rundir="/var/run/openvswitch", system-id="3d4e8d7c-d288-4f34-bf18-7a52974fc5b7"}

# Verify fix:

[root@netqe40 ~]# rpm -q openvswitch3.1
openvswitch3.1-3.1.0-24.el9fdp.x86_64
[root@netqe40 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=netqe40.knqe.lab.eng.bos.redhat.com, rundir="/var/run/openvswitch", system-id="3d4e8d7c-d288-4f34-bf18-7a52974fc5b7"}
[root@netqe40 ~]# ovs-vsctl set open_vswitch . external-ids:hostname=netqe40
[root@netqe40 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=netqe40, rundir="/var/run/openvswitch", system-id="3d4e8d7c-d288-4f34-bf18-7a52974fc5b7"}
[root@netqe40 ~]# systemctl restart openvswitch
[root@netqe40 ~]# ovs-vsctl list open .|grep hostname
external_ids        : {hostname=netqe40, rundir="/var/run/openvswitch", system-id="3d4e8d7c-d288-4f34-bf18-7a52974fc5b7"}

Comment 11 errata-xmlrpc 2023-07-06 19:17:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (openvswitch3.1 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:3989