virtual devices not destroyed when config removed

Bug #1746862 reported by Daniel Axtens
This bug report is a duplicate of:  Bug #1943120: interface not removed . Edit Remove
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nplan (Ubuntu)
New
Undecided
Unassigned

Bug Description

The man page for netplan says:

Virtual devices
              (Examples: veth, bridge, bond) These are fully under the control of the config file(s) and the network stack. I. e. these devices are being created instead of matched. Thus match: and set-name: are not applicable for these, and the ID field is the name of the created virtual device.

I create the following file as /etc/netplan/10-bridge.yaml:

network:
    version: 2
    ethernets:
        ens7:
            match:
                macaddress: 52:54:00:98:18:9a
        ens8:
            match:
                macaddress: 52:54:00:80:00:9d
    bridges:
        br0:
           interfaces: [ens7, ens8]
           addresses:
               - 10.10.10.2/24

I run netplan generate, netplan apply, and see the bridge as expected:

$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:f0:bc:02 brd ff:ff:ff:ff:ff:ff
5: ens7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:98:18:9a brd ff:ff:ff:ff:ff:ff
6: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:80:00:9d brd ff:ff:ff:ff:ff:ff
7: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 0e:e3:1c:83:f8:e8 brd ff:ff:ff:ff:ff:ff

Then I remove the file, and run netplan generate and netplan apply again. The phrase 'fully under the control of the config file(s)' leads me to expect the bridge will now disappear.

It does not: the output of ip l is unchanged.

However, it does go away after a reboot.

This should preferably be changed so that the device does go away with netplan apply. Alternatively it should be well documented that virtual devices will be created but not destroyed by netplan.

Revision history for this message
Daniel Axtens (daxtens) wrote :

This can be observed in the version in artful and from git sha ab9d26eab904880abd10158700dae57923044f49.

Revision history for this message
Lukas Märdian (slyon) wrote :

Netplan recently implemented the ability to pass a "--state" parameter, which enables to calculate the difference between the old and the new conf, and allows to delete virtual interfaces that had been created before.

https://github.com/canonical/netplan/pull/231

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.