install of cloud-init without eth0 will cause boot hang

Bug #714807 reported by Scott Moser
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Unassigned
cloud-init (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: cloud-init

In bug 635188 I made the situation much better for installation of cloud-init on non-cloud instances.

However, it is still broken if you install on a system that does not have eth0 set up.
That is due to /etc/init/cloud-init.conf and the following upstart blob:
| start on (mounted MOUNTPOINT=/ and net-device-up IFACE=eth0 and \
| stopped cloud-init-local )

That ends up causing all of boot to wait indefinitely until IFACE=eth0 is up.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: cloud-init 0.6.0-0ubuntu4
ProcVersionSignature: User Name 2.6.38-2.29-virtual 2.6.38-rc3
Uname: Linux 2.6.38-2-virtual i686
Architecture: i386
Date: Mon Feb 7 19:56:42 2011
Ec2AMI: ami-0e6b9b67
Ec2AMIManifest: (unknown)
Ec2AvailabilityZone: us-east-1c
Ec2InstanceType: t1.micro
Ec2Kernel: aki-407d9529
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 LC_MESSAGES=en_US.utf8
 SHELL=/bin/bash
SourcePackage: cloud-init

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Changed in cloud-init:
importance: Undecided → Medium
status: New → Confirmed
Changed in cloud-init (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Sounds to me like you need an alternative event to run on instead of net-device-up IFACE=eth0 when there's no network.

Scott, per our verbal discussion:

Change cloud-init to have this start on:

start on mounted MOUNTPOINT=/ and ((net-device-up IFACE!=lo) or started cloud-init-no-net)

then add this job

# cloud-init-no-net
start on mounted MOUNTPOINT=/
stop net-device-up IFACE!=lo
task

console output

script
  sleep 5
  echo $UPSTART_JOB "waiting for a network device."
  sleep 25
  echo $UPSTART_JOB "gave up waiting for a network device."
end script
# EOF

This job will only be "started" after the 30 seconds passes (tasks aren't started until they exit 0). It will be stopped and killed if net-device-up IFACE!=lo happens.

The 5 second sleep is for normal situations.. we don't need to print anything on the console in that case. But a user may be confused if we don't do that after 5 seconds.

This does mean that if the network takes over 30 seconds to come up cloud-init will be run without the network.

Some other things could be done to make the timeout more dynamic and help users to avoid making their system take a 30 second nap waiting to boot.. for instance if the cloud type is local files, just exit immediately.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.6.1-0ubuntu1

---------------
cloud-init (0.6.1-0ubuntu1) natty; urgency=low

  * New upstream release.
  * fix for puppet configuration options (LP: #709946) [Ryan Lane]
  * fix pickling of DataSource, which broke seeding.
  * turn resize_rootfs default to True
  * avoid mounts in DataSourceOVF if 'read' on device fails
    'mount /dev/sr0' for an empty virtual cdrom device was taking 18 seconds
  * add 'manual_cache_clean' option to select manual cleaning of
    the /var/lib/cloud/instance/ link, for a data source that might
    not be present on every boot
  * make DataSourceEc2 retries and timeout configurable
  * add 'bootcmd' like 'runcmd' to cloud-config syntax for running things early
  * move from '#opt_include' in config file format to conf_d.
    now local config files should live in /etc/cloud/cloud.cfg.d/
  * move /etc/cloud/distro.cfg to /etc/cloud/cloud.cfg.d/90_dpkg.cfg
  * allow /etc/hosts to be written from hosts.tmpl. which allows
    getting local-hostname into /etc/hosts (LP: #720440)
  * better handle startup if there is no eth0 (LP: #714807)
  * update rather than append in puppet config [Marc Cluet]
  * add cloud-config for mcollective [Marc Cluet]
 -- Scott Moser <email address hidden> Sat, 19 Feb 2011 01:16:10 -0500

Changed in cloud-init (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

fix released in 0.6.1

Changed in cloud-init:
status: Confirmed → Fix Released
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.