From nobody Tue Sep 28 15:58:56 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A195517DF669 for ; Tue, 28 Sep 2021 15:59:14 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJkhf44jQz3n8n; Tue, 28 Sep 2021 15:59:14 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f175.google.com with SMTP id a3so30517520oid.6; Tue, 28 Sep 2021 08:59:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NRT2BSr1FViiQJ0NCCoaJO1CdkQkYYlkr2HiipwDxAM=; b=UUIRo3fNl9lOUQVNiJopKfKde0zktPejhqdhJmOXRX9UuL3jNaaMb5UMuso6FXxQWP zl2IRY3ic4IYiA9jOe+I1ADr17FN8250vIIOvzz8AxrRniH0ijCbeSiRnw9myTesZ+Y6 i6/dQxJbyp0/oA7YF+PHWilpQKT5chmF/QjrynPbvy7N1bVbKd1mLWWnsr8xJXthWYHL c67X/4IgrUNzMol7FrEYRSIxaUvDBvPotlV2yaSg7z6rl5Nofqj35AQKj1XPM+6zqerp Bth4jzqfP/tPsJeL1ZLPlcS2y2Qn/+13Cq9V0V1szNYjSDwFy5aYvru/TkzFD+L2rfDQ VbSA== X-Gm-Message-State: AOAM531B0DxHMKpMYcRbVF28ad5Hz1lG/uc0XYQFHEhlGumZQpNospKE tOrFDC03NIp+w7FvQxXUYDQgw1Eh/yOv03XDdFAD1cpa X-Google-Smtp-Source: ABdhPJy1rOoTH1YMTUgAVAJa+N9KHU5JUZNoFMEmH7NA76L3OkkYLSJWu5i04vfyH5XRu1RQwh9EClP1MJzQJO0uVFM= X-Received: by 2002:aca:1b09:: with SMTP id b9mr4226041oib.55.1632844748037; Tue, 28 Sep 2021 08:59:08 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: <202109281548.18SFmZjp075722@gndrsh.dnsmgr.net> In-Reply-To: <202109281548.18SFmZjp075722@gndrsh.dnsmgr.net> From: Alan Somers Date: Tue, 28 Sep 2021 09:58:56 -0600 Message-ID: Subject: Re: Building ZFS disk images To: "Rodney W. Grimes" Cc: Alan Somers , Mark Johnston , David Chisnall , freebsd-current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HJkhf44jQz3n8n X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Sep 28, 2021 at 9:48 AM Rodney W. Grimes wrote: > > > On Mon, Sep 27, 2021 at 1:54 PM Mark Johnston wrote: > > > > > > On Thu, Aug 05, 2021 at 10:54:19AM -0500, Alan Somers wrote: > > > > There's this: > > > > https://openzfs.github.io/openzfs-docs/man/8/zpool-reguid.8.html . I > > > > haven't used it myself. > > > > > > Would it be useful to have an rc.d script that can run this, probably > > > just on the root pool? It could be configured to run only upon the > > > first boot, like growfs already does. > > > > Absolutely! > > Ewwwwwwwwww! :-) > > > > > > > > On Thu, Aug 5, 2021, 9:29 AM David Chisnall wrote: > > > > > > > > > On 05/08/2021 13:53, Alan Somers wrote: > > > > > > I don't know of any way to do it using the official release scripts > > > > > > either. One problem is that every ZFS pool and file system is supposed > > > > > > to have a unique GUID. So any kind of ZFS release builder would need to > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > > > > re-guid the pool on first boot. > > Isnt the proper place to solve this lack of Unique UUID creation > in the tool(s) that are creating the zfs pool in the first place. > > Fixing it "post boot" seems to be a far to late hack and doesnt > fix any of the situations where one might import these pools > between creation and first boot. No, because you might create a VM image once, then instantiate it dozens or thousands of times. The firstboot solution is great because it lets you reuse the same image file. > > > > > > > > > > > Is there a tool / command to do this? I've hit this problem in the > > > > > past: I have multiple FreeBSD VMs that are all created from the same > > > > > template and if one dies I can't import its zpool into another because > > > > > they have the same UUID. > > > > > > > > > > It doesn't matter for modern deployments where the VM is stateless and > > > > > reimaged periodically but it's annoying for classic deployments where I > > > > > have things I care about on the VM. > > > > > > > > > > David > > > > > > -- > Rod Grimes rgrimes@freebsd.org