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

resolvers/freebsd/virtual.rb: Adding kenv check for bhyve #2482

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spchamp
Copy link

@spchamp spchamp commented Apr 21, 2022

This changeset adds a test for bhyve virtualization.

Presently, bhyve VMs would be reported as 'generic' under the 'virtual' key in facter*. This would match the value of the FreeBSD sysctl field kern.vm_guest under bhyve.

This changeset detects the generic case, then providing a string-downcase translation of the smbios.bios.vendor field under FreeBSD kenv. This might typically be the string, 'bhyve'.

This more specialized representation for a bhyve vm might be easier to interpret for its relevance, in Puppet manifest code, contrated to the string, 'generic'.

Candidly, this may have an impact on any existing code that would assume that the value 'generic' will be produced for that key. If this patch was adopted, perhaps the updated behavior could be annotated in the release notes or in documentation?

(cherry picked from commit 98ca8d7)

* when running in a FreeBSD environment, in the VM

@spchamp spchamp requested a review from a team as a code owner April 21, 2022 10:51
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@spchamp
Copy link
Author

spchamp commented Apr 22, 2022

This patch might be limited in its effects to a FreeBSD VM under bhyve.

It seems that in a Linux VM under bhyve, facter may already report virtual => bhyve. This might be commensurate with the definition of Facter::Util::Facts::HYPERVISORS_HASH.

In effect, the changeset proposed here might serve to bring the behavior for facter installed in a FreeBSD VM installation into alignment with the existing behavior for facter in a Linux VM installation, with either under bhyve.

@CLAassistant
Copy link

CLAassistant commented Apr 19, 2023

CLA assistant check
All committers have signed the CLA.

@joshcooper joshcooper added the enhancement New feature or enhancement label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants