From owner-freebsd-current@freebsd.org Fri May 7 13:37:57 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19A6462DCC2 for ; Fri, 7 May 2021 13:37:57 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FcBN50G6Rz4cS7 for ; Fri, 7 May 2021 13:37:57 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id E9EFB58AC for ; Fri, 7 May 2021 13:37:56 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.1.227] (host86-137-90-14.range86-137.btcentralplus.com [86.137.90.14]) by smtp.theravensnest.org (Postfix) with ESMTPSA id 74A3B7C06 for ; Fri, 7 May 2021 14:37:56 +0100 (BST) Subject: Re: Building ZFS-based VM images To: freebsd-current@freebsd.org References: From: David Chisnall Message-ID: <44ec6a39-82bc-82a9-4e16-431feeafcd38@FreeBSD.org> Date: Fri, 7 May 2021 14:37:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2021 13:37:57 -0000 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