[SOLVED] Adding raw image to LVM storage

gdi2k

Renowned Member
Aug 13, 2016
83
1
73
I'm trying to migrate images from a KVM server to Proxmox.

I've seen all the recommendations that I enable image storage on local (not local-lvm), then copy the image there, then attach it to my VM.

The problem is my local storage is too small to accommodate the images I need to import. I made my local storage very small during installation on the recommendations of the forums and now I'm stuck. I have plenty of space on local-lvm and other lvm-storage, but not on local.

I cannot see lvm storage mounts. How can I copy my images straight to LVM storage?
 
I solved my own issue. For anyone in a similar situation: It is possible to dd an existing image straight to the LVM device under /dev/[name_of_volume_group]/vm-xxx-disk-x

In my case, I copied my image from my old server to a USB stick mounted to /mnt on proxmox, then did:

dd if=/mnt/myvirtualmachine.img of=/dev/SSD-1TB/vm-107-disk-1

You have to first create a disk attached to the VM of course, and it does not appear in /dev unless the VM is actually running. So I created a disk attached to the VM, set "Freeze CPU on startup" option, started the VM, ran the above dd command, shutdown the VM, disabled the "Freeze CPU" option, rebooted and... success.