Skip to content

Add host ID to host fingerprint attributes - #28406

Merged
tgross merged 3 commits into
mainfrom
f-hostid-fingerprint
Aug 13, 2026
Merged

tgross merged 3 commits into
mainfrom
f-hostid-fingerprint

Conversation

@hashi-divyansh

@hashi-divyansh hashi-divyansh commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Description

  • Adding host ID to generic host fingerprint attributes.

Testing & Reproduction steps

Links

https://hashicorp.atlassian.net/browse/NMD-1667

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad product documentation, which is stored in the
    web-unified-docs repo. Refer to the web-unified-docs contributor guide for docs guidelines.
    Please also consider whether the change requires notes within the upgrade
    guide
    . If you would like help with the docs, tag the nomad-docs team in this PR.
  • LLM Usage If an LLM was used to generate any code, please ensure and confirm you have read
    and followed the AI usage guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.
  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

@hashi-divyansh hashi-divyansh self-assigned this Aug 12, 2026
@hashi-divyansh hashi-divyansh changed the title Add hostId attribute to default fingerprinter Add host ID to host fingerprint attributes Aug 12, 2026
@hashi-divyansh
hashi-divyansh requested a review from tgross August 12, 2026 18:03
@hashi-divyansh
hashi-divyansh marked this pull request as ready for review August 12, 2026 18:03
@hashi-divyansh
hashi-divyansh requested review from a team as code owners August 12, 2026 18:03

@tgross tgross left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a changelog entry for this so users know they can pick it up in their own jobspecs if they want. I dunno how you want to describe this to users because it varies depending on the host OS (and even host OS setup). Maybe just describe it as a "unique host ID"?

Comment thread client/fingerprint/host.go Outdated
resp.AddAttribute("kernel.name", runtime.GOOS)
resp.AddAttribute("kernel.arch", hostInfo.KernelArch)

resp.AddAttribute("unique.hostId", hostInfo.HostID)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not super consistent about it but most of the built-in fingerprints use snake_case instead of camelCase

Comment thread CHANGELOG.md Outdated

IMPROVEMENTS:

* client: Added the `unique.host_id` node attribute to the host fingerprint. When available, It can be used in job constraints and other node attribute-based workflows.

@hashi-divyansh hashi-divyansh Aug 13, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using term When available becz gopsutil lib does its best to find out the uniq_id depending on the platform (linux, window etc) but in case if it can't find one, It will return an empty string.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the PR checklist, but heads up that in core you add changelog entries but running make cl, which generates a little .changelog/<PR ID>.txt file that gets assembled during the release process. That makes it feasible to land lots of changes for a big project concurrently without constantly hitting merge conflicts.

Suggested change
* client: Added the `unique.host_id` node attribute to the host fingerprint. When available, It can be used in job constraints and other node attribute-based workflows.
* client: Added the `unique.host_id` node attribute to the host fingerprint, when available

@hashi-divyansh
hashi-divyansh requested a review from tgross August 13, 2026 10:36
Comment thread CHANGELOG.md Outdated

IMPROVEMENTS:

* client: Added the `unique.host_id` node attribute to the host fingerprint. When available, It can be used in job constraints and other node attribute-based workflows.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the PR checklist, but heads up that in core you add changelog entries but running make cl, which generates a little .changelog/<PR ID>.txt file that gets assembled during the release process. That makes it feasible to land lots of changes for a big project concurrently without constantly hitting merge conflicts.

Suggested change
* client: Added the `unique.host_id` node attribute to the host fingerprint. When available, It can be used in job constraints and other node attribute-based workflows.
* client: Added the `unique.host_id` node attribute to the host fingerprint, when available

Comment thread client/fingerprint/host.go

@tgross tgross left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tgross tgross added backport/2.0.x backport to 2.0.x release line theme/fingerprint labels Aug 13, 2026
@tgross tgross added this to the 2.0.x milestone Aug 13, 2026
@tgross
tgross merged commit b4db8b1 into main Aug 13, 2026
59 of 60 checks passed
@tgross
tgross deleted the f-hostid-fingerprint branch August 13, 2026 18:52
@tgross

tgross commented Aug 13, 2026

Copy link
Copy Markdown
Member

Added a Jira link there for you. Looks like the backport cherry-pick failed, but I'll take care of that for you because it's almost certainly a flake in the tooling

tgross pushed a commit that referenced this pull request Aug 13, 2026

This branch was successfully deployed

1 active deployment
Preview — 27be3fd2 Deployed Aug 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/2.0.x backport to 2.0.x release line theme/fingerprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants