-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LXD server UUID file #12544
Add LXD server UUID file #12544
Conversation
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
@roosterfish I don't have much context on this but was wondering why another UUID would be needed? We already have one:
I'm pretty sure the |
@simondeziel this came up as part of #12304 as each cluster member (not per instance) requires a persistent unique UUID for NVME. The latter two examples were discussed as we consulted with https://0pointer.de/blog/projects/ids.html during the discussion. DMI ID was not suitable because if hardware changes (such as motherboard) it would change. The nearest suitable one was /var/lib/dbus/machine-id (which /etc/machine-id is derived from), but we observed this wasn't present on all systems (such as Alpine which didn't have dbus installed by default). We decided to just generated a UUID and store it persistently as the most reliable way to get a per-host ID without any external dependencies. |
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
37959ec
to
dac8908
Compare
Yep, that was the root of my confusion, I was thinking of a per-instance UUID, sorry for the noise. |
This takes the required bits from the Dell PowerFlex PR in order to introduce a new UUID file which is unique for every LXD server.
The UUID can be retrieved via the daemons
State
struct using theServerUUID
field. This is comparable with the contents of/etc/machine-id
or/var/lib/dbus/machine-id
which can be decoded from hexadecimal to its 128 bit UUID representation. However using those files has dependencies ondbus
andsystemd
. See https://wiki.debian.org/MachineId.Having a unique UUID file per daemon also ensures that multiple instances of LXD on the same machine don't use the same UUID.