Red Hat Bugzilla – Bug 506745
libvirt fails to properly allocate sparse file with "allocation=0" for raw format type.
Last modified: 2015-03-22 21:03:13 EDT
Description of problem:
with <allocation>0</allocation> with volume format type as "raw" libvirt tries to create several MB's of a raw file which is wrong, where as it should have created a few bytes of sparse file.
Version-Release number of selected component (if applicable):
Latest libvirt git log "0e0e542af83557dade5c588a2098e4cb0536ab23"
Using ovirt frontend with NFS configured in one of the storage pools.
Steps to Reproduce:
1. Create 10G a volume on an existing pool of NFS with libvirt version pointing to latest git in the backend i.e ovirt-node-image requires libvirt to be of latest git.
2. taskomatic deamon goes into waiting mode, until libvirt finishes its sparse file write.
3. Results in taskomatic timeout and a failure in volume creation.
A 1.2GB of file created in backend but due to timeout, the volume creation was stopped in bet'n.
Volume file should have been few bytes rather than having around MB's and GB's. This would effect when a sufficiently loaded NFS server doesn't respond.
Allocation of sparse files was fixed upstream in this commit
Author: Cole Robinson <firstname.lastname@example.org>
Date: Mon Jun 22 16:33:24 2009 +0000
Fix raw storage volume creation for allocation < capacity.
CreateXMLFrom changes accidentally caused all raw volume creation to be
fully allocated (as though allocation == capacity). Fix this.
Also force CreateXMLFrom to maintain the previous behavior: sparseness
should still be maintained since we search for holes when copying, and the
clone behavior hasn't been tested with anything but the broken behavior.
This will be included in the 0.7.0 release