]> git.ipfire.org Git - thirdparty/systemd.git/commit
detect-virt: add bare-metal support for GCE
authorvlefebvre <valentin.lefebvre@suse.com>
Tue, 8 Jul 2025 15:46:10 +0000 (15:46 +0000)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jul 2025 11:07:40 +0000 (20:07 +0900)
commitfb71571d3a4efddeb44f02939304be9007301974
tree4477258e3044c6d156d60d66c1e80c126149b319
parentcc01ee7871ac6fbe0c2e31aed6ebde2944686aab
detect-virt: add bare-metal support for GCE

Google Compute Engine are not only virtual but can be also physical
machines. Therefore checking only the dmi is not enough to detect if it
is a virtual machine. Therefore systemd-detect-virt return "google"
instead of "none" in c3-highcpu-metal machine.
SMBIOS will not help us to make the difference as for EC2 machines.
However, GCE use KVM hypervisor for these VM, we can use this
information to detect virtualization. [0]

Issue and changes has been tested on SUSE SLE-15-SP7 images with
systemd-254 for both GCE, bare-metal and VM.

[0] -
https://cloud.google.com/blog/products/gcp/7-ways-we-harden-our-kvm-hypervisor-at-google-cloud-security-in-plaintext
src/basic/virt.c