]> git.proxmox.com Git - pve-common.git/commitdiff
Inotify: write_network_interfaces : always autostart bond slaves interfaces
authorAlexandre Derumier <aderumier@odiso.com>
Sun, 7 Jun 2020 11:39:47 +0000 (13:39 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 8 Jun 2020 15:34:57 +0000 (17:34 +0200)
Currently, bond slaves are mostly working without autostart,
because bond slaves scripts from ifupdown1 && also ifupdown2
 have some kind of hacks to start the slaves.

But if users want to do some tuning on the ifaces, they are not applied.

Also, with ifupdown2 + ovs, this kind of hack is not implemented (yet), so the
slaves of the bond are still down.

Debian/Ubuntu official docs always set "auto ethX" for bond slaves,
it's really more clean like this.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/PVE/INotify.pm
test/etc_network_interfaces/t.create_network.pl
test/etc_network_interfaces/t.unknown_order.pl

index 1eaec2191f365fc901793cd411678ec23ee08ef0..c50751560b20de5955fee91a46ab7d4394c0c3c1 100644 (file)
@@ -1487,6 +1487,7 @@ sub __write_etc_network_interfaces {
        if ($d->{type} eq 'OVSBond' && $d->{ovs_bonds}) {
            foreach my $p (split (/\s+/, $d->{ovs_bonds})) {
                my $n = $ifaces->{$p};
+               $n->{autostart} = 1;
                die "OVS bond '$iface' - unable to find slave '$p'\n"
                    if !$n;
                die "OVS bond '$iface' - wrong interface type on slave '$p' " .
@@ -1503,6 +1504,7 @@ sub __write_etc_network_interfaces {
            my $bond_primary_is_slave = undef;
            foreach my $p (split (/\s+/, $d->{slaves})) {
                my $n = $ifaces->{$p};
+               $n->{autostart} = 1;
 
                die "bond '$iface' - unable to find slave '$p'\n"
                    if !$n;
index 22e71420b8bd15b55bd4afee5d6828b753342f51..b8da5137bba162526fce2ceb66e02a4020851df9 100644 (file)
@@ -109,8 +109,10 @@ iface eth0 inet manual
 
 $eth1_part
 
+auto eth2
 iface eth2 inet manual
 
+auto eth3
 iface eth3 inet manual
 
 iface eth4 inet manual
@@ -167,8 +169,10 @@ iface eth0 inet manual
 
 $eth1_part
 
+auto eth2
 iface eth2 inet manual
 
+auto eth3
 iface eth3 inet manual
 
 iface eth4 inet manual
@@ -284,8 +288,10 @@ iface eth0 inet manual
 
 $eth1_part
 
+auto eth2
 iface eth2 inet manual
 
+auto eth3
 iface eth3 inet manual
 
 iface eth4 inet manual
@@ -398,12 +404,16 @@ iface eth0 inet manual
 
 $eth1_part
 
+auto eth2
 iface eth2 inet manual
 
+auto eth3
 iface eth3 inet manual
 
+auto eth4
 iface eth4 inet manual
 
+auto eth5
 iface eth5 inet manual
 
 auto eth1.100
index cd8f51be7e974625cfee35194e1f854758faeadf..44c03928975d4f12d91d48ccbbb7b5484f0de8d2 100644 (file)
@@ -2,16 +2,22 @@ my $base = load('loopback');
 sub wanted($) {
     my ($ip) = @_;
     return $base . <<"IFACES";
+auto eth0
 iface eth0 inet manual
 
+auto eth1
 iface eth1 inet manual
 
+auto eth2
 iface eth2 inet manual
 
+auto eth3
 iface eth3 inet manual
 
+auto eth4
 iface eth4 inet manual
 
+auto eth5
 iface eth5 inet manual
 
 iface eth6 inet manual