external-id.hostname is overwritten on each openvswtich service start with ovs 3.1

Bug #2017757 reported by Dmitriy Rabotyagov
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Triaged
High
Unassigned
Antelope
Fix Committed
High
Unassigned
openvswitch (Ubuntu)
Fix Released
High
Unassigned
Lunar
Won't Fix
High
Unassigned
Mantic
Fix Released
High
Unassigned

Bug Description

In jammy/antelope repo openvswitch-common=3.1.0-1~cloud0 contain a buggy version of OVS that does not respect `ovs-vsctl add` command, so instead of appending values it does replace them.

```
root@aio1:/home/ubuntu# ovs-vsctl list open .|grep hostname
external_ids : {hostname=aio1.openstack.local, ovn-bridge-mappings="vlan:br-provider,lbaas:br-octavia", ovn-cms-options=enable-chassis-as-gw, ovn-encap-ip="172.29.240.100", ovn-encap-type=geneve, ovn-remote="ssl:172.29.236.100:6642", rundir="/var/run/openvswitch", system-id="bbad02ce-ab79-42c0-8f54-ce0b7e732c59"}
root@aio1:/home/ubuntu# ovs-vsctl set open_vswitch . external-ids:hostname=aio1
root@aio1:/home/ubuntu# ovs-vsctl list open .|grep hostname
external_ids : {hostname=aio1, ovn-bridge-mappings="vlan:br-provider,lbaas:br-octavia", ovn-cms-options=enable-chassis-as-gw, ovn-encap-ip="172.29.240.100", ovn-encap-type=geneve, ovn-remote="ssl:172.29.236.100:6642", rundir="/var/run/openvswitch", system-id="bbad02ce-ab79-42c0-8f54-ce0b7e732c59"}
root@aio1:/home/ubuntu# ovs-vsctl list open .|grep hostname
external_ids : {hostname=aio1.openstack.local, ovn-bridge-mappings="vlan:br-provider,lbaas:br-octavia", ovn-cms-options=enable-chassis-as-gw, ovn-encap-ip="172.29.240.100", ovn-encap-type=geneve, ovn-remote="ssl:172.29.236.100:6642", rundir="/var/run/openvswitch", system-id="bbad02ce-ab79-42c0-8f54-ce0b7e732c59"}
root@aio1:/home/ubuntu#

root@aio1:/home/ubuntu# apt info openvswitch-common
Package: openvswitch-common
Version: 3.1.0-1~cloud0
Priority: optional
Section: net
Source: openvswitch
Maintainer: Debian OpenStack <email address hidden>
Installed-Size: 3359 kB
Depends: openssl, python3:any, libc6 (>= 2.34), libcap-ng0 (>= 0.7.9), libssl3 (>= 3.0.0~~alpha1), libunbound8 (>= 1.8.0)
Suggests: ethtool, openvswitch-doc
Breaks: openvswitch-switch (<< 2.13.0~git20200212.15ae9db33-0ubuntu2~)
Replaces: openvswitch-switch (<< 2.13.0~git20200212.15ae9db33-0ubuntu2~)
Download-Size: 1061 kB
APT-Manual-Installed: yes
APT-Sources: http://ubuntu-cloud.archive.canonical.com/ubuntu jammy-updates/antelope/main amd64 Packages
Description: Open vSwitch common components
 Open vSwitch is a production quality, multilayer, software-based,
 Ethernet virtual switch. It is designed to enable massive network
 automation through programmatic extension, while still supporting
 standard management interfaces and protocols (e.g. NetFlow, IPFIX,
 sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed
 to support distribution across multiple physical servers similar to
 VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V.
 .
 openvswitch-common provides components required by both openvswitch-switch
 and openvswitch-testcontroller.

N: There are 2 additional records. Please use the '-a' switch to see them.
root@aio1:/home/ubuntu#

```

This can be workarounded with setting `OPTIONS="--no-record-hostname"` in /etc/default/openvswitch-switch

Path in OVS has been already proposed: https://mail.openvswitch.org/pipermail/ovs-dev/2023-March/403255.html

Related bug to RDO: https://bugzilla.redhat.com/show_bug.cgi?id=2182767

James Page (james-page)
Changed in openvswitch (Ubuntu Lunar):
importance: Undecided → High
Changed in openvswitch (Ubuntu Mantic):
importance: Undecided → High
Changed in openvswitch (Ubuntu Lunar):
status: New → Triaged
Changed in openvswitch (Ubuntu Mantic):
status: New → Triaged
Revision history for this message
Frode Nordahl (fnordahl) wrote :

Thank you for the bug report, Dmitriy.

Just wanted to note that in Ubuntu, the process of recording the hostname is performed as a separate step in the boot process. This is done to ensure initial recording of the hostname is done after the network is online, even when Open vSwitch itself is used to provide the only uplink in a system.

As such, a workaround could also be to execute the following command:

    sudo systemctl mask ovs-record-hostname.service

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

Ah, yes, that is absolutely true.
I do recall finding that service when was investigating differences in packaging before UCA and RDO when was originally reporting issue to RDO a month ago.

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote (last edit ):

Just in case, when I attempt to apply your workaround, openvswitch-switch.service restart fails with:

`Unable to restart service openvswitch-switch: Failed to restart openvswitch-switch.service: Unit ovs-record-hostname.service is masked`

Though just disabling service works.

Frode Nordahl (fnordahl)
Changed in openvswitch (Ubuntu Mantic):
status: Triaged → Fix Released
status: Fix Released → Fix Committed
Frode Nordahl (fnordahl)
Changed in openvswitch (Ubuntu Mantic):
status: Fix Committed → Fix Released
Changed in openvswitch (Ubuntu Lunar):
status: Triaged → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Ubuntu 23.04 (Lunar Lobster) has reached end of life, so this bug will not be fixed for that specific release.

Changed in openvswitch (Ubuntu Lunar):
status: Fix Committed → Won't Fix
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.