Comment 6 for bug 1103881

Revision history for this message
Scott Moser (smoser) wrote : Re: cloud-final is never executed if upstart is upgraded during initialization of the image

To reproduce outside of "cloud", you can basically follow the blog post that I've got at [1].

Using this user-data to make sure you can login:
#cloud-config-archive
- content: |
   #!/bin/sh
   echo "==== $(date -R): user-script run ===" | tee /run/user-script.log
- filename: myjob.conf
  content: |
   #upstart-job
   description "a test upstart job"
   start on stopped rc RUNLEVEL=[2345]
   console output
   task
   script
   echo "==== $(date -R): upstart job run ===" | tee /run/upstart-job.log
   end script
- content: |
   #cloud-config
   password: passw0rd
   chpasswd: { expire: False }
   ssh_pwauth: True

Then:
sudo apt-get install kvm cloud-utils genisoimage
wget http://cloud-images.ubuntu.com/raring/current/raring-server-cloudimg-amd64-disk1.img -O disk.img.dist
qemu-img convert -O qcow2 disk.img.dist disk.img.orig

qemu-img create -f qcow2 -b disk.img.orig disk.img
cloud-localds my-seed.img my-user-data
kvm -net nic -net user,hostfwd=tcp::2222-:22 \
   -hda disk.img -hdb my-seed.img -m 512

Due to the fact that the bug blocks gettys from running, you'll have to ssh in.
Thats why i've done the host forwarding there.
You'll be able to log in with 'ubuntu' and 'passw0rd'. Remember that console output will be going to the serial device.

--
[1] http://ubuntu-smoser.blogspot.com/2013/02/using-ubuntu-cloud-images-without-cloud.html