[PVE-User] Proposal to increase vmbr limit to 4094
Derek W. Poon
derekp+pve at ece.ubc.ca
Wed Apr 21 02:21:40 CEST 2010
According to http://pve.proxmox.com/wiki/Network_Model bridge names can range from vmbr0 to vmbr9. In the code (Proxmox VE 1.5), the allowed values are vmbr0 to vmbr999. I propose to increase the range to vmbr4094.
Rationale: it would be convenient for administration if the bridge name matched the VLAN identifier. Since 802.1q allows VLAN identifiers up to 4094, it would be nice to have, for example, vmbr4094 corresponding to eth0.4094.
The following patch to pve-manager-1.5-8 and qemu-server-1.1-11 allows four-digit VLAN IDs and increases the limit to 4094. More thorough testing is encouraged.
diff -urN usr/sbin/qm /usr/sbin/qm
--- usr/sbin/qm 2010-01-10 23:32:12.000000000 -0800
+++ /usr/sbin/qm 2010-04-20 16:14:38.000000000 -0700
@@ -929,7 +929,7 @@
XX:XX:XX:XX:XX:XX should be an unique MAC address
-=item vlan[1-999]: MODEL=XX:XX:XX:XX:XX:XX[,MODEL=YY:YY:YY:YY:YY:YY]
+=item vlan[1-4094]: MODEL=XX:XX:XX:XX:XX:XX[,MODEL=YY:YY:YY:YY:YY:YY]
Same as vlan0, but vlanX is bridged to vmbrX
diff -urN usr/share/perl5/PVE/QemuServer.pm /usr/share/perl5/PVE/QemuServer.pm
--- usr/share/perl5/PVE/QemuServer.pm 2010-01-10 23:32:12.000000000 -0800
+++ /usr/share/perl5/PVE/QemuServer.pm 2010-04-20 15:46:50.000000000 -0700
@@ -166,7 +166,7 @@
my $MAX_IDE_DISKS = 4;
my $MAX_SCSI_DISKS = 16;
my $MAX_VIRTIO_DISKS = 16;
-my $MAX_VLANS = 1000;
+my $MAX_VLANS = 4095;
for (my $i = 0; $i < $MAX_VLANS; $i++) {
$confvars->{"vlan$i"} = 'vlan';
diff -urN usr/share/perl5/PVE/Utils.pm /usr/share/perl5/PVE/Utils.pm
--- usr/share/perl5/PVE/Utils.pm 2010-02-23 05:32:28.000000000 -0800
+++ /usr/share/perl5/PVE/Utils.pm 2010-04-20 13:45:43.000000000 -0700
@@ -634,7 +634,7 @@
if ($fd2 = IO::File->new ("/proc/net/dev", "r")) {
while (defined ($line = <$fd2>)) {
chomp ($line);
- if ($line =~ m/^\s*(vmbr([0-9]{1,3})):.*/) {
+ if ($line =~ m/^\s*(vmbr([0-9]{1,4})):.*/) {
my ($name, $num) = ($1, $2);
push @$res, $name if int($num) eq $num; # no leading zero
}
diff -urN usr/share/pve-manager/root/qemu/hardware.htm /usr/share/pve-manager/root/qemu/hardware.htm
--- usr/share/pve-manager/root/qemu/hardware.htm 2010-02-23 05:32:28.000000000 -0800
+++ /usr/share/pve-manager/root/qemu/hardware.htm 2010-04-20 15:42:20.000000000 -0700
@@ -423,7 +423,7 @@
my $bridges = PVE::Utils::get_bridges ();
my $brg;
foreach my $bn (@$bridges) {
- if ($bn =~ m/^vmbr([0-9]{1,3})$/) {
+ if ($bn =~ m/^vmbr([0-9]{1,4})$/) {
push @$brg, [ "vlan$1", $bn ];
}
}
diff -urN usr/share/pve-manager/root/system/index.htm /usr/share/pve-manager/root/system/index.htm
--- usr/share/pve-manager/root/system/index.htm 2010-02-23 05:32:28.000000000 -0800
+++ /usr/share/pve-manager/root/system/index.htm 2010-04-20 15:22:08.000000000 -0700
@@ -61,7 +61,7 @@
my $changes = $cdata->{changes};
my $bridge_avail;
- for (my $i = 0; $i < 1000; $i++) {
+ for (my $i = 0; $i < 4095; $i++) {
if (!defined ($ifaces->{"vmbr$i"})) {
push @$bridge_avail, "vmbr$i";
}
@@ -148,7 +148,7 @@
$ifaces->{$iface} = merge_ifdata ($ifaces->{$iface}, $newif);
- if ($iface =~ m/^vmbr[0-9]{1,3}$/) {
+ if ($iface =~ m/^vmbr[0-9]{1,4}$/) {
#$ifaces->{$iface}->{autostart} = 1;
$ifaces->{$iface}->{'bridge_ports'} = {};
@@ -366,7 +366,7 @@
if ($iface =~ m/^eth(\d)$/) {
next if device_is_used ($ifaces, $iface);
- } elsif ($iface =~ m/^vmbr[0-9]{1,3}$/) {
+ } elsif ($iface =~ m/^vmbr[0-9]{1,4}$/) {
} elsif ($iface =~ m/^bond[0-9]$/) {
} else {
next;
diff -urN usr/share/pve-manager/root/vmlist/create.htm /usr/share/pve-manager/root/vmlist/create.htm
--- usr/share/pve-manager/root/vmlist/create.htm 2010-02-23 05:32:28.000000000 -0800
+++ /usr/share/pve-manager/root/vmlist/create.htm 2010-04-20 15:14:45.000000000 -0700
@@ -362,7 +362,7 @@
my $brg;
foreach my $bn (@$bridges) {
- if ($bn =~ m/^vmbr([0-9]{1,3})$/) {
+ if ($bn =~ m/^vmbr([0-9]{1,4})$/) {
push @$brg, [ "vlan$1", "vmbr$1" ];
}
}
More information about the pve-user
mailing list