Bug 1199400 - .vdi images: random IO errors / data corruption in VMs
Summary: .vdi images: random IO errors / data corruption in VMs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 21
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-06 06:52 UTC by Dmitry Sutyagin
Modified: 2015-05-01 17:50 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-01 17:50:01 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1428958 0 None None None Never

Description Dmitry Sutyagin 2015-03-06 06:52:56 UTC
Description of problem:

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 installation, etc - totally random.

Version-Release number of selected component (if applicable):
QEMU emulator version 2.1.3 (qemu-2.1.3-2.fc21), Copyright (c) 2003-2008 Fabrice Bellard

How reproducible:
70-80% of tries.

Steps to Reproduce:
1. Create VM with virt-manager
2. Try to install OS
3. Run into a random filesystem-related problem during or after installation (file corruption, fs io error, etc).

Actual results:
VM disk gets corrupted

Expected results:
VM disk does not get corrupted

Additional info:
Running similar setup in VirtualBox works fine every time.
Tried qcow2 and vdi, tried different buses for drive (VirtIO, SATA, SCSI) - result is identical - high chance of disk corruption.

Here's an example qemu command-line generated by virt-manager:
/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

Comment 1 Dmitry Sutyagin 2015-03-11 17:13:30 UTC
I was pointed to a bug in qemu, seems that I did not try qcow2 actually, and problem appeared only with vdi. 
https://bugs.launchpad.net/qemu/+bug/1422307
I am going to stick to qcow2 for now.

Comment 2 Cole Robinson 2015-03-11 17:44:04 UTC
Sounds like this is fixed by:

commit f0ab6f109630940146cbaf47d0cd99993ddba824
Author: Max Reitz <mreitz@redhat.com>
Date:   Fri Feb 27 14:54:39 2015 -0500

    block/vdi: Add locking for parallel requests

Comment 3 Fedora Update System 2015-03-27 20:50:44 UTC
qemu-2.1.3-4.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/qemu-2.1.3-4.fc21

Comment 4 Fedora Update System 2015-03-30 07:07:46 UTC
Package qemu-2.1.3-4.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing qemu-2.1.3-4.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-5025/qemu-2.1.3-4.fc21
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2015-04-02 21:48:36 UTC
qemu-2.1.3-5.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/qemu-2.1.3-5.fc21

Comment 6 Cole Robinson 2015-05-01 17:50:01 UTC
This update was already pushed to stable


Note You need to log in before you can comment on or make changes to this bug.