cloud-init renames interfaces at every boot

Bug #1773397 reported by Mathieu Trudel-Lapierre
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Every time my VM boots (it was deployed via MAAS), cloud-init will attempt to rename interfaces despite the system being configured differently in /etc/netplan/*.yaml --

Whatever config may be in /etc/netplan, the original name of the interfaces at deployment will be forced by cloud-init via a call to 'ip link set X name Y'.

My netplan config and 50-curtin-networking.cfg are attached -- 50-curtin-networking.cfg was modified to use the 'cloud1' name rather than the original 'ens6' to more clearly show the extra renaming that happens.

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: cloud-init 18.2-41-g3b712fce-0ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-21.22-generic 4.15.17
Uname: Linux 4.15.0-21-generic x86_64
ApportVersion: 2.20.10-0ubuntu2
Architecture: amd64
CloudName: MAAS
Date: Fri May 25 15:10:20 2018
PackageArchitecture: all
ProcEnviron:
 TERM=linux
 PATH=(custom, no user)
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
user_data.txt:

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Attached is the final netplan YAML that should be authoritative for the system.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Attached is /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg.

This file was rewritten based on the same from another instance (since I have to remove the file for the extra renaming step not to happen). The name of the interface was changed from 'ens6' to 'cloud1' to better display the rename that happens -- it's clearer in that case that it's a straight rename by cloud-init rather than unwanted systemd/udev behavior with ifnames.

No other files in /etc/cloud, nor any in /var/lib/cloud were modified.

Revision history for this message
Ryan Harper (raharper) wrote :

Matt,

This is expected behavior. MAAS provides network configuration to cloud-init (via curtin). Cloud-init will rename interfaces that are part of the provided network configuration to ensure the configuration will apply. If you need to reconfigure or provide additional configuration, you have a couple options.

1) You could modify the 50-curtin-networking.cfg with your desired changes
2) You can disable cloud-init networking and provide your own in /etc/netplan

% cat /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg
network:
  config: disabled

Changed in cloud-init (Ubuntu):
status: New → Won't Fix
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.