[Bug 1770082] Re: set-name doesn't work on boot, only with netplan apply

Daniel Axtens daniel.axtens at canonical.com
Wed May 9 07:47:18 UTC 2018


** Description changed:

+ === systemd issue ===
+ 
+ Renaming devices doesn't seem to work.
+ 
+ If I create /etc/systemd/network/10-network.link with:
+ 
+ [Match]
+ MACAddress=52:54:00:c1:c9:bb
+ 
+ [Link]
+ Name=myiface3
+ 
+ I expect this to cause the device with that MAC address to be named to
+ myiface3. However, when I reboot, I instead see:
+ 
+ $ 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> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
+     link/ether 52:54:00:c1:c9:bb brd ff:ff:ff:ff:ff:ff
+ 
+ The device is not renamed.
+ 
+ This link is pretty much identical to Example 2 in
+ https://www.freedesktop.org/software/systemd/man/systemd.link.html.
+ 
+ Oddly, while it doesn't work on reboot, it does work if you unbind the
+ device and rebind it as netplan apply does.
+ 
+ === Original Bug ==
+ 
  'set-name:' doesn't change the name of a network interface on boot, it
  only works when you do netplan apply.
  
  Say I take this 50-cloud-init.yaml file:
  
  # This file is generated from information provided by
  # the datasource.  Changes to it will not persist across an instance.
  # To disable cloud-init's network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  network:
      version: 2
      ethernets:
          ens3:
              dhcp4: true
              match:
                  macaddress: 52:54:00:de:bd:f6
              set-name: ens3
  
  Say I change set-name to 'myiface3' and reboot. I expect that the device
  will be called myiface3 and brought up fine with dhcp. However, instead
  I see:
  
  $ ip a
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  2: ens3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
  
  The name has not been changed, and the device has not been brought up.
  
  If I run netplan apply however, I see the following:
  
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  3: myiface3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
      inet 192.168.122.151/24 brd 192.168.122.255 scope global dynamic myiface3
         valid_lft 3575sec preferred_lft 3575sec
      inet6 fe80::5054:ff:fede:bdf6/64 scope link
         valid_lft forever preferred_lft forever
  
  So names are successfully changed with netplan apply.
  
  This seems to be some udev-related timing or priority issue that I'm
  still trying to hunt down.
  
  This breaks some forms of migration in certain cloud environments.

** Description changed:

  === systemd issue ===
  
  Renaming devices doesn't seem to work.
  
  If I create /etc/systemd/network/10-network.link with:
  
  [Match]
  MACAddress=52:54:00:c1:c9:bb
  
  [Link]
  Name=myiface3
  
- I expect this to cause the device with that MAC address to be named to
+ I expect this to cause the device with that MAC address to be renamed to
  myiface3. However, when I reboot, I instead see:
  
  $ 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
+     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  2: ens3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
-     link/ether 52:54:00:c1:c9:bb brd ff:ff:ff:ff:ff:ff
+     link/ether 52:54:00:c1:c9:bb brd ff:ff:ff:ff:ff:ff
  
  The device is not renamed.
  
  This link is pretty much identical to Example 2 in
  https://www.freedesktop.org/software/systemd/man/systemd.link.html.
  
  Oddly, while it doesn't work on reboot, it does work if you unbind the
  device and rebind it as netplan apply does.
  
  === Original Bug ==
  
  'set-name:' doesn't change the name of a network interface on boot, it
  only works when you do netplan apply.
  
  Say I take this 50-cloud-init.yaml file:
  
  # This file is generated from information provided by
  # the datasource.  Changes to it will not persist across an instance.
  # To disable cloud-init's network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  network:
      version: 2
      ethernets:
          ens3:
              dhcp4: true
              match:
                  macaddress: 52:54:00:de:bd:f6
              set-name: ens3
  
  Say I change set-name to 'myiface3' and reboot. I expect that the device
  will be called myiface3 and brought up fine with dhcp. However, instead
  I see:
  
  $ ip a
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  2: ens3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
  
  The name has not been changed, and the device has not been brought up.
  
  If I run netplan apply however, I see the following:
  
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  3: myiface3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
      inet 192.168.122.151/24 brd 192.168.122.255 scope global dynamic myiface3
         valid_lft 3575sec preferred_lft 3575sec
      inet6 fe80::5054:ff:fede:bdf6/64 scope link
         valid_lft forever preferred_lft forever
  
  So names are successfully changed with netplan apply.
  
  This seems to be some udev-related timing or priority issue that I'm
  still trying to hunt down.
  
  This breaks some forms of migration in certain cloud environments.

** Description changed:

  === systemd issue ===
  
  Renaming devices doesn't seem to work.
  
  If I create /etc/systemd/network/10-network.link with:
  
  [Match]
  MACAddress=52:54:00:c1:c9:bb
  
  [Link]
  Name=myiface3
  
  I expect this to cause the device with that MAC address to be renamed to
  myiface3. However, when I reboot, I instead see:
  
  $ 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> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/ether 52:54:00:c1:c9:bb brd ff:ff:ff:ff:ff:ff
  
  The device is not renamed.
  
- This link is pretty much identical to Example 2 in
+ This link file is pretty much identical to Example 2 in
  https://www.freedesktop.org/software/systemd/man/systemd.link.html.
  
  Oddly, while it doesn't work on reboot, it does work if you unbind the
  device and rebind it as netplan apply does.
  
  === Original Bug ==
  
  'set-name:' doesn't change the name of a network interface on boot, it
  only works when you do netplan apply.
  
  Say I take this 50-cloud-init.yaml file:
  
  # This file is generated from information provided by
  # the datasource.  Changes to it will not persist across an instance.
  # To disable cloud-init's network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  network:
      version: 2
      ethernets:
          ens3:
              dhcp4: true
              match:
                  macaddress: 52:54:00:de:bd:f6
              set-name: ens3
  
  Say I change set-name to 'myiface3' and reboot. I expect that the device
  will be called myiface3 and brought up fine with dhcp. However, instead
  I see:
  
  $ ip a
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  2: ens3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
  
  The name has not been changed, and the device has not been brought up.
  
  If I run netplan apply however, I see the following:
  
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  3: myiface3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
      inet 192.168.122.151/24 brd 192.168.122.255 scope global dynamic myiface3
         valid_lft 3575sec preferred_lft 3575sec
      inet6 fe80::5054:ff:fede:bdf6/64 scope link
         valid_lft forever preferred_lft forever
  
  So names are successfully changed with netplan apply.
  
  This seems to be some udev-related timing or priority issue that I'm
  still trying to hunt down.
  
  This breaks some forms of migration in certain cloud environments.

** Description changed:

  === systemd issue ===
  
  Renaming devices doesn't seem to work.
  
  If I create /etc/systemd/network/10-network.link with:
  
  [Match]
  MACAddress=52:54:00:c1:c9:bb
  
  [Link]
  Name=myiface3
  
  I expect this to cause the device with that MAC address to be renamed to
  myiface3. However, when I reboot, I instead see:
  
  $ 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> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/ether 52:54:00:c1:c9:bb brd ff:ff:ff:ff:ff:ff
  
  The device is not renamed.
  
  This link file is pretty much identical to Example 2 in
  https://www.freedesktop.org/software/systemd/man/systemd.link.html.
  
- Oddly, while it doesn't work on reboot, it does work if you unbind the
- device and rebind it as netplan apply does.
+ The renaming does work if I boot with net.ifnames=0, and oddly, it also
+ works if I unbind the device and rebind it as netplan apply does.
  
  === Original Bug ==
  
  'set-name:' doesn't change the name of a network interface on boot, it
  only works when you do netplan apply.
  
  Say I take this 50-cloud-init.yaml file:
  
  # This file is generated from information provided by
  # the datasource.  Changes to it will not persist across an instance.
  # To disable cloud-init's network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  network:
      version: 2
      ethernets:
          ens3:
              dhcp4: true
              match:
                  macaddress: 52:54:00:de:bd:f6
              set-name: ens3
  
  Say I change set-name to 'myiface3' and reboot. I expect that the device
  will be called myiface3 and brought up fine with dhcp. However, instead
  I see:
  
  $ ip a
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  2: ens3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
  
  The name has not been changed, and the device has not been brought up.
  
  If I run netplan apply however, I see the following:
  
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  3: myiface3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
      inet 192.168.122.151/24 brd 192.168.122.255 scope global dynamic myiface3
         valid_lft 3575sec preferred_lft 3575sec
      inet6 fe80::5054:ff:fede:bdf6/64 scope link
         valid_lft forever preferred_lft forever
  
  So names are successfully changed with netplan apply.
  
  This seems to be some udev-related timing or priority issue that I'm
  still trying to hunt down.
  
  This breaks some forms of migration in certain cloud environments.

** Tags added: bionic

** Also affects: systemd (Ubuntu)
   Importance: Undecided
       Status: New

** Description changed:

  === systemd issue ===
  
  Renaming devices doesn't seem to work.
  
- If I create /etc/systemd/network/10-network.link with:
+ If I disable all other network configuration and create
+ /etc/systemd/network/10-network.link with:
  
  [Match]
  MACAddress=52:54:00:c1:c9:bb
  
  [Link]
  Name=myiface3
  
  I expect this to cause the device with that MAC address to be renamed to
  myiface3. However, when I reboot, I instead see:
  
  $ 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> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/ether 52:54:00:c1:c9:bb brd ff:ff:ff:ff:ff:ff
  
  The device is not renamed.
  
  This link file is pretty much identical to Example 2 in
  https://www.freedesktop.org/software/systemd/man/systemd.link.html.
  
  The renaming does work if I boot with net.ifnames=0, and oddly, it also
  works if I unbind the device and rebind it as netplan apply does.
  
  === Original Bug ==
  
  'set-name:' doesn't change the name of a network interface on boot, it
  only works when you do netplan apply.
  
  Say I take this 50-cloud-init.yaml file:
  
  # This file is generated from information provided by
  # the datasource.  Changes to it will not persist across an instance.
  # To disable cloud-init's network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  network:
      version: 2
      ethernets:
          ens3:
              dhcp4: true
              match:
                  macaddress: 52:54:00:de:bd:f6
              set-name: ens3
  
  Say I change set-name to 'myiface3' and reboot. I expect that the device
  will be called myiface3 and brought up fine with dhcp. However, instead
  I see:
  
  $ ip a
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  2: ens3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
  
  The name has not been changed, and the device has not been brought up.
  
  If I run netplan apply however, I see the following:
  
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  3: myiface3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
      inet 192.168.122.151/24 brd 192.168.122.255 scope global dynamic myiface3
         valid_lft 3575sec preferred_lft 3575sec
      inet6 fe80::5054:ff:fede:bdf6/64 scope link
         valid_lft forever preferred_lft forever
  
  So names are successfully changed with netplan apply.
  
  This seems to be some udev-related timing or priority issue that I'm
  still trying to hunt down.
  
  This breaks some forms of migration in certain cloud environments.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1770082

Title:
  set-name doesn't work on boot, only with netplan apply

Status in netplan:
  Confirmed
Status in systemd package in Ubuntu:
  New

Bug description:
  === systemd issue ===

  Renaming devices doesn't seem to work.

  If I disable all other network configuration and create
  /etc/systemd/network/10-network.link with:

  [Match]
  MACAddress=52:54:00:c1:c9:bb

  [Link]
  Name=myiface3

  I expect this to cause the device with that MAC address to be renamed
  to  myiface3. However, when I reboot, I instead see:

  $ 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> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/ether 52:54:00:c1:c9:bb brd ff:ff:ff:ff:ff:ff

  The device is not renamed.

  This link file is pretty much identical to Example 2 in
  https://www.freedesktop.org/software/systemd/man/systemd.link.html.

  The renaming does work if I boot with net.ifnames=0, and oddly, it
  also works if I unbind the device and rebind it as netplan apply does.

  === Original Bug ==

  'set-name:' doesn't change the name of a network interface on boot, it
  only works when you do netplan apply.

  Say I take this 50-cloud-init.yaml file:

  # This file is generated from information provided by
  # the datasource.  Changes to it will not persist across an instance.
  # To disable cloud-init's network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  network:
      version: 2
      ethernets:
          ens3:
              dhcp4: true
              match:
                  macaddress: 52:54:00:de:bd:f6
              set-name: ens3

  Say I change set-name to 'myiface3' and reboot. I expect that the
  device will be called myiface3 and brought up fine with dhcp. However,
  instead I see:

  $ ip a
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  2: ens3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff

  The name has not been changed, and the device has not been brought up.

  If I run netplan apply however, I see the following:

  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
  3: myiface3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      link/ether 52:54:00:de:bd:f6 brd ff:ff:ff:ff:ff:ff
      inet 192.168.122.151/24 brd 192.168.122.255 scope global dynamic myiface3
         valid_lft 3575sec preferred_lft 3575sec
      inet6 fe80::5054:ff:fede:bdf6/64 scope link
         valid_lft forever preferred_lft forever

  So names are successfully changed with netplan apply.

  This seems to be some udev-related timing or priority issue that I'm
  still trying to hunt down.

  This breaks some forms of migration in certain cloud environments.

To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1770082/+subscriptions



More information about the foundations-bugs mailing list