Block I/O crashes after migration

Bug #341682 reported by Takeshi Sone
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
High
Unassigned
kvm (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: kvm

1. Start KVM on host A
2. Make heavy I/O in guest, e.g. while true; do dd if=/dev/zero of=testfile bs=1M count=1k; done
3. Live-migrate to host B
4. Guest freezes (almost 100% reproducible)

Guest responds to ping and sysrq, but all processes are locked hard so I can't type a command from console/ssh.

Live migration works well when guest is idle (when skipped step 2).

Both hosts are jaunty, guest is lenny (linux-image-2.6.26-1-686).
With virtio-block, guest hangs forever, but with ide, guest resumes in several ten seconds after resetting ide0 by itself.
Shared storage is LVM logical volume on DRBD.

KVM command line:
kvm -name lenny -vnc none -k ja -daemonize -m 128 -drive file=/dev/starvm/lenny.root,if=virtio,index=0,boot=on -drive file=/dev/starvm/lenny.swap,if=virtio,index=1 -net nic,vlan=0,macaddr=00:1A:4A:7e:23:59,model=virtio -net tap,vlan=0,script=/usr/local/vmm/ifup-br1,downscript=no -serial telnet:10.0.0.2:11430,server,nowait -monitor telnet:10.0.0.2:11431,server,nowait -incoming tcp:10.0.0.2:11432

Revision history for this message
Takeshi Sone (ts1) wrote :
Changed in kvm:
importance: Undecided → Medium
Revision history for this message
Takeshi Sone (ts1) wrote :

Upgraded KVM packages today but same problem.

root@star3:~# dpkg -l |grep kvm
ii kvm 1:84+dfsg-0ubuntu8 Full virtualization on i386 and amd64 hardwa
ii kvm-source 1:84+dfsg-0ubuntu8 Source for the KVM driver

Revision history for this message
Takeshi Sone (ts1) wrote :

Same problem on Jaunty guest.
Guest kernel was linux-image-virtual.

Revision history for this message
Takeshi Sone (ts1) wrote :

I found a workaround to this problem.
Before starting migration, stop guest (from qemu monitor) and wait 1 second, and cont after migration.
This is not quite "live" migration, but guest kernel happily continues running even under heavy I/O load.
This works for both ide and virtio.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Thanks a lot for the bug report, and the workaround. I'll try to get a setup where I can test this, and confirm it.

:-Dustin

Revision history for this message
Anthony Liguori (anthony-codemonkey) wrote :

http://article.gmane.org/gmane.comp.emulators.kvm.devel/35251

This is a known issue with upstream that's currently being investigated.

Changed in qemu:
importance: Undecided → High
milestone: none → 0.11.0
status: New → Confirmed
Revision history for this message
Dustin Kirkland  (kirkland) wrote :
Revision history for this message
Anthony Liguori (anthony-codemonkey) wrote :

Nope.

Revision history for this message
Anthony Liguori (anthony-codemonkey) wrote :

Author: Glauber Costa <email address hidden>
Date: Mon Jul 6 09:32:09 2009 -0400

    flush pending aio requests

    When we finish migration, there may be pending async io requests
    in flight. If we don't flush it before stage3 starting, it might be
    the case that the guest loses it.

    Signed-off-by: Glauber Costa <email address hidden>
    Signed-off-by: Anthony Liguori <email address hidden>

Changed in qemu:
status: Confirmed → Fix Committed
Revision history for this message
Takeshi Sone (ts1) wrote :

Thank you!
What are the chances that this fix goes into Karmic?

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

This should be fixed in Karmic's qemu-kvm-0.11.

Please reopen if you can reproduce this issue with that package.

:-Dustin

Changed in kvm (Ubuntu):
status: New → Fix Released
Changed in qemu:
status: Fix Committed → Fix Released
Revision history for this message
Michael Tokarev (mjt+launchpad-tls) wrote :

It appears this bug (or similar) is back in 0.12. See Debian bug report #580649 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580649 ).

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.