Hide Forgot
Description of problem: After reading this thread: http://www.mail-archive.com/qemu-devel@nongnu.org/msg59049.html It seems like, for extra safety, libvirt's storage driver ought to be calling fdatasync(fd) after creating any storage volumes (particularly if doing volume cloning) to ensure the new volume is committed to underlying storage. It seems like the current code allows for potential data loss to the newly created volume upon host crash. Alternatively, we might want to use O_DIRECT when initializing storage volumes with explicit data writes. Version-Release number of selected component (if applicable): libvirt-0.8.7-11.el6 How reproducible: Unclear, possible data loss from new storage volume if host crashes immediately after the volume has been copied. Steps to Reproduce: 1. Create a new raw volume in libvirt, cloning data from an existing volume 2. Kill the host non-gracefully 3. See if data is still present in new volume after reboot. Actual results: Expected results: Additional info:
Since RHEL 6.1 External Beta has begun, and this bug remains unresolved, it has been rejected as it is not proposed as exception or blocker. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
Moving to POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-August/msg00539.html commit b4cdf3d74920c8c3dc3dbea9a467782238b9f585 Author: Michal Privoznik <mprivozn> Date: Thu Aug 18 14:40:03 2011 +0200 storage: Flush host cache after write Although we are flushing cache after some critical writes (e.g. volume creation), after some others we do not (e.g. volume cloning). This patch fix this issue. That is for volume cloning, writing header of logical volume, and storage wipe. (cherry picked from commit b32f8b19894c2a05e5955056caa45cb4cb0babeb)
Verified with libvirt-0.9.4-5.el6.x86_64, it's fixed. Move it to VERIFIED. 1) Clone a raw volume by libvirt. # virsh vol-clone foo.img foo-clone.img --pool default Vol foo-clone.img cloned from foo.img # qemu-img info /var/lib/libvirt/images/foo-clone.img image: /var/lib/libvirt/images/foo-clone.img file format: raw virtual size: 6.0G (6442450944 bytes) disk size: 6.0G # virsh start foo-clone Domain foo-clone started 2) In guest, copy a file via network, and then executing below command to make host crash immediately. # echo 1 > /proc/sys/kernel/sysrq # echo c > /proc/sysrq-trigger 3) Checking copied file which is still present in new volume after reboot.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1513.html