new openvswitch-switch service use "ifup --allow-ovs",
and this race with "auto ..." used by networking service
bug reported here:
https://forum.proxmox.com/threads/so-is-openvswitch-bonding-just-broken-on-pve-6-whats-going-on.58020/
This is also fixing ovs with ifupdown2
Openvswitch github have a note about this:
https://github.com/openvswitch/ovs/commit/
e0dfd67b456c8ea36cc2e2f23039a300dbbedfed#diff-
555e6da95251766b76e83867900bd8fe
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
# from the {options} hash for them to be removed correctly.
@$options = grep {defined($_)} map {
my ($pri, $line) = @$_;
# from the {options} hash for them to be removed correctly.
@$options = grep {defined($_)} map {
my ($pri, $line) = @$_;
- if ($line =~ /^allow-(\S+)\s+(.*)$/) {
+ if ($line =~ /^allow-ovs\s+(.*)$/) {
+ undef;
+ } elsif ($line =~ /^allow-(\S+)\s+(.*)$/) {
my $bridge = $1;
my @ports = split(/\s+/, $2);
if (defined(my $br = $ifaces->{$bridge})) {
my $bridge = $1;
my @ports = split(/\s+/, $2);
if (defined(my $br = $ifaces->{$bridge})) {
$done->{ovs_type} = 1;
$raw .= "\tovs_ports $d->{ovs_ports}\n" if $d->{ovs_ports};
$done->{ovs_type} = 1;
$raw .= "\tovs_ports $d->{ovs_ports}\n" if $d->{ovs_ports};
$done->{ovs_ports} = 1;
} elsif ($d->{type} eq 'OVSPort' || $d->{type} eq 'OVSIntPort' ||
$d->{type} eq 'OVSBond') {
$done->{ovs_ports} = 1;
} elsif ($d->{type} eq 'OVSPort' || $d->{type} eq 'OVSIntPort' ||
$d->{type} eq 'OVSBond') {
- if ($ifupdown2) {
- $raw = "auto $iface\n$raw";
- } else {
- $raw = "allow-$d->{ovs_bridge} $iface\n$raw";
- }
-
+ $raw = "allow-$d->{ovs_bridge} $iface\n$raw";
$raw .= "\tovs_bridge $d->{ovs_bridge}\n";
$done->{ovs_bridge} = 1;
}
$raw .= "\tovs_bridge $d->{ovs_bridge}\n";
$done->{ovs_bridge} = 1;
}
return $a cmp $b;
} keys %$ifaces) {
next if $printed->{$iface};
return $a cmp $b;
} keys %$ifaces) {
next if $printed->{$iface};
my $d = $ifaces->{$iface};
my $pri = $d->{priority} // 0;
if (@options && $options[0]->[0] < $pri) {
my $d = $ifaces->{$iface};
my $pri = $d->{priority} // 0;
if (@options && $options[0]->[0] < $pri) {
}
$printed->{$iface} = 1;
}
$printed->{$iface} = 1;
- $raw .= "auto $iface\n" if $d->{autostart};
+ if ($d->{type} eq 'OVSBridge') {
+ $raw .= "allow-ovs $iface\n";
+ } elsif ($d->{autostart}) {
+ $raw .= "auto $iface\n" if $d->{autostart};
+ }
+
my $i = 0; # some options should be printed only once
$raw .= __interface_to_string($iface, $d, $_, !$i++, $ifupdown2) foreach @{$d->{families}};
}
my $i = 0; # some options should be printed only once
$raw .= __interface_to_string($iface, $d, $_, !$i++, $ifupdown2) foreach @{$d->{families}};
}
source-directory before-ovs.d
source-directory before-ovs.d
iface vmbr1 inet static
address $wanted{vmbr1}->{address}
netmask $wanted{vmbr1}->{netmask}
iface vmbr1 inet static
address $wanted{vmbr1}->{address}
netmask $wanted{vmbr1}->{netmask}
iface vmbr0 inet static
address $ip
netmask $nm
iface vmbr0 inet static
address $ip
netmask $nm
iface vmbr0 inet static
address $ip
netmask $nm
iface vmbr0 inet static
address $ip
netmask $nm
iface vmbr0 inet static
address $ip
netmask $nm
iface vmbr0 inet static
address $ip
netmask $nm