ubuntu-desktop-installer: cloud-init not configured to use network-manager resulting in unread /etc/netplan/50-cloud-init.yaml

Bug #1982855 reported by Chad Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
livecd-rootfs
New
Undecided
Unassigned

Bug Description

In this ephemeral install environment, the Ubuntu desktop installer prefers to setup NetworkManager for network configuration due to the file

affects:
   ubuntu-deskstop-installer version 0+git.74cbf061 revision 560

cat /etc/netplan/01-network-manager-all.yaml:
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

But cloud-init package default configuration sets network renderers to netplan:

grep -B 1 renderers /etc/cloud/cloud.cfg
  network:
    renderers: ['netplan', 'eni', 'sysconfig']

This results in cloud-init writing discovered network configuration to netplan files which will not be applied to the ephemeral system during boot via custom kernel commandline parameters which will break some potential custom install paths or cloud-init datasource overrides in the emphemeral desktop install environment.

You can see cloud-init trying to render netplan files by default in /var/log/cloud-init.log:
egrep 'netplan|network-manager' /var/log/cloud-init.log
...
2022-07-26 15:43:12,972 - __init__.py[DEBUG]: Selected renderer 'netplan' from priority list: ['netplan', 'eni', 'sysconfig']
2022-07-26 15:43:12,972 - netplan.py[DEBUG]: V2 to V2 passthrough
2022-07-26 15:43:12,972 - util.py[DEBUG]: Writing to /etc/netplan/50-cloud-init.yaml - wb: [644] 491 bytes
2022-07-26 15:43:12,972 - subp.py[DEBUG]: Running command ['netplan', 'generate'] with allowed return codes [0] (shell=False, capture=True)
2022-07-26 15:43:26,106 - __init__.py[DEBUG]: Selected renderer 'netplan' from priority list: ['netplan', 'eni', 'sysconfig']
2022-07-26 15:43:26,106 - netplan.py[DEBUG]: V2 to V2 passthrough
2022-07-26 15:43:26,107 - util.py[DEBUG]: Writing to /etc/netplan/50-cloud-init.yaml - wb: [644] 491 bytes
2022-07-26 15:43:26,107 - subp.py[DEBUG]: Running command ['netplan', 'generate'] with allowed return codes [0] (shell=False, capture=True)
2022-07-26 15:43:26,166 - activators.py[DEBUG]: Attempting command ['netplan', 'apply'] for device all
2022-07-26 15:43:26,166 - subp.py[DEBUG]: Running command ['netplan', 'apply'] with allowed return codes [0] (shell=False, capture=True)
...

Since Desktop ephemeral environment prefers NetworkManager to render network, it should change the default network renderers configured for cloud-init with a supplemental cloud config file

cat > /etc/cloud/cloud.cfg.d/99-installer-use-networkmanager.cfg <<EOF
system_info:
  network:
    renderers: ['network-manager']
EOF

Related branches

Chad Smith (chad.smith)
description: updated
description: updated
description: updated
description: updated
description: updated
Chad Smith (chad.smith)
summary: ubuntu-desktop-installer: cloud-init not configured to use network-
- manager resulting in unread /etc/netplan /50-cloud-init.yaml
+ manager resulting in unread /etc/netplan/50-cloud-init.yaml
description: updated
Dan Bungert (dbungert)
affects: subiquity → livecd-rootfs
Revision history for this message
Chad Smith (chad.smith) wrote :

related bug for cloud-init providing livecd-rootfs the ability to override cloud-init's network activators https://bugs.launchpad.net/livecd-rootfs/+bug/1982857

Revision history for this message
Chad Smith (chad.smith) wrote :

Upstream commit in cloud-init landed in cloud-init to permit the installer to set
the following config in /etc/cloud/cloud.cfg.d/99-something.cfg
```
network:
   renderers: ['network-manager']
   activators: ['network-manager']
```

https://github.com/canonical/cloud-init/commit/6e498773bf153f7b2f5e995a2f2fe24774dd3cab

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers