How to migrate a VMWare vmdk to Proxmox 4.4 with local-lvm storage

That's a workaround for importing vmdk to proxmox vm. And that is what I've done.

1) You can as its as a lvm. You can look at https://www.howtoforge.com/linux_lvm about lvm. Brief structure;

  • pv physical volumes like /dev/sdb1
  • vg volume groups, group of physical volumes
  • lv logical volumes, allocations from vg
    • like /dev/vgname/lvname , you size it

So:

you can see it

lvdisplay

you can mkfs, but careful on proxmox

mkfs.ext4 /dev/vgname/lvname

you can mount it

mount /dev/vgname/lvname /mnt/lvname

2) You must first check vmdk image size. This is important because you can not put a larger image on a smaller block device. details: https://askubuntu.com/questions/657562/extracting-qcow2-image-to-a-smaller-real-drive/657682

qemu-img info disk0.vmdk

image: disk0.vmdk
file format: vmdk
virtual size: 82G (88081432576 bytes)
disk size: 2.0G

You can see disk size, it is vmdk file's disk usage. And virtual size, it is vm's harddisk size.

Then, you create a vm with 82G "ide" disk (in my case)

You can check disk path with:

lvdisplay

Then you copy vmdk over it in raw format:

qemu-img convert -p -O raw disk0.vmdk /dev/vgname/vm-111-disk-1

That's it, works for me.

For size problem, you can resize your vmdk with qemu-img resize your.vmdk 82G or you can resize vm's disk size on web interface. But you MUST check qemu-img info to be sure vmdk smaller than vm's disk.

You can upload files with SFTP or use USB as you can see above. Use different directories or disks, or mount them if it's necessary.

You can use SMB on proxmox, smbclient is already installed I guess. This is not going to break proxmox. Maybe security issues, you can check open ports on proxmox, and limit them for some IP subnets.