Skip to content
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

systemd: generate stable machine IDs for VMWare guests #1537

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

arnaldo2792
Copy link
Contributor

@arnaldo2792 arnaldo2792 commented Apr 29, 2021

Issue number:
#1536

Description of changes:

5c751ff2 systemd: generate stable machine IDs for VMWare guests

Systemd already has functionality to generate stable machine ids based on the virtualization type. This patch extends the functionality to check for the VMWare value as well.

Testing done:

In AWS dev, ecs, vmware-dev:

  • systemctl status didn't show any failures
  • journalctl -p3 didn't show any unexpected errors
  • Verified that XEN, KVM (x86_64 and aarch64) and VMWare hosts have a stable machine id after reboots and shutdowns:

AWS ECS c4.large (XEN)

bash-5.0# journalctl --list-boots
-2 2ed3bba8aac349919ac3985e72905281 Wed 2021-04-28 22:58:10 UTC—Wed 2021-04-28 23:02:03 UTC
-1 5bd4344b80e04ac5b0693b46e9b10047 Wed 2021-04-28 23:02:23 UTC—Wed 2021-04-28 23:05:42 UTC
 0 8bc4237e9e1e4592a7c8a20655df70ff Wed 2021-04-28 23:53:36 UTC—Wed 2021-04-28 23:54:36 UTC

AWS ECS m5.xlarge (KVM)

bash-5.0# journalctl --list-boots
-2 98f91b7d5bdd46d78e218969bf5a63c2 Wed 2021-04-28 22:52:33 UTC—Wed 2021-04-28 22:55:50 UTC
-1 7c4015c7155d4349ad894d9fc72885ec Wed 2021-04-28 22:55:56 UTC—Wed 2021-04-28 22:57:21 UTC
 0 0eaf0223bc4d43bf881d828f2b1f7eec Wed 2021-04-28 23:01:34 UTC—Wed 2021-04-28 23:02:45 UTC

AWS ECS t4g.medium (KVM aarch64)

bash-5.0# journalctl --list-boots
-2 64df9034e0184d74944f1a48e33ac31a Wed 2021-04-28 22:53:08 UTC—Wed 2021-04-28 22:56:09 UTC
-1 350ce32cf0f04fecac8d810c62842cdd Wed 2021-04-28 22:56:13 UTC—Wed 2021-04-28 22:57:21 UTC
 0 6ffa095e34a547a183e5458e9072f042 Wed 2021-04-28 23:01:33 UTC—Wed 2021-04-28 23:04:04 UTC

VMWare
Screenshot from 2021-04-28 17-28-13

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Comment on lines 54 to 55
+ /* If we're running under VMWare, check for a machine ID
+ * passed in via --uuid */
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this comment is accurate for VMWare.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also - the company styles it as VMware, let's follow suit. :)

@arnaldo2792
Copy link
Contributor Author

  • Use one single patch to generate stable machine IDs for XEN and VMware
  • Fix comment regarding how the uuid is selected

Systemd already has functionality to generate stable machine ids based
on the virtualization type. This patch extends the functionality to
check for the VMware value as well.
@arnaldo2792
Copy link
Contributor Author

  • Fixed comment and commit message to use VMware instead of VMWare

Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

☯️

@arnaldo2792 arnaldo2792 merged commit 2481096 into bottlerocket-os:develop Apr 29, 2021
@arnaldo2792 arnaldo2792 deleted the vmware-machine-id branch May 5, 2021 01:38
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.

Journal is recreated with a different machine ID after reboot on VMWare
4 participants