[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Pkg-zfsonlinux-devel] Bug#595790: hostid: useless unless fixed



* Petter Reinholdtsen:

> Something like this should work, I guess:
> 
> if [ ! -f /etc/hostid ]; then
>    if [ -e /sys/class/dmi/id/product_uuid ]; then
>        sethostidfromuuid $(cat /sys/class/dmi/id/product_uuid)
>    else
>    	dd if=/dev/urandom bs=1 count=4 of=/etc/hostid 2>/dev/null
>    fi
> fi

That's not very different from /etc/machine-id, isn't it?

> We need to figure out how to transform the UUID to a 32 bit integer,
> of course.

And I think this is the crux of the problem.  Whatever we do, with
today's cluster sizes it's just not reliably unique.

You could use /etc/machine-id instead.  Some effort goes into that to
make it actually unique.

DMI data seems risky because it depends on firmware, and there are so
many firmware bugs out there.  It would also not address the matter of
changing host IDs as the result of host migrations.


Reply to: