random IO errors / data corruption in VMs (created and executed via virt-manager)

Bug #1428958 reported by Dmitry Sutyagin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

I have recurring problems with VM installation and usage - data on VM disk gets corrupted at some point and it causes all sorts of problems - sometimes I cannot even install base system, other times some .so files are corrupt after isntallation, etc - totally random.
I use virt-manager to create and run VMs. I have also tried creating VMs via virt-install, result is identical.
If I use VirtualBox I have no such problems.
My OS is Fedora 20 upgraded to 21, qemu and libvirt are installed from Fedora official repos.

Here's an example qemu command-line:
/usr/bin/qemu-system-x86_64
-machine accel=kvm
-name fuel
-S
-machine pc-i440fx-2.1,accel=kvm,usb=off
-cpu SandyBridge,+invpcid,+erms,+bmi2,+smep,+avx2,+bmi1,+fsgsbase,+abm,+pdpe1gb,+rdrand,+f16c,+osxsave,+movbe,+pcid,+pdcm,+xtpr,+fma,+tm2,+est,+smx,+vmx,+ds_cpl,+monitor,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds,+vme
-m 3142
-realtime mlock=off
-smp 2,sockets=2,cores=1,threads=1
-uuid 27693a46-7a50-4a3c-bcaf-bf061ba469ed
-no-user-config
-nodefaults
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/fuel.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control
-rtc base=utc,driftfix=slew
-global kvm-pit.lost_tick_policy=discard
-no-hpet
-no-shutdown
-boot menu=on,strict=on
-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x6.0x7
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x6
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x6.0x1
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x6.0x2
-device lsi,id=scsi0,bus=pci.0,addr=0xa
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x7
-drive file=/home/virtual-disks/fuel.vdi,if=none,id=drive-virtio-disk0,format=vdi
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x8,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-drive file=/home/dsutyagin/Downloads/iso/MirantisOpenStack-6.0.iso,if=none,id=drive-scsi0-0-0,readonly=on,format=raw
-device scsi-cd,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0,bootindex=2
-netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:0d:42:2d,bus=pci.0,addr=0x3
-netdev tap,fd=25,id=hostnet1,vhost=on,vhostfd=26
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:a4:8c:ef,bus=pci.0,addr=0x4
-chardev pty,id=charserial0
-device isa-serial,chardev=charserial0,id=serial0
-chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/fuel.org.qemu.guest_agent.0,server,nowait
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0
-chardev spicevmc,id=charchannel1,name=vdagent
-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0
-device usb-tablet,id=input0
-spice port=5900,addr=127.0.0.1,disable-ticketing,seamless-migration=on
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2
-device intel-hda,id=sound0,bus=pci.0,addr=0x5 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0
-chardev spicevmc,id=charredir0,name=usbredir
-device usb-redir,chardev=charredir0,id=redir0
-chardev spicevmc,id=charredir1,name=usbredir
-device usb-redir,chardev=charredir1,id=redir1
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x9
-msg timestamp=on

If this is not a bug, I'd be happy if you help me fix this problem. I am sorry if this is not the proper place to post such a problem.

qemu-system-x86_64 --version
QEMU emulator version 2.1.3 (qemu-2.1.3-2.fc21), Copyright (c) 2003-2008 Fabrice Bellard

qemu-kvm --version
QEMU emulator version 2.1.3 (qemu-2.1.3-2.fc21), Copyright (c) 2003-2008 Fabrice Bellard

Revision history for this message
Kevin Wolf (kwolf-redhat) wrote :

Can you please retry with current qemu.git master? I suspect that this is a duplicate of https://bugs.launchpad.net/qemu/+bug/1422307 and fixed in commit f0ab6f10 (a bug in the code handling VirtualBox's VDI image format).

In general, running VMs with image formats of other hypervisors is not recommended, both for reliability and performance reasons. You may want to consider using qcow2 or raw instead.

Revision history for this message
Dmitry Sutyagin (dsutyagin) wrote :

I have tried using qcow2 and the problem does not appear anymore. I guess it was a bug with VDI implementation indeed. Please close the ticket. Thank you very much for your help!

Revision history for this message
Stefan Hajnoczi (stefanha) wrote : Re: [Qemu-devel] [Bug 1428958] [NEW] random IO errors / data corruption in VMs (created and executed via virt-manager)

On Fri, Mar 06, 2015 at 06:50:30AM -0000, Dmitry Sutyagin wrote:
> I have recurring problems with VM installation and usage - data on VM disk gets corrupted at some point and it causes all sorts of problems - sometimes I cannot even install base system, other times some .so files are corrupt after isntallation, etc - totally random.
...
> -drive file=/home/virtual-disks/fuel.vdi,if=none,id=drive-virtio-disk0,format=vdi

Hi Dmitry,
A bug that can lead to corruption was recently discovered in the vdi
image format code in QEMU.

The vdi image format code is only designed to work for
importing/exporting image files in qemu-img convert. It is not suitable
for running guests and achieving good I/O performance.

I recommend using raw or qcow2 image files instead.

Stefan

Revision history for this message
Thomas Huth (th-huth) wrote :

Closing according to comment #2.

Changed in qemu:
status: New → Fix Released
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.