How to export bhyve VM for migration to proxmox?

Hello, I want to migrate a bhyve VM to proxmox in preparation for upgrading to SCALE. What do I need to do to get an image (bootable?) of the VM so that I can use it as a disk on the proxmox host? Will

sudo dd if=/dev/zvol/maindata/iohyve/www-bhyve/disk0_dpim64_gui_clone0 of=./www-bhyve.dd bs=8192 status=progress

…create the proper image, or what should I be dd’ing from?

[n@freenas ~]$ iohyve info www-bhyve
Guest                              Size  CPU  RAM  Pool      OS      Loader      Tap   Con
www-bhyve                          -     2    4GB  maindata  debian  grub-bhyve  tap0  nmdm0
www-bhyve/disk0                    16G   -    -    maindata  -       -           -     -
www-bhyve/disk0_dpim64_gui_clone0  16G   -    -    maindata  -       -           -     -
[n@freenas ~]$ zfs list | grep iohyve
maindata/iohyve                                              134G  1.07T   140K  /mnt/maindata/iohyve
maindata/iohyve/Firmware                                    2.30M  1.07T   128K  /mnt/maindata/iohyve/Firmware
maindata/iohyve/Firmware/BHYVE_UEFI.fd                      1017K  1.07T   936K  /mnt/maindata/iohyve/Firmware/BHYVE_UEFI.fd
maindata/iohyve/Firmware/BHYVE_UEFI_CSM.fd                  1.02M  1.07T   959K  /mnt/maindata/iohyve/Firmware/BHYVE_UEFI_CSM.fd
maindata/iohyve/ISO                                          302K  1.07T   128K  /mnt/maindata/iohyve/ISO
maindata/iohyve/www-bhyve                                    134G  1.07T   128K  /mnt/maindata/iohyve/www-bhyve
maindata/iohyve/www-bhyve/disk0                              134G  1.08T  15.4G  -
maindata/iohyve/www-bhyve/disk0_dpim64_gui_clone0           81.4K  1.07T  7.68G  -

Not sure why this does not work…

[n@freenas ~]$ sudo iohyve export www-bhyve
Password:
Exporting www-bhyve. Note this may take some time depending on the size.
Not a valid guest name
[nils@freenas ~]$ iohyve list
Guest      VMM?  Running  rcboot?  Description
www-bhyve  NO    NO       YES      Sat Mar  4 16:29:47 CET 2017

EDIT: Solved this part with

sudo ln -s  /mnt/maindata/iohyve /iohyve 
# ...same as iohyve setup pool=poolname

…according to GitHub - pr1ntf/iohyve: FreeBSD bhyve manager utilizing ZFS

It tried to create the export in /tmp (which is linked to /var/tmp and is too small at 11gb) in an iohyve directory, so I symlinked it to a temp dir in the main pool.

[n@freenas /var/tmp]$ sudo iohyve export www-bhyve
Password:
Exporting www-bhyve. Note this may take some time depending on the size.
Creating temp directory...
Exporting properties...
Exporting disks...
16384+0 records in
16384+0 records out
17179869184 bytes transferred in 976.423623 secs (17594688 bytes/sec)
16384+0 records in
16384+0 records out
17179869184 bytes transferred in 367.638817 secs (46730292 bytes/sec)
Compressing to archive...
Removing temp directory...
[n@freenas ~]$ ll -h tmpiohyve/www-bhyve/
total 11439282
drwxr-xr-x  2 root  data     5B Jul  9 19:43 ./
drwxr-xr-x  3 n     data     3B Jul  9 19:27 ../
-rw-r--r--  1 root  data    16G Jul  9 19:49 disk0_dpim64_gui_clone0.img
-rw-r--r--  1 root  data    16G Jul  9 19:43 disk0.img
-rw-r--r--  1 root  data   291B Jul  9 19:27 properties.ucl

When migrating VMs from platform to platform I boot Clonezilla and do a full image of the VM’s harddisk on a network share. Afterwards I recover it on the newly created VM on the other hypervisor.
Works great and has never failed me.

dd from /dev/zvol/path/to/virtual/disk will work. The resulting image will obviously be in RAW format.

I frequently use dd the other way round, e.g. creating a virtual machine from a HAOS image for Home Assistant.

1 Like