[virt-tools-list] vmdk to LVM

Richard W.M. Jones rjones at redhat.com
Wed Jun 13 10:49:15 UTC 2012

On Mon, Jun 11, 2012 at 04:56:04PM +0300, Mihamina Rakotomandimby wrote:
> Hi all,
> I use to install my KVM VMs with (I shorten):
>   $ sudo lvcreate -n a-lvm [...]
>   $ sudo virt-install [...]  --disk path=/dev/mapper/a-vg/a-lvm
> A colleague went with a bunch of "*.vmdk" that I think I can use:
> http://goo.gl/KxigR
> I would like to stick with my convention to use one LVM per VM, so
> I'm looking for some resources teaching how to switch from a file
> disk image to a LVM:
> - How to calculate the right size to pass to "lvcreate"?

qemu-img info

> - How to transfert the file image to the LVM?

qemu-img convert

However note that qemu has some problems with VMDK files.  Mostly
these are solved if you use a new enough version of qemu/qemu-img, but
the version in CentOS 6 definitely *won't* work for VMDK 4 files (in
fact, it will silently corrupt them).

> One solution could be to create a LVM, format it mount it, copy the
> disk image on it, but it's crappy  (add one unnecessary FS layer).
> My host system is an up to date CentOS6.
> The guests are VirtualBox VM with legacy browsers (IE6, FF3.6,...).

If you're planning to run them under KVM you may need to do some
manual v2v work.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.

More information about the virt-tools-list mailing list