Skip to content

tools/update: fix use of dmidecode in context of nested hosts - #576

Merged
olivierh-pro merged 2 commits into
masterfrom
ohu/01/fix-dmidecode-system-uuid
Jun 10, 2026
Merged

tools/update: fix use of dmidecode in context of nested hosts#576
olivierh-pro merged 2 commits into
masterfrom
ohu/01/fix-dmidecode-system-uuid

Conversation

@olivierh-pro

@olivierh-pro olivierh-pro commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR fixes an unexpected behaviour for command dmidecode -s system-uuid in nested hosts (Some bits are shifted): See comment here.

Reminder: "system uuid" is used to target a nested host in its hosting pool. This work follows up previous work in snapshot creation (#468).

@olivierh-pro
olivierh-pro force-pushed the ohu/00/new-attribute-nested-host branch from 094b59b to 962bb58 Compare June 8, 2026 14:35
@olivierh-pro
olivierh-pro force-pushed the ohu/01/fix-dmidecode-system-uuid branch from 8cb76c6 to f6eec8c Compare June 8, 2026 14:42
@olivierh-pro
olivierh-pro force-pushed the ohu/00/new-attribute-nested-host branch 2 times, most recently from 36ab45b to 9e361dc Compare June 10, 2026 08:24
Base automatically changed from ohu/00/new-attribute-nested-host to master June 10, 2026 08:26
@olivierh-pro
olivierh-pro force-pushed the ohu/01/fix-dmidecode-system-uuid branch from f6eec8c to cce5411 Compare June 10, 2026 08:50
@olivierh-pro
olivierh-pro marked this pull request as ready for review June 10, 2026 08:51
@olivierh-pro
olivierh-pro requested a review from a team as a code owner June 10, 2026 08:51
@olivierh-pro
olivierh-pro requested a review from a team June 10, 2026 09:22
Comment thread lib/host.py Outdated
dmi_key = "system-serial-number" if self.is_nested else "system-uuid"
system_uuid = self.ssh(f"dmidecode -s {dmi_key}").lower().strip()
if not system_uuid:
raise ValueError(f"The system uuid '{system_uuid}' incorrect.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
raise ValueError(f"The system uuid '{system_uuid}' incorrect.")
raise ValueError(f"The system uuid '{system_uuid}' is incorrect.")

Comment thread lib/host.py
"""Get system uuid of current host.

Intended for driving current host from its "parent host" in a **nested context**.
In case host is nested, it uses `system-serial-number` instead of `system-uuid`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
In case host is nested, it uses `system-serial-number` instead of `system-uuid`.
In case host is nested, it uses `system-serial-number` instead of `system-uuid`.
(TODO: This workaround is tracked in XCPNG-2775 )

(ideally prefer an upstream bug id if any exists)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@rzr rzr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let me try to test it, before merge.

@olivierh-pro
olivierh-pro force-pushed the ohu/01/fix-dmidecode-system-uuid branch from cce5411 to 4ca5916 Compare June 10, 2026 12:10

@rzr rzr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tested, the snapshot is working and noticed that yum errors are ignored, I would raise an expection on failed ssh commands (it can be done in later PR), let's merge

Signed-off-by: Olivier Hoareau <olivier.hoareau@vates.tech>
Sometimes, the command dmidecode with the dmi key
`system-uuid` works with unexpected results (bits
are shifted). For nested hosts, we need to use
dmi key `system-serial-number`. Take a look at
#567 (comment)

Signed-off-by: Olivier Hoareau <olivier.hoareau@vates.tech>
@olivierh-pro
olivierh-pro force-pushed the ohu/01/fix-dmidecode-system-uuid branch from 4ca5916 to 6baaf55 Compare June 10, 2026 15:22
@olivierh-pro
olivierh-pro merged commit 1143e0b into master Jun 10, 2026
11 checks passed
@olivierh-pro
olivierh-pro deleted the ohu/01/fix-dmidecode-system-uuid branch June 10, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants