Comment 14 for bug 1235231

Revision history for this message
Scott Moser (smoser) wrote : Re: ci-info: eth0 not reliable in latest saucy images

Heres a simple reproduce that shows the issue.
it seems racy condition like.

rel="saucy"
dimg="$rel-server-cloudimg-amd64-disk1.img"
dbase_url="http://cloud-images.ubuntu.com/$rel/current/"

mylogger_url="https://launchpadlibrarian.net/152522734/my-logger.conf"

## get files and prereqs
sudo apt-get install cloud-image-utils

wget "${dbase_url}$dimg" -O $dimg.dist
wget "$mylogger_url" -O my-logger.conf

cat > user-data <<EOF
#cloud-config
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
EOF

# create a 'seed.img' for cloud-init local datasource
cloud-localds seed.img user-data

# create a 'disk1.img' backed by the downloaded disk
qemu-img create -f qcow2 -b $dimg.dist disk1.img

# patch it with 'my-logger.conf'
sudo mount-image-callback -v disk1.img -- \
   sh -c 'cp my-logger.conf $MOUNTPOINT/etc/init/my-logger.conf'

# boot in kvm with log to 'serial.log'
kvm -net nic -net user,hostfwd=tcp::2222-:22 \
   -drive file=disk1.img,if=virtio -drive file=seed.img,if=virtio \
   -serial file:serial.log -curses

# after the system boots, you can ssh to localhost on port 2222 and
# log in with 'ubuntu' and 'passw0rd'
# you'll see that /run/my.log has output in it.