Convert a raw disk to qcow2 from oVirt on NFS - 2022-06-03
I am migrating my environment from oVirt to Proxmox and wanted to convert my disks to qcow2.
First, shut down the VM you are wanting to migrate.
In the oVirt Virtualization Manager go to Storage -> Disks and find the disk(s) associated with the VM you want to migrate.
Locate the ID column and copy that text. (Ctrl+C as right-click does other things)
ssh to an oVirt node and run the following replacing DISK_ID with the ID you selected. If this returns more than one line you probably have snapshots that need to be deleted before this will work.
DISK_PATH=$(for i in $(find /rhev/data-center/mnt -type d -name DISK_ID); do echo -n "$i/"; ls --ignore="*.*" $i/; done)
Replace /mnt/tmp with wherever has enough space to hold the image and will be easily accessible from a Proxmox host. I placed mine on an NFS mount that was accessible to both machines.
qemu-img convert -p - fraw -O qcow2 $DISK_PATH /mnt/tmp/vm_name-disk1.qcow2
Create a VM in Proxmox with the specs wanted and once it's created detach and remove it's disk(s). Note the VM ID for use in the next command and replace VM_ID with it. Also replace the STORAGE_ID with the id of the storage you wish to place it on.
qm importdisk VM_ID /mnt/tmp/vm_name-disk1.qcow2 STORAGE_ID