netplan / networkd backend / label option not always applied on `netplan apply`

Bug #1908137 reported by Nementon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
New
Undecided
Unassigned

Bug Description

Hi,

Regarding this feature: https://github.com/CanonicalLtd/netplan/pull/89
The networkd "label" option is not applied on configuration apply "netplan apply" if an ip address/label is already live.

Context:
  - OS: Ubuntu 20.04 (focal)
  - netplan.io: 0.100-0ubuntu4~20.04.3

Considering this `eth1.yml` configuration file:

```
network:
    version: 2
    renderer: networkd
    ethernets:
        eth1:
            addresses:
                - 15.25.25.22/24:
                    lifetime: forever
                    label: 'eth1:1'
                - 15.25.25.26/24:
                     label: default
```

```
$ netplan apply
$ ip a show eth1
eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master pta-vSwitch state UP group default qlen 1000
    link/ether 00:0c:29:28:c5:cd brd ff:ff:ff:ff:ff:ff
    inet 15.25.25.22/24 brd 15.25.25.255 scope global eth1:1
       valid_lft forever preferred_lft forever
    inet 15.25.25.26/24 brd 15.25.25.255 scope global secondary default
       valid_lft forever preferred_lft forever
```

Then, by modifying the `eth1.yml` configuration file:

```
network:
    version: 2
    renderer: networkd
    ethernets:
        eth1:
            addresses:
                - 15.25.25.22/24:
                    lifetime: forever
                    label: 'anotherlabel'
                - 15.25.25.26/24:
                     label: whoami
```

```
$ netplan apply
$ ip a show eth1
eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master pta-vSwitch state UP group default qlen 1000
    link/ether 00:0c:29:28:c5:cd brd ff:ff:ff:ff:ff:ff
    inet 15.25.25.22/24 brd 15.25.25.255 scope global eth1:1
       valid_lft forever preferred_lft forever
    inet 15.25.25.26/24 brd 15.25.25.255 scope global secondary default
       valid_lft forever preferred_lft forever
$ ip a flush eth1
$ netplan apply
$ ip a show eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master pta-vSwitch state UP group default qlen 1000
    link/ether 00:0c:29:28:c5:cd brd ff:ff:ff:ff:ff:ff
    inet 15.25.25.22/24 brd 15.25.25.255 scope global anotherlabel
       valid_lft forever preferred_lft forever
    inet 15.25.25.26/24 brd 15.25.25.255 scope global secondary whoami
       valid_lft forever preferred_lft forever
```

I do believe it's not the expected behaviour, current label in yaml configuration file shall be applied during network reconfiguration with `netplan apply`.

If it is the expected behaviour, the documentation should be updated to explain this case.

Best regards,

Tags: netplan
Nementon (nementon)
summary: - netplan / networkd backend / label option not always applied
- configuration apply
+ netplan / networkd backend / label option not always applied on `netplan
+ apply`
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.