OVS settins did not persist through reboot

sdpve

Member
Mar 10, 2018
22
0
6
44
I had a backup issue (see my other thread) that caused me to reboot proxmox. On reboot, I lost lan and internet connection. I'm new to proxmox, and I started with the standard configuration just like everyone else. After much googling I edited the /etc/network/interfaces to use OVS and create a vswitch.

I know I did 1 reboot to get it to work because it needed to release the original configuration. Then it was definitely working fine for days. I think after I got that working I got a VM and an lxc setup. The VM got internet fine. Didn't really do much on the lxc. Anyhow, after this last reboot, the network setup wouldn't work anymore. I could not ping my router nor anything on my lan. Tried several reboots. Finally, I went back to the original interfaces file and that is working.

So I'm guessing that my problem is that I added the OVS settings straight to interfaces file, and maybe I should use OVS commands instead? So besides letting me know if there is any issues with my interfaces settings below, could some1 get me started on what OVS commands on the CLI, I would need to type in to recreate the interfaces file?

---------------------
auto lo
iface lo inet loopback

allow-vmbr0 enp0s31f6
iface enp0s31f6 inet manual
ovs_type OVSPort
ovs_bridge vmbr0

auto vmbr0
iface vmbr0 inet manual
ovs_type OVSBridge
ovs_ports vlan20 enp0s31f6

auto vlan20
allow-vmbr0 vlan20
iface vlan20 inet static
ovs_type OVSIntPort
ovs_bridge vmbr0
ovs_options tag=20
ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
network 192.168.20.0
address 192.168.20.3
netmask 255.255.255.0
gateway 192.168.20.1
broadcast 192.168.20.255
---------------------------

The VM has this network setting:
net0: virtio=XX:XX:XX:XX:9E:7C,bridge=vmbr0,tag=20

Also, could someone tell me what the following command does:
ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
 
If you also use the GUI to edit network interfaces, you should modify /etc/network/interfaces.new instead of /etc/network/interfaces, because that gets renamed and activated on reboot. Or discard all changes before you reboot in interfaces.new if you directly edit /etc/network/interfaces.
 
I don't use the gui, dont think OVS is supported on it. Still trying to figure out the OVS CLI....
 
okay so i got a bit further using some unknown googling skills.
I found this https://github.com/openvswitch/ovs/blob/master/debian/openvswitch-switch.README.Debian

I'm trying to understand it. But I ended up removing the "auto" lines (except for loopback) on my interfaces file and then I did "if up --allow ovs vmbr0" and that did the trick.

So now trying to understand what that debian readme is saying. It sounds like some race condition.

1)Possibly caused by my NFS share I added recently. Although, the readme makes it sound like it's only an issue if you mount /usr through NFS, which I am not. I will have to delete my NFS share and try it I guess.
2) It also mentions, open vswitch has not started when ifupdown starts. I'm not sure how to remedy that.

My other worry is that I've seen several forums posts about getting openvswitch working on proxmox and they all had the "auto" line in the interfaces file. So is my issue new because im on proxmox 5.1? Or is "auto" thing not really an issue like that readme says it is.
 
so I deleted the NFS client settings I had and put back "auto" on network interfaces and it works. So looks like the issue is that if you pass a HD to a VM and then have the VM share it over NFS to proxmox, then your OVS auto interfaces won't work. Or I just got lucky and the real issue just didn't occur this time. Assuming I identified the right issue, does anyone know of a workaround? For example, can I try a samba share instead? Or should I set a script on bootup to start interfaces and not have them be auto?
I'd like to know a bit more about the bootup sequence, where is NFS started and where is OVS interfaces started? At the very least, I'd like to learn a little bit of what is going on at bootup.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!