cloudinit/net/sysconfig.py lacks support for openSUSE 15.x and Tumbleweed

Bug #1843584 reported by Thomas Hipp on 2019-09-11
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Medium
Unassigned

Bug Description

On openSUSE 15.x and Tumbleweed, network config fails due to a missing network renderer. Adding 'opensuse-leap' and 'opensuse-tumbleweed' to `KNOWN_DISTROS` solves the problem.

Please extend `KNOWN_DISTROS` to support newer versions of openSUSE.

Related branches

Paride Legovini (legovini) wrote :

Thanks for the bug report Thomas.

Changed in cloud-init:
status: New → Triaged
Ryan Harper (raharper) wrote :

Can you provide the output from: sudo cloud-init collect-logs?

Launching an opensuse-tumbleweed instance on LXD shows that cloud-init does render network-config

tumble1:~ # cat /etc/os-release
NAME="openSUSE Tumbleweed"
# VERSION="20190909"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20190909"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20190909"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
LOGO="distributor-logo"

tumble1:~ # cat /etc/sysconfig/network/ifcfg-eth0
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEVICE=eth0
NM_CONTROLLED=no
ONBOOT=yes
STARTMODE=auto
TYPE=Ethernet
USERCTL=no

Ryan Harper (raharper) wrote :

Note that cloud-init uses the 'variant' value to determine the distro:

tumble1:~ # python3 -c 'import pprint; from cloudinit import util; pprint.pprint(util.system_info())'
{'dist': ('opensuse-tumbleweed', '20190909', 'x86_64'),
 'platform': 'Linux-4.15.0-58-generic-x86_64-with-glibc2.2.5',
 'python': '3.7.3',
 'release': '4.15.0-58-generic',
 'system': 'Linux',
 'uname': uname_result(system='Linux', node='tumble1', release='4.15.0-58-generic', version='#64~16.04.1-Ubuntu SMP Wed Aug 7 14:10:35 UTC 2019', machine='x86_64', processor='x86_64'),
 'variant': 'suse'}

So, opensuse and friends are reported to cloud-init as 'suse' which is in the list for rendering.

Let's see what's actually wrong in your instance after posting the cloud-init logs.

Thomas Hipp (monstermunchkin) wrote :

Note that we modify sysconfig.py for our openSUSE cloud-init images to support Leap and Tumbleweed [1]. That might be the reason it works for you. If I change the string back to 'opensuse', it fails.

[1] https://github.com/lxc/lxc-ci/blob/master/images/opensuse.yaml#L140

Ryan Harper (raharper) wrote :

That's really unfortunate (the hacking of cloud-init).

It looks like the sysconfig renderer uses:

# python3 -c 'from cloudinit import util; print(util.get_linux_distro()[0])'
opensuse-tumbleweed

To select the distro name, when it really should be using util.system_info()['variant']

Changed in cloud-init:
importance: Undecided → Medium
Ryan Harper (raharper) on 2019-09-26
Changed in cloud-init:
status: Triaged → In Progress

This bug is fixed with commit 0948cdfb to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=0948cdfb

Changed in cloud-init:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers