Migrate from bhyve to vmware

Status
Not open for further replies.

skywise_ca

Dabbler
Joined
Jun 22, 2017
Messages
15
I've got a couple of bhyve linux VMs that I'd like to move to ESXi.
Is it possible to extract the disk image from freeNAS and import to vmware?
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
ESXi only supports vmdk disk images. You can use qemu-img to convert diks image types. If you are using zvols convert from raw and point to the block device i.e. /dev/zvol/zvol_name. Hmm.. I'm not sure if FreeNAS has that built in... I'll have to check tomorrow.

Either way you may want to make note of your MAC address and clone that to the VMware vm to preserve networking.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Just to add to this, you'll be using dd to get the data out:

dd if=/dev/zvol/zvol_name of=/mnt/tank/path/file.img

I imagine that qemu-img will handle this for you, but you will need to keep in mind that block sizes accepted by VMware are restricted (I think 512B and 4KB only), so you may need to specify a block size with dd if things don't work out.
 

skywise_ca

Dabbler
Joined
Jun 22, 2017
Messages
15
Thank you for the hints, with these I was able to get my VMs moved.
For anyone else trying to move from bhyve to VMware (ESXi in my case) here is how I did it.
---
dd from zfs to raw file.
dd if=/dev/zvol/vol8TB/<vmname> of=/nasFS/path/<vmname>.raw bs=1m

Turn into vmdk using linux (ubuntu in my case)
apt-get install qemu-utils
qemu-img convert -O vmdk <vmname>.raw <vmname>.vmdk

Create VM in ESXi leaving off a disk for now.

Move vmdk to ESXi
scp <vmname>.vmdk root@192.168.0.1:/vmfs/volumes/path-of-created-vm/

convert to esx disk image.
vmkfstools -i <vmname>.vmdk <vmname>-esx.vmdk

add the newly created vmdk to VM using 'add existing disk'

change VM's options to boot EFI not BIOS

Boot up and fix name of network interface in /etc/network/interfaces
---
I think the vmkfstools can be left off if you're using Workstation or fusion, but I didn't try so I'm not sure.
 
Status
Not open for further replies.
Top