Description of problem: When I clone a VM with virt-clone the resulted VM have a bigger disk image size, I thinks is the real size given in VM so the growing feature is turned off by the cloning process, for eg: --8<------------------------------------------------------------------ # du -h fedora-rawhide.img 4.8G fedora-rawhide.img # virt-clone --prompt What is the name of the original virtual machine? fedora-rawhide What is the name for the cloned virtual machine? fedora-rawhide-test-vm What would you like to use as the cloned disk (file path) for '/var/lib/libvirt/images/fedora-rawhide.img'? /var/lib/libvirt/images/fedora-rawhide-test-vm.img This will overwrite the existing path '/var/lib/libvirt/images/fedora-rawhide-test-vm.img' Do you really want to use this disk (yes or no) yes Allocating 'fedora-rawhide-test-vm.img' | 18 GB 03:15 Clone 'fedora-rawhide-test-vm' created successfully. # du -h fedora-rawhide-test-vm.img 19G fedora-rawhide-test-vm.img --8<------------------------------------------------------------------ Version-Release number of selected component (if applicable): python-virtinst-0.500.4-1.fc14.noarch libvirt-0.8.3-2.fc14.x86_64 qemu-kvm-0.13.0-1.fc14.x86_64 qemu-img-0.13.0-1.fc14.x86_64 Fedora 14 x86_64 with the latest updates. How reproducible: Always Steps to Reproduce: See above Actual results: Disk image size is big Expected results: Disk image equal to the original (or at least close to) Additional info: Currently, I'm cloning VM with cp and import them to a VM.
The same issue with newer packages: python-virtinst-0.500.6-1.fc14.noarch libvirt-0.8.3-9.fc14.x86_64 gpxe-roms-qemu-1.0.1-3.fc14.noarch qemu-common-0.13.0-1.fc14.x86_64 qemu-img-0.13.0-1.fc14.x86_64 qemu-kvm-0.13.0-1.fc14.x86_64 qemu-system-x86-0.13.0-1.fc14.x86_64
It seems to be getting rid of sparseness. What does virt-df say about the original image?
I don't have the original VM, so I've done new tests. NB. 'fedora-rawhide-test' is cloned from 'fedora-rawhide': ]# du -h fedora-rawhide* 7.8G fedora-rawhide.img 19G fedora-rawhide-test.img ]# virt-df fedora-rawhide Filesystem 1K-blocks Used Available Use% fedora-rawhide:/dev/sda1 495844 72117 398127 15% fedora-rawhide:/dev/vg_f15test/lv_root 17029980 5702312 11154720 34% ]# virt-df fedora-rawhide-test Filesystem 1K-blocks Used Available Use% fedora-rawhide-test:/dev/sda1 495844 72117 398127 15% fedora-rawhide-test:/dev/vg_f15test/lv_root 17029980 5702312 11154720 34%
Updated summary line. It's not likely we can fix this for the existing virt-clone, but it's something to consider for the rewrite (or whatever we decide to do with virt-clone in the end). As an aside, you can use qemu-img to reintroduce sparseness into any image. Just do a dummy conversion from (eg.) raw to raw and qemu-img will detect zeroes and make the output sparse. For raw (only) you can also just use the 'cp' command to add sparseness. It's all explained in the link below. https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/
Ok, thank you for the info, I'll stick with my cp/virt-install --import script, I'll be glad to test virt-clone NG.
*** This bug has been marked as a duplicate of bug 522720 ***