Skip to content

(#17612) Follow Google docs to populate virtual => gce#376

Merged
jeffmccune merged 2 commits intopuppetlabs:1.7.xfrom
jeffmccune:feature/1.7.x/17612_gce_cloud_support
Dec 12, 2012
Merged

(#17612) Follow Google docs to populate virtual => gce#376
jeffmccune merged 2 commits intopuppetlabs:1.7.xfrom
jeffmccune:feature/1.7.x/17612_gce_cloud_support

Conversation

@jeffmccune
Copy link

Without this patch applied Facter uses lspci to determine if the system
is running in the Google Compute Engine virtual environment. This is a
problem because Google recommends parsing the output of
/sys/firmware/dmi/entries/1-0/raw as per Detecting if You Are Running
in Google Compute
Engine
.
lspci may be unreliable over time.

This patch addresses the problem by adding a higher weight fact that
scans /sys/firmware/dmi/entries/1-0/raw as recommended by Google. The
fact is confined to Linux and disables itself if
/sys/firmware/dmi/entries/1-0/raw does not exist in the filesystem.

Pierre-Gilles Mialon and others added 2 commits December 12, 2012 14:42
Without this patch the virtual fact does not return a value that
specifically identifies Google Compute Engine.  This is a problem
because configuration decisions may depend on if the resources being
configured exist within GCE or not.

This patch addresses the problem by changing the behavior of the
`virtual` fact to return the value `gce` when running in Google Compute
Engine's cloud.

This patch uses the Google recommended and documented way to detect if
we are running on a Google Compute Engine:
https://developers.google.com/compute/docs/instances#dmi
Without this patch applied Facter uses lspci to determine if the system
is running in the Google Compute Engine virtual environment.  This is a
problem because Google recommends parsing the output of
/sys/firmware/dmi/entries/1-0/raw as per [Detecting if You Are Running
in Google Compute
Engine](https://developers.google.com/compute/docs/instances#dmi).
`lspci` may be unreliable over time.

This patch addresses the problem by adding a higher weight fact that
scans `/sys/firmware/dmi/entries/1-0/raw` as recommended by Google.  The
fact is confined to Linux and disables itself if
`/sys/firmware/dmi/entries/1-0/raw` does not exist in the filesystem.
@jeffmccune jeffmccune merged commit a43d6f8 into puppetlabs:1.7.x Dec 12, 2012
florindragos pushed a commit that referenced this pull request Jun 15, 2020
Co-authored-by: Andrei Filipovici <andrei.filipovici@andreis-mbp.eth.tsr.corp.puppet.net>
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.

1 participant