Comment 8 for bug 1671927

Revision history for this message
In , Greg (greg-redhat-bugs) wrote :

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,