Building ZFS-based VM images

David Chisnall theraven at FreeBSD.org
Fri May 7 13:37:57 UTC 2021


On 06/05/2021 16:17, Alan Somers wrote:
> It's easy to build a UFS-based VM image just by setting WITH_VMIMAGES in
> release.conf and running release.sh.  But what about ZFS-based images?
> What's the easiest way to build a ZFS-based VM image, using a pool layout
> similar to what the interactive installer uses?

The only way that I've deployed FreeBSD VMs in Azure has been to run the 
installer in Hyper-V locally and then upload it as a template.

You need to be *really* careful with this mode though, because ZFS gets 
really confused if two pools or two VDEVs have the same UUIDs.  This 
means that you can't just attach one VM's disk to another for recovery 
(I also have a UFS image that I use for recovery).  It would be great if 
it were possible to set a flag somewhere telling the storage subsystem 
to regenerate the UUIDs of everything (including GPT partitions) on 
first boot.

David



More information about the freebsd-current mailing list