Migrating a VM from ovirt to VMware ESXi
- April
- 16
12:03 pm Mac
I'm using ovirt 4.3x and decided to migrate some VMs to ESXi 6.5.
First thing to do is find the disk file. It can be found easily through the UI of ovirt-engine under Storage/Disks. That table shows the UUID of the folder that the disk is in.
Get a shell on the ovirt node and find the file under /rhev/data-center/mnt/... somewhere probably. It's actually inside the directory that you found above. There are probably three files in there.
Use the qemu-img tool to convert it from raw to vmdk like this:
qemu-img convert -f raw
d60c630e-4bc8-44ea-a842-1381f19993b4
-O vmdk newdisk.vmdk -o compat6
It will take a while.
When done, move it to your ESXi datastore somehow (scp, whatever). Then shell into your ESXi machine, make a temporary directory and clone the disk like this:
vmkfstools -i /vmfs/volumes/datastore0/newdisk.vmdk -d thin /vmfs/volumes/datastore0/newvm-dir/newdisk.vmdk
Fix up the disk controller type in the new vmdk file, change it to lsilogic with your favorite text editor.
cd newvm-dir
vi newdisk.vmdk
Now build a VM the normal way and attach the disk in ESXi. I usually build the VM and don't put any disk on it. Then I move the new disk file into the VMs directory, go back and attach the disk to the VM.
You may have to 'rescue' the system and use dracut -f to get it to boot successfully with a new initramfs image. I generally attach an ISO CDROM and boot to it and use the rescue feature. I've found that CentOS needs this step, Ubuntu and FreeBSD don't seem to require it and happily boot.
Although I haven't encountered this yet, I noticed that the last VM I built on ESXi 6.7 made the default boot EFI instead of BIOS. I think I would have to change the VM to use BIOS if I wanted to use the procedure above.
« Freebie gift almost causes catastrophe | Fixing pending sector errors on FreeNAS » |