desktop live installer: cloud-init/ubuntu-desktop-installer network config naming collisions

Bug #2015605 reported by Chad Smith
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Invalid
Undecided
Unassigned
livecd-rootfs (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Seen on live desktop isos build date:
$ cat /cdrom/.disk/info
Ubuntu 23.04 "Lunar Lobster" - Dail amd64 (20230407)
$ snap list ubuntu-desktop-installer
Name Version Rev Tracking Publisher Notes
ubuntu-desktop-installer 0+git.f46d534e 922 latest/stable/… canonical✓ classic

Desktop live installer prefers NetworkManager backend for network config due to a netplan config file /etc/netplan/01-network-manager.yaml which contains:

network:
  version: 2
  renderer: NetworkManager

livecd-rootfs configures cloud-init to write directly to /etc/NetworkManager/system-connections when discovering network due to a config snippet at
/etc/cloud/cloud.cfg.d/99-installer-use-networkmanager.cfg which sets cloud-init to write directly to /etc/NetworkManager/system-connections with this config:
# Automatically generated by installer build process
system_info:
  network:
    renderers: ['network-manager']
    activators: ['network-manager']

-
This tells cloud-init to write out /etc/NetworkManager/system-connections/cloud-init-enp1s0.nmconnection directly.

Later Ubuntu-desktop-installer(subiquity) starts, it may set network config and write it to /etc/netplan/00-installer.yaml and trigger a 'netplan apply'.

If there is a non-empty netplan config at this time, subiquity writes out /etc/netplan/00-installer.yaml and renames any other existing netplan yaml files to /etc/netplan/*.yaml.dist-subiquity.

Then subiquity(ubuntu-desktop-installer) invokes netplan apply to render all applicable network config to the ephemeral (installer) environment.

When netplan is rendering to `backend: NetworkManager` instead of the default networkd and it'll write /etc/NetworkManager/netplan-*.nmconnection files with connection names scoped under `netplan-`. Cloud-init's rendered connections are scoped under `cloudinit-`. This results in a split brain problem where cloudinit's configuration and netplan's configuration are not aware of each other and netplan isn't aware of any pre-existing /etc/NetworkManager artifacts. We then have conflicting nm connections being defined and named for the same underlying network interfaces. This results in inability to run: nmcli load /etc/NetworkManager/system-connections/cloud-init-enp1s0.nmconnection with errors such as "unknown connection" or "ipv4.gateway: gateway cannot be set if there are no addresses configured"

Ideally we probably want both cloud-init and subiquity to be configuring network in netplan config files so that any merged network config is well known by netplan and results in a single source of truth for network config.

This may mean dropping the overrides provided by livecd-roots setting cloud-init to render directly to network-manager.

Related branches

Chad Smith (chad.smith)
description: updated
Changed in livecd-rootfs (Ubuntu):
importance: Undecided → High
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.821

---------------
livecd-rootfs (2.821) lunar; urgency=medium

  [ Chad Smith ]
  * desktop livecd: allow cloud-init to write netplan config instead of
    directly to /etc/NetworkManager because ubuntu-desktop-installer
    will write netplan config in ephemeral boot stage when
    autoinstall.network is provided. This allows ubuntu-desktop-installer
    to control all netplan config written and apply to the ephemeral boot
    as generated from /etc/netplan/*. (LP: #2015605)

  [ Dan Bungert ]
  * d/control: fix uninstallability of livecd-rootfs due to rsync not being on
    i386.

 -- Dan Bungert <email address hidden> Fri, 07 Apr 2023 17:24:28 -0600

Changed in livecd-rootfs (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Chad Smith (chad.smith) wrote :

Marking invalid for cloud-init as this cloud-init task was added during triage to inform the project of external config changes in place in livecd-rootfs related to cloud-init behavior on Desktop live installer images.

Changed in cloud-init:
status: New → Invalid
Revision history for this message
James Falcon (falcojr) wrote :
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.