Serial console device required for runcmd to take effect

Bug #1262878 reported by James Slagle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
New
Undecided
Unassigned

Bug Description

Not sure if this should actually be considered a bug or not. But, figured I'd submit it anyway.

My cloud image is ubuntu-13.10, amd64, downloaded from here: http://cloud-images.ubuntu.com/saucy/current/saucy-server-cloudimg-amd64-disk1.img. I'm testing locally in libvirt with virsh, etc.

I'm using the OpenStack Config Drive as my only data source. It provides a user_data file that has the following contents:

#cloud-config
runcmd:
  - touch /cloudinit-runcmd-done

I could not get that "touch" command to run. To help debug, I added the following line as well:

output: {all: '| tee -a /var/log/cloud-init-output.log'}

After adding that line, I noticed that the touch command ran fine. So, to summarize: w/o an output:{...} line in the user-data, my runcmd does not execute. Eventually I narrowed the issue down to the fact that my vm was missing a defined serial console. After adding the following to my libvirt xml for my vm, my runcmd runs fine with *or* without an output line in the user-data:

    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>

The only thing I can figure is that adding the output line, causes util.fix_output to get executed which must trigger something so that cloud-init keeps running to the stage where runcmd's are executed.

Revision history for this message
James Slagle (james-slagle) wrote :

Further, it's not just runcmd's that don't get executed with no serial console defined and no output line in the user_data.

It actually seems the entire /etc/init/cloud-config.conf upstart job is never started and thus the cloud-final.conf job as a result. Which would explain why the runcmd's aren't run.

When I login to the vm via ssh, I see a warning that the locale has not been compiled, which should happen as well as part of cloud-config.conf:
_____________________________________________________________________
WARNING! Your environment specifies an invalid locale.
 This can affect your user experience significantly, including the
 ability to manage packages. You may install the locales by running:

   sudo apt-get install language-pack-en
     or
   sudo locale-gen en_US.UTF-8

To see all available language packs, run:
   apt-cache search "^language-pack-[a-z][a-z]$"
To disable this message for all users, run:
   sudo touch /var/lib/cloud/instance/locale-check.skip
_____________________________________________________________________

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

Related bugs:
 * bug 1122245: booting from a cloud image hangs until virsh console is used
 * bug 1061977: Machine fails to commission when console=ttyS0 is present on kernel opts
 * bug 1016695: add console=tty1 to cloud-image kernel boot parameters
 * bug 1123220: cloud-image VM causes kernel panic if image is resized
 * bug 1061977: Machine fails to commission when console=ttyS0 is present on kernel opts

I'm marking this as a dupe of bug 1123220. There is more conversation there. The main issue is not being able to pick a /dev/console in any sane and predictable manner.

Thoughts or suggestions are welcome.

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.