How to convert KVM to Bhyve hypervisor

After introduction of Bhyve hypervisor in SmartOS, the frequently asked question is how to easily convert the old virtual server running on KVM hypervisor to Bhyve.

In Danube Cloud there is an easy way how to do it:

Create a snapshot or backup and restore it into new virtual machine.

Note

The new virtual server can be created on the same node or on different one because Danube Cloud can restore snapshots and backups to any node in the cluster.

Example conversion using a snapshot

  1. (Optional) Adjust virtual server for bhyve.

    1. Networking - unlike KVM, Bhyve does not use DHCP for configuring guest network. Set either static IP or configure cloud-init to update the IP address after each boot (using SmartOS datasource).
    2. Console - Bhyve supports VNC console only for UEFI boot. It is always useful to setup serial console access before conversion. You can take inspiration in this ansible role. The console can be accessed using vmadm console <vm_uuid>.
  2. Create snapshot of the virtual server running on KVM. You need to create snapshot for all disks the virtual server has. Servers -> (virtual server) -> Snapshots -> Create snapshot. If you use qemu guest agent, you don’t need to stop the server to get a consistent clone.

    ../_images/vm_create_snapshot1.png
  3. Create a new virtual server in parallel to the existing one (Servers -> Add Server, click Show advanced settings -> Hypervisor Type during the server creation and select Bhyve).

    The destination disk(s) must have the same size as the source disk(s).

    Don’t select any OS image for disk as it will be deleted anyway.

    ../_images/vm_change_settings1.png
  4. Go back to source virtual server’s snapshot list and restore the snapshot(s) to the respective disk(s). Servers -> (virtual server) -> Snapshots, click Manage button near the snapshot name, then click To other server… and select the destination server and disk.

    ../_images/vm_snapshots_list.png ../_images/vm_manage_snapshot1.png ../_images/vm_snap_restore_to_other_server.png
  5. (Optional) Stop the source server to avoid IP conflict and start the new server. If you’ve set a different IP, you don’t need to stop the source server.

  6. (Optional) Delete the old KVM server.

Note

It is recommended to do a last backup of the old server before deletion (Backups tab next to Snapshots). Server backups are not deleted when you delete a server and you can find them in Nodes -> (node name) -> Backups.