Wednesday, February 27, 2013

Easy conversion from VMDK to Proxmox

I kind of stumbled on this accidentally, but it has worked in the one instance in which I have tried it so far.

Proxmox uses KVM/QEMU for virtualization and stores disk images in raw format. Converting from a VMDK to a raw format is simple:

$ qemu-img convert -f vmdk my-vmdk.vmdk -O raw my-raw-image.raw


You can check the format if you like:

$ qemu-img info my-raw-image.raw 
image: my-raw-image.raw
file format: raw
virtual size: 8.0G (8589934592 bytes)
disk size: 1.8G

However Proxmox as far as I can tell has no method for simply choosing a virtual drive to use for a VM. So you have to create a VM (not a VZ container) using the regular Proxmox web interface (choose "no media" for the installation step since we won't be installing anything), then replace the raw image created for the new VM with the one created in the step above.

$ scp my-raw-image.raw root@PROXMOX-IP:/var/lib/vz/data/images/VM_ID/vm-VM_ID-disk-1.raw

In my instance this would be basically:

$ scp my-raw-image.raw root@192.168.1.100:/var/lib/vz/data/images/104/vm-104-disk-1.raw


The particularities here can change, so its probably better to ssh to the Proxmox server yourself and make sure the file/folder names are what you expect.

Anyway after this process I booted my VM, and it came right up, although it did inform me that I needed to run fsck (disk checker).

Note: If your virtual machine image has multiple partitions, I have no idea what you need to do, but take a look here for ideas, though the actual steps didn't work for me.

1 comment:

  1. I'm just glad that after 4 years, someone found this useful! :)

    ReplyDelete