On 09/29/2016 05:19 AM, Michael Stone wrote: > On Wed, Sep 28, 2016 at 09:03:38PM -0700, Richard Laager wrote: >> Getting back to ZFS and /etc/hostid... I would think that a >> randomly-generated /etc/hostid is probably sufficient. Whether that's >> done in the libc, spl, or zfs package makes no difference to me. > > You still haven't explained why zfs doesn't just generate a uuid itself. > > There's a large body of work ensuring reasonable uniqueness for uuids, > and there isn't a clear benefit to clinging to getuid.
It can't be a full UUID. The on-disk format of ZFS uses a 32-bit integer. It doesn't really matter what we use to derive it, but a 32-bit integer is the constraint. For example, if you want to use the low 32-bits of /etc/machine-id, that would work too. It'd mean carrying a patch on Debian, but if the pain of a patch and different behavior is less than the benefits of the change, go for it. > Even on solaris > there's a big honkin' warning on the man page that it isn't guaranteed > to be unique (IIRC, getuid on containers reflects the hardware the > container is running on). On Solaris the zone (container) wouldn't import the pool. Pools are imported in the "global zone". So this isn't a problem. -- Richard