cloud-image VM causes kernel panic if image is resized
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-initramfs-tools (Ubuntu) |
Won't Fix
|
Low
|
Unassigned |
Bug Description
I'd very much like to use the official cloud images from cloud-images.
If the disk is resized then the VM always crashes with a kernel panic.
Process is as follows:
On a Precise Host running libvirt.
- wget http://
- sudo cp quantal-
- sudo qemu-img resize /var/lib/
- virsh create test.xml
If you view the console in virt-manager you'll find that the kernel has panicked on the disk remount after resizing.
Issuing a 'virsh reset srv-7867c' causes the boot to progress normally. Similarly if the disk isn't resized the boot progresses normally.
You get the same problem with:
- all the standard images - with varying degrees of feedback in the failure message.
- using the RHEL6 version of libvirt and kvm
- if you remove the virtio from the disk stanza and replace with ide emulation.
Any ideas?
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
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: cloud-initramfs
ProcVersionSign
Uname: Linux 3.2.0-37-virtual x86_64
ApportVersion: 2.0.1-0ubuntu17.1
Architecture: amd64
Date: Tue Feb 12 15:48:19 2013
MarkForUpload: True
PackageArchitec
SourcePackage: cloud-initramfs
UpgradeStatus: No upgrade log present (probably fresh install)
no longer affects: | ubuntu-on-ec2 |
affects: | cloud-initramfs-tools (Ubuntu) → ubuntu |
tags: | added: cloud-images cloud-images-build |
affects: | ubuntu → cloud-initramfs-tools (Ubuntu) |
Changed in cloud-init (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |
description: | updated |
This is really interesting. cloud-images. ubuntu. com/quantal/ current/ quantal- server- cloudimg- amd64-disk1. img -O disk.img img,if= virtio -curses -m 256
Its easily reproducible with:
wget wget http://
qemu-img resize disk.img 20G
kvm -serial none -drive file=disk.
The problem is "fixed", if you remove '-serial none' from the kvm cmdline, and thus get the default serial device that kvm appends.
The original test.xml can be fixed in a similar manner by simply adding:
<console type='pty'>
<target type='serial' port='0'/>
</console>
It can also be fixed by mounting the image and removing 'console=ttyS0' from the kernel command lines in /boot/grub/ grub.cfg.
Its hard to see, because observing it makes it work. But, I suspect that the root of the problem is that cloud-initramfs -growpart is writing to stdout, which is redirected to /dev/console, and /dev/console writes are going to the non-existant device 'ttyS0' (as told to by the command line).
Those writes are failing, and something is then leaving the disk in a bad state.