Cloud- init doesn't configure network interfaces in Ubuntu 16.04

Bug #1577747 reported by krath
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Invalid
Undecided
Unassigned

Bug Description

I'm running vmbuilder 0.12.4 on an Ubuntu 16.04 server to create an Ubuntu 16.04 cloud image.
cloud-init 0.77 is being added to run the cloud image in OpenStack.

Upon starting the VM in OpenStack,
cloud-init fails because the network interface can't be established.
That seems to be related to discrepancy between
/etc/network/interfaces
and
/etc/network/interfaces.d/50-cloud-init.cfg

--> in /etc/network/interfaces, the primary network interface is eth0, whereby in cloud-init it is ens32

auto eth0
iface eth0 inet dhcp

--> changing eth0 to ens32 correctly establishes the network interface

Revision history for this message
Scott Moser (smoser) wrote :

Please remove your /etc/network/interfaces definition of 'eth0', and instead have something like below.
Essentially ENI needs to have 'source /etc/network/interfaces/*.cfg' for cloud-init to work correctly. The static 'eth0.cfg' is no longer functional since.

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# Source interfaces
# Please check /etc/network/interfaces.d before changing this file
# as interfaces may have been defined in /etc/network/interfaces.d
# See LP: #1262951
source /etc/network/interfaces.d/*.cfg

Revision history for this message
krath (thorsten-krause) wrote :

Hey,

that solves the problem, thanks

Changed in cloud-init:
status: New → Invalid
Revision history for this message
kalopaidi (kalopaidi7) wrote :

I am using packer to create templates for cloudstack.
CloudStack 4.2.1
cloud-init 0.77
packer 0.10.0

On a 16.04 instance I followed what is described on post #1 and it works for me also.

When create a new template that deletes the definitions at /etc/network/interfaces, for the instances from that template cloud-init fails because the network interface doesn't come up.

Any ideas?

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.