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)
Sun, May 5, 10:06 AM
Unknown Object (File)
Sat, Apr 27, 4:42 PM
Unknown Object (File)
Sat, Apr 27, 4:42 PM
Unknown Object (File)
Sat, Apr 27, 4:42 PM
Unknown Object (File)
Sat, Apr 27, 4:28 PM
Unknown Object (File)
Apr 8 2024, 10:00 AM
Unknown Object (File)
Jan 12 2024, 9:41 PM
Unknown Object (File)
Dec 23 2023, 12:07 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.