KVM: from disk image to LVM
In the beginning I was creating virtual machines out of physical ones, overbooking their size to make guests believe they had, say, 30G, while the hard drive just had 20.
With the passing of time, these disk images were growing and growing, and performances went lower and lower.
So I’ve followed this guide, and found a problem at paragraph 8: converting an image file into a raw LVM volume does NOT work, at least with the current version of KVM available on Debian Lenny.
The solution is quite simple, even if time and disk space consuming, and it came from this post.
First create a raw image file:
kvm-img convert disk0.qcow2 -O raw disk0.raw
Then DD it to the LVM volume
dd if=disk0.raw of=/dev/vg01/vm1 bs=1M
Voilą!