Skip to content

lib/host: add method to get system uuid#499

Merged
olivierh-pro merged 1 commit into
masterfrom
ohu/update-tools/snapshot-1
Apr 29, 2026
Merged

lib/host: add method to get system uuid#499
olivierh-pro merged 1 commit into
masterfrom
ohu/update-tools/snapshot-1

Conversation

@olivierh-pro
Copy link
Copy Markdown
Contributor

@olivierh-pro olivierh-pro commented Apr 24, 2026

System uuid is the uuid of the host scoped into its physical parent host. It is used in a context of nested hosts.

If the current host is a nested host, snapshot creation must be done through its physical parent host (because the "nested host" is actually a VM).

This PR add a new method in host class to get the system uuid (using dmidecode -s system-uuid).

With this uuid, we can then perform a snapshot of the VM nested host.

This work is a preliminiary work for future code changes (#468)

Comment thread lib/host.py Outdated
Comment on lines +472 to +475
ssh_result = self.ssh_with_result("dmidecode -s system-uuid")
system_uuid = str(ssh_result.stdout)

return system_uuid.lower().rstrip('\n')
Copy link
Copy Markdown
Member

@glehmann glehmann Apr 24, 2026

Choose a reason for hiding this comment

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

Suggested change
ssh_result = self.ssh_with_result("dmidecode -s system-uuid")
system_uuid = str(ssh_result.stdout)
return system_uuid.lower().rstrip('\n')
return self.ssh("dmidecode -s system-uuid").lower().strip()

Or do you want the dmidecode to silently fail?

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!

@olivierh-pro olivierh-pro force-pushed the ohu/update-tools/snapshot-1 branch from c5a18ea to 76e5037 Compare April 27, 2026 08:24
Comment thread lib/host.py

ref: `dmidecode(8) <https://man.archlinux.org/man/dmidecode.8.en#s>__`
"""
return self.ssh("dmidecode -s system-uuid").lower().strip()
Copy link
Copy Markdown
Contributor

@rzr rzr Apr 27, 2026

Choose a reason for hiding this comment

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

Suggested change
return self.ssh("dmidecode -s system-uuid").lower().strip()
return self.ssh("dmidecode -s system-serial-number").lower().strip()

I've found a bug while testing it, using SN is aligned to XE uuid (sys uuid has first bytes flipped)

  • good (system-serial-number) : 4d8820d1-b103-839e-e3ea-04bfad19e77c
  • bad (system-uuid) : d120884d-03b1-9e83-e3ea-04bfad19e77c

cc: @ydirson

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.

@olivierh-pro I thought we tested it manually, didn't we?

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.

Forget my suggestion, I think uuid is correct semantically speaking, I think the bug is elsewhere, I am narrowing the problem since I have a reproducer

System uuid is the uuid of the host scoped into
its physical parent host. It is used in a context
of nested hosts.

Signed-off-by: Olivier Hoareau <olivier.hoareau@vates.tech>
@olivierh-pro olivierh-pro force-pushed the ohu/update-tools/snapshot-1 branch from 76e5037 to a620686 Compare April 29, 2026 08:27
@olivierh-pro olivierh-pro merged commit b9a9748 into master Apr 29, 2026
9 checks passed
@olivierh-pro olivierh-pro deleted the ohu/update-tools/snapshot-1 branch April 29, 2026 08:28
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