Openvswitch does not work on startup on PVE 5

supermario87

Member
Mar 19, 2012
28
0
21
I had this issue also on PVE 4.4 but solve by editing /etc/init.d/openvswitch-switch with this patch

diff -u ~/openvswitch-switch.old openvswitch-switch
--- /root/openvswitch-switch.old 2015-05-06 10:37:34.036076834 +0200
+++ openvswitch-switch 2015-05-06 11:20:21.776809573 +0200
@@ -16,10 +16,12 @@
#
### BEGIN INIT INFO
# Provides: openvswitch-switch
-# Required-Start: $network $named $remote_fs $syslog
-# Required-Stop: $remote_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# X-Start-Before: networking
+# X-Stop-After: networking
+# Default-Start: S
+# Default-Stop: 0 6
# Short-Description: Open vSwitch switch
# Description: openvswitch-switch provides the userspace components and utilities for
# the Open vSwitch kernel-based switch.



Error is that the vmbr0 is not found by network manager and the boot proces timeouts


When booted, I have to add the vmbr0 manually and then restart the network.


First bug of this are in 2013, how it is possible to still have issues with this stuff? It is to difficult to fix service order?

This is the interface file that was working in 4.4 with service patch.

auto lo
iface lo inet loopback

iface eno2 inet manual

allow-vmbr0 bond0
iface bond0 inet manual
ovs_bonds ens1f0 ens1f1
ovs_type OVSBond
ovs_bridge vmbr0
ovs_options bond_mode=balance-tcp lacp=active other_config:lacp-time=fast

auto vmbr0
allow-ovs vmbr0
iface vmbr0 inet manual
ovs_type OVSBridge
ovs_ports bond0 vlan10

auto vlan10
allow-vmbr0 vlan10
iface vlan10 inet static
ovs_type OVSIntPort
ovs_bridge vmbr0
ovs_options vlan_mode=access tag=10
ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
address 10.0.10.2
netmask 255.255.255.0
gateway 10.0.10.1

iface ens1f2 inet manual

iface ens1f3 inet manual

iface eno1 inet manual

iface eno1 inet dhcp


This is taken and tweaked to fit needs. That do not seems to be the hardest configuration in the world but catn even start the networking on a clean boot.

Please help.
 

wolfgang

Proxmox Staff Member
Oct 1, 2014
6,496
494
103
Hi,

Proxmox VE use systemd and not SysVinit, so your adoption of /etc/init.d/openvswitch-switch is not working.

You have to declare the interface ens1f0 and ens1f1 before the bond.
The interfaces must also be started when bond0 try to use it (auto <interface name>).

You have a very simple setup why do you do not use the normal Linux bridge instead of openvswitch?
 

supermario87

Member
Mar 19, 2012
28
0
21
Hi,

Proxmox VE use systemd and not SysVinit, so your adoption of /etc/init.d/openvswitch-switch is not working.

After some researches, I've found that it is not exactly as you say. The script is still SysVinit but gets converted every time to a systemd service by an utilily in the debian system. systemd-sysv-generator
I've found no way to edit this file and make it persistent on every reboot. But I managed to convert the service to native systemd by coping the auto converted one into one of the default folders of the system making it a "true" systemd service
Info there: https://gist.github.com/houtianze/59b89ca71cc2029dd61d3c4bd86e6ee7
There, I've also been able to modify the StartTimeout time to something lower than 5 minutes(why 5 minutes default?)
You have to declare the interface ens1f0 and ens1f1 before the bond.
The interfaces must also be started when bond0 try to use it (auto <interface name>).

All my tries were unsecessful, then I give a try to the network creation from the GUI and it worked.
I've also understood were I was wrong in the file(not adding iface inet xxx static along with auto xxx).

This network config can boot(taken from another test machine with replicated issue).

Code:
auto lo
iface lo inet loopback

auto enp2s0
iface enp2s0 inet manual

auto enp3s0
iface enp3s0 inet manual

allow-vmbr0 bond0
iface bond0 inet manual
        ovs_bonds enp3s0 enp2s0
        ovs_type OVSBond
        ovs_bridge vmbr0
        ovs_options bond_mode=active-backup

auto vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge
        ovs_ports bond0 vlan10

allow-vmbr0 vlan10
iface vlan10 inet static
        address  192.168.10.45
        netmask  255.255.255.0
        gateway  192.168.10.1
        ovs_type OVSIntPort
        ovs_bridge vmbr0
#       ovs_options vlan_mode=access tag=1

You have a very simple setup why do you do not use the normal Linux bridge instead of openvswitch?

With this setup I can simulate a real managed switch. The bond is a trunk port and I only need one bridge.

VLAN 10 is attached to the bridge and server as management interface.
All others VMs are attached to the same bridge with different vlan tags and I manage networking from my pfsense firewall that is on top of the PVE system.

I hope I was clear
 

wolfgang

Proxmox Staff Member
Oct 1, 2014
6,496
494
103

supermario87

Member
Mar 19, 2012
28
0
21
See https://git.proxmox.com/?p=openvswitch.git;a=summary
And special the quilt patches where we remove the init scripts and add systemd setting.

If it's a full systemd service why is in the /run/systemd/generator.late/ folder and not in one of the default one? For example, networking.service is /lib/systemd/system/networking.service

Maybe youre referring to the syntax of the service script. But as i can see /etc/init.d/openvswitch-switch is handled ad a SysV init scripts.
 

wolfgang

Proxmox Staff Member
Oct 1, 2014
6,496
494
103
This should not the case!

Have you done an inplace upgrade?

Can you please send the the output of the following commands

Code:
pveversion -v
apt-cache policy openvswitch-common openvswitch-switch
[CODE]
 

supermario87

Member
Mar 19, 2012
28
0
21
This should not the case!

Have you done an inplace upgrade?

Can you please send the the output of the following commands

Code:
pveversion -v
apt-cache policy openvswitch-common openvswitch-switch

Nope, fresh 5.0 install in both cases(production server and test machine)
Code:
proxmox-ve: 5.0-19 (running kernel: 4.10.17-2-pve)
pve-manager: 5.0-30 (running version: 5.0-30/5ab26bc)
pve-kernel-4.10.17-2-pve: 4.10.17-19
libpve-http-server-perl: 2.0-6
lvm2: 2.02.168-pve3
corosync: 2.4.2-pve3
libqb0: 1.0.1-1
pve-cluster: 5.0-12
qemu-server: 5.0-15
pve-firmware: 2.0-2
libpve-common-perl: 5.0-16
libpve-guest-common-perl: 2.0-11
libpve-access-control: 5.0-6
libpve-storage-perl: 5.0-14
pve-libspice-server1: 0.12.8-3
vncterm: 1.5-2
pve-docs: 5.0-9
pve-qemu-kvm: 2.9.0-3
pve-container: 2.0-15
pve-firewall: 3.0-2
pve-ha-manager: 2.0-2
ksm-control-daemon: 1.2-2
glusterfs-client: 3.8.8-1
lxc-pve: 2.0.8-3
lxcfs: 2.0.7-pve4
criu: 2.11.1-1~bpo90
novnc-pve: 0.6-4
smartmontools: 6.5+svn4324-1
zfsutils-linux: 0.6.5.9-pve16~bpo90
openvswitch-switch: 2.6.2~pre+git20161223-3

Code:
openvswitch-common:
  Installed: 2.6.2~pre+git20161223-3
  Candidate: 2.6.2~pre+git20161223-3
  Version table:
 *** 2.6.2~pre+git20161223-3 500
        500 http://ftp.it.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status
openvswitch-switch:
  Installed: 2.6.2~pre+git20161223-3
  Candidate: 2.6.2~pre+git20161223-3
  Version table:
 *** 2.6.2~pre+git20161223-3 500
        500 http://ftp.it.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status
 

wolfgang

Proxmox Staff Member
Oct 1, 2014
6,496
494
103
You are using the Debian packages, what for sure use the systemd-sysv-generator.
I never test the Debian packages and I would recommend you to use the Proxmox VE packages.

Do you use the Debian packages for special reason or do you have the wrong repositories?

see
https://pve.proxmox.com/wiki/Package_Repositories
 

supermario87

Member
Mar 19, 2012
28
0
21
You are using the Debian packages, what for sure use the systemd-sysv-generator.
I never test the Debian packages and I would recommend you to use the Proxmox VE packages.

Do you use the Debian packages for special reason or do you have the wrong repositories?

see
https://pve.proxmox.com/wiki/Package_Repositories

No particular reasons, when I've installed the new pve I've forgotten to enable non-subscriber repos after disabling the subscribers one.
 

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 your own in 60 seconds.

Buy now!