#cloud-config in user.user-data not running without ip

Bug #1619238 reported by garyx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I'm having the darndest issue that a cloud config script that is present in a lxc profile and should beapplied on creation is not being run on boot on any image on three different servers when there is no dhcp server or IP present on spun up image.

There is nothing in the logs that indicate an error, the process to apply the cloud data just doesn't run. I can see that data read into /var/lib/cloud/seed/nocloud-net/user-data and it's present. But it is not applied unless I manually give the machine an IP address, not before which is quite annoying as I am applying the IP address through the profile in this instance.

The logs are no help, they just say it ran successfully when I add an IP address manually or are silent about running cloud-init when it doesn't have one.

Revision history for this message
garyx (garyx) wrote :

lxc version 2.0.4
lxd --version 2.0.4

on an up to date Ubuntu 16.04

Revision history for this message
garyx (garyx) wrote :

I realize this might be a cloud-init issue, some input here that nothing from the lxd/lxc side is affecting the cloud-init would be appreciated.

Revision history for this message
Stéphane Graber (stgraber) wrote :

cloud-init in LXD triggers after network is up, so indeed, in your case it won't run.

Your problem is that you have the network defined as DHCP so this will hang your boot and cloud-init. If you had /etc/network/interfaces (or the new cloud-init network-data stuff) marked as "manual", then the network configuration step wouldn't hang and cloud-init would run.

Revision history for this message
Stéphane Graber (stgraber) wrote :

There is a LXD property which should have it update the relevant files for you.

lxc config set <container> user.network_mode link-local

Setting that prior to the first container startup should fix your problem.

Changed in lxc (Ubuntu):
status: New → Invalid
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.