Proposal: Add a stable UUID/ULID “global ID” to core NetBox objects (without changing integer PKs) #21170
patrickpreuss
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I’ve seen a few related requests over time around “globally unique identifiers” and clustering/federation concerns—most directly the question about changing primary keys away from integers (#20067).
Rather than replacing integer primary keys (which would be a very large and disruptive migration), I’d like to propose a smaller step:
Proposal
Add a stable UUID/ULID field (e.g., uuid or global_id) to most/all core models in addition to the existing integer id primary key.
Why this helps
Instance-independent identifiers: External systems could reference objects without depending on an installation-local integer PK (which will collide across independent NetBox instances).
Future sync/replication/federation: A dedicated global identifier makes it easier to map objects between “share-nothing” NetBox installations, even if true multi-region clustering is out of scope today.
Precedent / recurring need: There have been requests for UUID-like identifiers to help correlate objects across systems (e.g., VMs).
Also, NetBox already uses a stored UUID field in at least one place (JobResult’s job_id).
Deterministic UUIDs (optional, for select object types)
For some objects (example: Device Type / “device model”), it might be useful to derive a deterministic UUID from stable attributes like manufacturer + sku, enabling “upsert by global ID” in imports and potentially reducing lookup work.
If deterministic IDs are considered, I’d suggest using UUIDv5 (name-based) rather than a raw MD5 hash, since it’s the standard mechanism for “UUID from name”:
(Deterministic IDs only make sense if the input fields are truly immutable; otherwise the ID changes when a name/SKU changes.)
Questions for maintainers/community
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions