Date: Fri, 7 May 2021 12:47:51 -0400 From: Allan Jude <allanjude@freebsd.org> To: freebsd-current@freebsd.org Subject: Re: Building ZFS-based VM images Message-ID: <5f5f9d31-29b7-1520-55fa-216e24e6132a@freebsd.org> In-Reply-To: <CAOtMX2jttMg=XGewsdA=yyRxu9px-PcXzBBJNaqA62F5D8zK6A@mail.gmail.com> References: <CAOtMX2jttMg=XGewsdA=yyRxu9px-PcXzBBJNaqA62F5D8zK6A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 5/6/2021 11:17 AM, 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? > -Alan > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > With the new scripting support, it is fairly easy with poudriere-image It also has the advantage of being able to build the images from poudriere jails you already have (or can build from FTP without compiling). The pre/post build script stuff is merged already, although my example scripts are in a different pull request that I need to rebase around some restructuring first. Anyway, you can use poudriere-image with the pre/post scripts included here: https://github.com/freebsd/poudriere/pull/731/files#diff-6607907a033a4e5e5e21da56960ed7ccbfb6dd4a85d66615553d2221d75c0998 and it will make a VM image with the same layout as if you had used the installer (or you can customize it as you see fit) I'm currently using this to build images for AWS and bhyve, but also to generate installer ISOs that run a script to format the drives and create the zpool, then 'fetch -o - url | zfs recv -F zroot' to install a replication stream of an entire pool. For upgrades, we do the same but only replace the boot environment. -- Allan Jude
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5f5f9d31-29b7-1520-55fa-216e24e6132a>