open vSwitch boot persistence

nz_liam

Member
Jul 21, 2017
6
0
6
Auckland, New Zealand
Hi,

I have a question about open vSwitch boot persistence in Proxmox VE 5

My open vSwitch config looks as follows;

Code:
root@mdr-pve1:~# ovs-vsctl show
2466b09a-459b-4350-9c8c-139c21d30f9a
    Bridge "vmbr0"
        Port "enp11s0f1"
            Interface "enp11s0f1"
        Port "enp6s0f0"
            Interface "enp6s0f0"
        Port "enp13s0f0"
            Interface "enp13s0f0"
        Port "vmbr0"
            Interface "vmbr0"
                type: internal
        Port "tap100i0"
            Interface "tap100i0"
        Port "enp13s0f1"
            Interface "enp13s0f1"
        Port "enp4s0f0"
            tag: 1
            Interface "enp4s0f0"
        Port "enp6s0f1"
            Interface "enp6s0f1"
        Port "enp11s0f0"
            Interface "enp11s0f0"
        Port "enp4s0f1"
            Interface "enp4s0f1"
        Port "vlan1"
            tag: 1
            Interface "vlan1"
                type: internal
    ovs_version: "2.7.0

I then run a command such as
Code:
ovs-vsctl set port tap100i0 trunks=1
and the config changes to;

Code:
root@mdr-pve1:~# ovs-vsctl show
2466b09a-459b-4350-9c8c-139c21d30f9a
    Bridge "vmbr0"
        Port "enp11s0f1"
            Interface "enp11s0f1"
        Port "enp6s0f0"
            Interface "enp6s0f0"
        Port "enp13s0f0"
            Interface "enp13s0f0"
        Port "vmbr0"
            Interface "vmbr0"
                type: internal
        Port "tap100i0"
            trunks: [1]
            Interface "tap100i0"
        Port "enp13s0f1"
            Interface "enp13s0f1"
        Port "enp4s0f0"
            tag: 1
            Interface "enp4s0f0"
        Port "enp6s0f1"
            Interface "enp6s0f1"
        Port "enp11s0f0"
            Interface "enp11s0f0"
        Port "enp4s0f1"
            Interface "enp4s0f1"
        Port "vlan1"
            tag: 1
            Interface "vlan1"
                type: internal
    ovs_version: "2.7.0"

Reflecting the change I made in the
Code:
        Port "tap100i0"
            trunks: [1]
            Interface "tap100i0"
portion, however on reboot this is lost.


What is the recommended way to achieve boot persistence for these sort of commands? (The equivalent of "copy running config startup config" on a regular switch, but in the context of running Proxmox and open vSwitch).


Thanks

Liam
 
Yeah I figured that, in the end what I'm configuring is not available via the GUI, (advanced options, vlan trunks, QINQ etc), so it seems I have to configure via ovs-vsctl to make the change live, and then also write the config options to /etc/network/interfaces for boot persistence.

E.g. ovs-vsctl
Code:
ovs-vsctl set Port enp6s0f1 vlan_mode=dot1q-tunnel tag=111

Followed by the following in /etc/network/interfaces
Code:
auto enp6s0f1
allow-vmbr0 enp6s0f1
iface enp6s0f1 inet manual
        ovs_bridge vmbr0
        ovs_type OVSPort
    ovs_options tag=111 vlan_mode=dot1q-tunnel
        mtu 9000

It would be nice if there were some more advanced options in the GUI at some point, even the ability to append a text string so we can write the open vSwitch commands manually in the gui (see attached screenshot).

Cheers

Liam
 

Attachments

  • Screen Shot 2017-07-22 at 10.11.08 AM.png
    Screen Shot 2017-07-22 at 10.11.08 AM.png
    172.3 KB · Views: 20
Also I would really appreciate it if you could tell me the correct syntax for this configuration;

I have for example the /etc/pve/qemu-server/100.conf vm config;

Code:
root@mdr-pve1:~# cat /etc/pve/qemu-server/100.conf
bootdisk: sata0
cores: 4
ide2: none,media=cdrom
memory: 2048
name: MDR-CHR-1
net0: virtio=36:C9:98:8C:9E:CD,bridge=vmbr0,trunks=111
numa: 1
ostype: l26
sata0: local:100/vm-100-disk-1.raw,size=128M
scsihw: virtio-scsi-pci
smbios1: uuid=6b7ee754-38f5-4cf6-92ba-6b36705ecdb7
sockets: 1

With the line "net0: virtio=36:C9:98:8C:9E:CD,bridge=vmbr0,trunks=111".

However what I want to do is trunk multiple specific vlans, e.g. trunks=111,200,300

When I try altering the line to be "net0: virtio=36:C9:98:8C:9E:CD,bridge=vmbr0,trunks=111,200,300" this does not achieve the desired result.

Nor does "net0: virtio=36:C9:98:8C:9E:CD,bridge=vmbr0,trunks=111,trunks=200,trunks=300"

Can you advise what the correct syntax would be here for this? I feel like I somehow need to escape the "trunks=111,200,300" part of the syntax, but do not know how?


Thanks

Liam
 

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!