Comment 13 for bug 1770082

Revision history for this message
Ryan Harper (raharper) wrote : Re: [Bug 1770082] Re: systemd-networkd not renaming devices on boot

On Fri, May 11, 2018 at 10:18 AM, Daniel Axtens
<email address hidden> wrote:
> Right. Yes, I can replicate that, thanks heaps!

Great!

>
> So to summarise, you can make the rename take effect on boot if you:
> 1) copy the files from /run/systemd/network -> /etc/systemd/network
> 2) then update-initramfs -u
>
> This seems pretty far outside of the way that netplan is supposed to work -
> indeed using /etc/systemd/ is basically bypassing netplan. So we still have
> the issue that just changing 'set-name' in /etc/netplan/*.yaml doesn't work
> as expected. What should we change so that set-name works as expected?
>
> I see a few options:
>
> 0) Document that set-name is fragile and stop relying on it. This is
> actually really easy to do and I have a netplan patch drafted already. The
> reason that we have no network connectivity when set-name fails is that the
> network file netplan creates maches on *both* the new name and the mac
> address. We can just drop the new name from the [Match] section of the
> relevant .network file and match only on the provided mac address (or
> whatever else was used in the netplan match stanza). This means that
> regardless of the interface name it's brought up and networking works.

IIUC, we want to stop include the Name= value in the .network config since the
name is flaky; we may want to hold off on that as I think we want the naming to
be solid. You've outlined at least one way below. We should make
set-name reliable
and we can do that, even within netplan itself.

>
> 1) Make the initramfs hook for udev copy the files from /run (as well as
> from /lib and /etc) into the initial ramdisk. This is probably my
> preference; we can run netplan generate beforehand to make sure we get a
> clean copy, and then document that update-initramfs is required to get
> stuff to stick.

Yes, I think that's also reasonable, it's a new location where .link
files may be present.

>
> 2) Allow udev to re-rename interfaces. I don't know if this would be
> acceptable to systemd upstream?
>
> 3) Something else?

Netplan can do what cloud-init does and check that if the current name
of an interface doesn't match
the set-name value, to ip link set name on it.

>
> Regards,
> Daniel
>
> --
> You received this bug notification because you are subscribed to
> netplan.
> Matching subscriptions: netplan
> https://bugs.launchpad.net/bugs/1770082
>
> Title:
> systemd-networkd not renaming devices on boot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/netplan/+bug/1770082/+subscriptions