Page MenuHomeFreeBSD

rc: Add a zpoolreguid rc.d script
ClosedPublic

Authored by markj on May 27 2022, 4:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 18, 6:02 AM
Unknown Object (File)
Oct 20 2024, 10:57 PM
Unknown Object (File)
Oct 10 2024, 11:15 AM
Unknown Object (File)
Oct 10 2024, 11:15 AM
Unknown Object (File)
Sep 30 2024, 9:38 PM
Unknown Object (File)
Sep 27 2024, 3:23 PM
Unknown Object (File)
Sep 27 2024, 8:24 AM
Unknown Object (File)
Sep 24 2024, 7:44 PM

Details

Summary

If one boots up multiple copies of a template VM image containing a
zpool, the pool GUIDs will be identical, making it impossible to, e.g.,
share datasets between them.

This diff introduces a simple workaround for the problem: one can use
the script to, upon first boot, assign a new GUID to one or more zpools.

I have some WIP to create ZFS-based VM images from release(7). This
script would be enabled in such images to ensure that each VM instance
gets its own pool GUID.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.May 27 2022, 4:36 PM

This is going to be very useful. Will you create a matching change that will run zpool online -e on firstboot, or just assume that the VM images will be built with autoexpand=true?

This revision is now accepted and ready to land.May 27 2022, 4:56 PM

Will you create a matching change that will run zpool online -e on firstboot, or just assume that the VM images will be built with autoexpand=true?

rc.d/growfs already does that. :)

One other thing that might be useful is a script to enable some or all feature flags on a pool. The WIP makefs -t zfs implementation leaves all feature flags off.

One other thing that might be useful is a script to enable some or all feature flags on a pool. The WIP makefs -t zfs implementation leaves all feature flags off.

I don't think that needs to happen on firstboot. You know at build time what kernel will be running in the VM, so you can enable pool features there. Unless you want to conditionally enable certain features depending on how big the disk is, or what hypervisor is involved. But I don't think that's likely.

Manual page English LGTM. Can't attest to correctness.

allanjude added a subscriber: allanjude.

Reviewed By: allanjude

This revision was automatically updated to reflect the committed changes.