Serial console device required for runcmd to take effect
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://
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-
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/
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.
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: pack-[a- z][a-z] $" cloud/instance/ locale- check.skip _______ _______ _______ _______ _______ _______ _______ _______ ______
apt-cache search "^language-
To disable this message for all users, run:
sudo touch /var/lib/
_______