RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1498998 - cloud-init 0.7.9 raises ValueError: Unknown subnet type 'loopback'
Summary: cloud-init 0.7.9 raises ValueError: Unknown subnet type 'loopback'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cloud-init
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ryan McCabe
QA Contact: xiachen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-05 18:56 UTC by Greg Bailey
Modified: 2020-07-15 11:14 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-15 11:14:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
config_drive (521 bytes, text/plain)
2017-10-05 18:57 UTC, Greg Bailey
no flags Details
/var/log/cloud-init.log (89.79 KB, text/plain)
2017-10-05 18:58 UTC, Greg Bailey
no flags Details
Patch for ValueError: Unknown subnet type 'loopback' (682 bytes, patch)
2017-10-05 18:58 UTC, Greg Bailey
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1671927 0 None None None 2017-10-05 19:00:00 UTC

Description Greg Bailey 2017-10-05 18:56:25 UTC
Description of problem:

cloud-init throws an exception when processing the "iface lo inet loopback" entry in the config drive (will attach):

ValueError: Unknown subnet type 'loopback' found for interface 'lo'

Version-Release number of selected component (if applicable):

cloud-init-0.7.9-9.el7.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Boot rhel-server-7.4-x86_64-kvm.qcow2 (we're currently running OpenStack Liberty)
2. Observe network is inaccessible
3. Use spice-console to log in and observe traceback in /var/log/cloud.log (will attach)

Actual results:

Missing /etc/sysconfig/network-scripts/ifcfg-lo
Missing /etc/sysconfig/network-scripts/ifcfg-eth0

Expected results:

Populated /etc/sysconfig/network-scripts/ifcfg-lo
Populated /etc/sysconfig/network-scripts/ifcfg-eth0

Additional info:

The following patch appears to resolve the issue:

--- /usr/lib/python2.7/site-packages/cloudinit/net/sysconfig.py.orig	2017-06-22 11:04:23.000000000 -0400
+++ /usr/lib/python2.7/site-packages/cloudinit/net/sysconfig.py	2017-10-05 09:54:28.861469214 -0400
@@ -299,6 +299,9 @@
                 #    iface_cfg['BOOTPROTO'] = 'static'
                 if _subnet_is_ipv6(subnet):
                     iface_cfg['IPV6INIT'] = True
+            elif subnet_type == 'loopback':
+                iface_cfg['IPADDR'] = '127.0.0.1'
+                iface_cfg['NETMASK'] = '255.0.0.0'
             else:
                 raise ValueError("Unknown subnet type '%s' found"
                                  " for interface '%s'" % (subnet_type,

Comment 2 Greg Bailey 2017-10-05 18:57:37 UTC
Created attachment 1334952 [details]
config_drive

Comment 3 Greg Bailey 2017-10-05 18:58:09 UTC
Created attachment 1334953 [details]
/var/log/cloud-init.log

Comment 4 Greg Bailey 2017-10-05 18:58:49 UTC
Created attachment 1334954 [details]
Patch for ValueError: Unknown subnet type 'loopback'

Comment 6 Ryan McCabe 2017-10-26 15:01:06 UTC
Greg, did you submit the patch attached here upstream? I don't see it attached to the bug report. It may help to move things along. If you don't have time or have not signed the CLA, I could do it for you.

Comment 7 Greg Bailey 2017-10-26 17:37:30 UTC
Hi Ryan, I have not submitted the patch upstream, as I wasn't sure whether RHEL builds of cloud-init would follow a policy of tracking upstream (a la Fedora), or if the plan was to backport fixes to the version already in RHEL.  Given the number of RHEL patches already being applied, I guess I was assuming that Red Hat would likely backport a patch as opposed to pulling a new version from upstream.

I haven't signed the CLA, as I haven't yet had any direct interaction with the cloud-init people, other than with Josh Harlow (who I work with).

Comment 8 Ryan McCabe 2017-10-26 18:02:00 UTC
Our rule is that fixes need to be accepted upstream before we ship them. If the problem is fixed in the current upstream version already, then we'd backport the patch, or rework the fix, if it's not possible to directly backport. I didn't get the impression the issue was resolved upstream, though, as the issue on launchpad is still in the confirmed state.

Comment 9 Ryan McCabe 2017-11-13 16:49:59 UTC
I think this may be fixed as a side-effect of another set of patches that had to be pulled in to fix another network config bug. Could you give the package at people.redhat.com/rmccabe/cloud-init/cloud-init-0.7.9-15.el7.x86_64.rpm a shot to see if it resolves the problem?

Comment 10 Ryan McCabe 2017-11-13 16:50:52 UTC
http://people.redhat.com/rmccabe/cloud-init/cloud-init-0.7.9-15.el7.x86_64.rpm

actual clickable link this time

Comment 11 Ryan McCabe 2017-11-13 16:50:52 UTC
http://people.redhat.com/rmccabe/cloud-init/cloud-init-0.7.9-15.el7.x86_64.rpm

actual clickable link this time

Comment 12 Greg Bailey 2017-11-13 17:44:34 UTC
I tested against cloud-init-0.7.9-15.el7.x86_64.rpm as provided above, and it appears to resolve the issue.

Tested against RHEL 7.4 and CentOS 7.4 images (same images that were used originally when reporting the error), and I'm no longer seeing the exception.

/etc/sysconfig/network-scripts/ifcfg-eth0 appears to contain the expected values.  /etc/sysconfig/network-scripts/ifcfg-lo does not appear to be created but I do see the loopback interface configured.

Comment 14 Rick Barry 2020-07-15 11:14:33 UTC
Based on comment 12, I'm setting this to CLOSED/CURRENTRELEASE. If it turns out that there is still a problem, please re-open.


Note You need to log in before you can comment on or make changes to this bug.