On 1/12/23 19:40, N0T3P4D via discuss wrote: > Dear list, > > I use Open vSwitch together with libvirt to assign different VMs to different > VLANs. This works well about 95% of the time. However, sometimes a VM gets > assigned to the wrong VLAN. > > According to syslog, the following command is executed, with the tag being > correct: > > Jan 12 19:04:46 [ovs-vsctl] ovs|00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl > --timeout=5 -- --may-exist add-port vbr0 vnet1 tag=100 -- set Interface vnet1 > "external-ids:attached-mac=\"XX:XX:XX:XX:XX:XX\"" -- set Interface vnet1 > "external-ids:iface-id=\"XXXXXXX\"" -- set Interface vnet1 > "external-ids:vm-id=\"XXXXXXXXX\"" -- set Interface vnet1 > external-ids:iface-status=active > > Yet, the VM's interface is assigned to the wrong VLAN: > > # ovs-vsctl show > XXX > Bridge vbr0 > Controller "punix:/var/run/openvswitch/vbr0.mgmt" > Port vnet1 > tag: 500 > Interface vnet1 > Port eno1 > Interface eno1 > Port vbr0 > Interface vbr0 > type: internal > > I *think* that this problem only occurs if one VM is started after another > has been shut down. Unfortunately, I cannot reproduce it reliably. > > These are the syslog messages related to Open vSwitch beginning with the > start of the first VM, which was started at 18:13 and shut down at 19:04: > > Jan 12 18:13:53 [ovs-vswitchd] ovs|00059|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 18:13:53 [ovs-vsctl] ovs|00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl > --timeout=5 -- --may-exist add-port vbr0 vnet0 tag=100 -- set Interface vnet0 > "external-ids:attached-mac=\"YY:YY:YY:YY:YY:YY\"" -- set Interface vnet0 > "external-ids:iface-id=\"YYYYYY\"" -- set Interface vnet0 > "external-ids:vm-id=\"YYYYYYY\"" -- set Interface vnet0 > external-ids:iface-status=active > Jan 12 18:13:53 [ovs-vswitchd] ovs|00060|bridge|INFO|bridge vbr0: added > interface vnet0 on port 1 > Jan 12 18:13:53 [ovs-vswitchd] ovs|00061|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 18:13:53 [ovs-vswitchd] ovs|00062|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 18:13:53 [ovs-vswitchd] ovs|00063|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 18:13:53 [ovs-vswitchd] ovs|00064|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 18:14:10 [ovs-vswitchd] ovs|00065|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 18:14:10 [ovs-vswitchd] ovs|00066|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 19:04:34 [ovs-vswitchd] ovs|00067|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 19:04:34 [ovs-vswitchd] ovs|00068|ofproto|WARN|vbr0: cannot get STP > status on nonexistent port 1 > Jan 12 19:04:34 [ovs-vswitchd] ovs|00069|ofproto|WARN|vbr0: cannot get RSTP > status on nonexistent port 1 > Jan 12 19:04:34 [ovs-vswitchd] ovs|00070|bridge|INFO|bridge vbr0: deleted > interface vnet0 on port 1 > Jan 12 19:04:34 [ovs-vswitchd] ovs|00071|bridge|WARN|could not open network > device vnet0 (No such device) > Jan 12 19:04:34 [ovs-vswitchd] ovs|00072|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 19:04:39 [ovs-vsctl] ovs|00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl > --timeout=5 -- --if-exists del-port vnet0 > Jan 12 19:04:39 [ovs-vswitchd] ovs|00073|bridge|WARN|could not open network > device vnet1 (No such device) > Jan 12 19:04:46 [ovs-vswitchd] ovs|00074|bridge|INFO|bridge vbr0: added > interface vnet1 on port 2 > > The system runs Gentoo Linux, the Open vSwitch version is 2.17.5 patched with > the following patch: > https://raw.githubusercontent.com/gentoo-mirror/gentoo/stable/net-misc/openvswitch/files/xcp-interface-reconfigure-2.3.2.patch > > I've been observed this problem for several months, after it has worked > correctly for several years. It also occurs with previous versions of the > 2.17 series. I can't remember whether this also occurred with the previous > version packaged with Gentoo, which is 2.15.0. > > Any advice on how to fix or further debug this problem is highly appreciated. > I'll happily test patches if necessary.
This looks fairly strange. Configuration is stored in the database and the value can't just flip on it's own. I'd vote for some piece of software changing that value after the port is created. If you can't find the command that sets this value in the log, you may try to inspect the database file. It's typically in /etc/openvswitch/. It has a plain text readable format. Each transaction can contain a comment describing who or why executed it. So, if you can find there a transaction that changes a tag from 100 to 500, it may give you some more information. Another option is to enable debug logs for ovsdb-server for the jsonrpc module with: ovs-appctl -t ovsdb-server vlog/set jsonrpc:file:dbg After that the database server will start logging all the communication with other applications, so you may spot a transaction that changed the tag. Best regards, Ilya Maximets. > > Please CC me as I'm not subscribed. > > Best regards > > N0T3P4D _______________________________________________ discuss mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
