[SOLVED] Problem with new OvS commands in libpve-common-perl 6.1-1

Jun 8, 2016
344
74
93
48
Johannesburg, South Africa
Hi,

Updated libpve-common-perl package contains a restructured /usr/share/perl5/PVE/Network.pm script which has problems when a VM's network interface is tagged and trunked.

Error message:
Code:
()
ovs-vsctl: "trunks" is not a valid integer or range
can't add ovs port 'tap101i0' - command '/usr/bin/ovs-vsctl -- add-port vmbr0 tap101i0 'tag=60 trunks=100 vlan_mode=native-untagged'' failed: exit code 1

kvm: network script /var/lib/qemu-server/pve-bridge failed with status 256
TASK ERROR: start failed: QEMU exited with code 1


This command appears to get built at line 250 in /usr/share/perl5/PVE/Network.pm
Code:
    my $cmd = ['/usr/bin/ovs-vsctl'];
    # first command
    push @$cmd, '--', 'add-port', $bridge, $iface;
    push @$cmd, "tag=$tag" if $tag;
    push @$cmd, "trunks=". join(',', $trunks) if $trunks;
    push @$cmd, "vlan_mode=native-untagged" if $tag && $trunks;


Problem appears to be the single quote characters that are transmitted as part of the command. Herewith validation of the commands on a standard bash prompt:
Code:
[root@pve-test ~]#   /sbin/ip link add tap101i0 type bridge;
[root@pve-test ~]#   /sbin/ip link set tap101i0 up;
[root@pve-test ~]#   /usr/bin/ovs-vsctl -- add-port vmbr0 tap101i0 'tag=60 trunks=100 vlan_mode=native-untagged'
ovs-vsctl: "trunks" is not a valid integer or range
[root@pve-test ~]#   /usr/bin/ovs-vsctl -- add-port vmbr0 tap101i0 tag=60 trunks=100 vlan_mode=native-untagged
  WORKS
 
Last edited:

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!