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

Fact "ansible_virtualization_type" incorrect on Microsoft laptops #80197

Open
1 task done
sbivol opened this issue Mar 12, 2023 · 1 comment
Open
1 task done

Fact "ansible_virtualization_type" incorrect on Microsoft laptops #80197

sbivol opened this issue Mar 12, 2023 · 1 comment
Assignees
Labels
affects_2.14 bug This issue/PR relates to a bug. P3 Priority 3 - Approved, No Time Limitation

Comments

@sbivol
Copy link

sbivol commented Mar 12, 2023

Summary

Ansible uses /sys/devices/virtual/dmi/id/sys_vendor to determine if the system is virtualized, but the test incorrectly assumes that "Microsoft Corporation" always means VirtualPC.

The facts ansible_virtualization_tech_guest and ansible_virtualization_type are also incorrect on this laptop.

Issue Type

Bug Report

Component Name

lib/ansible/module_utils/facts/virtual/linux.py

Ansible Version

$ ansible --version
ansible [core 2.14.3]

Configuration

N/A

OS / Environment

Ubuntu 22.04

$ cat /sys/devices/virtual/dmi/id/sys_vendor
Microsoft Corporation

$ cat /sys/devices/virtual/dmi/id/product_family
Surface

$ sudo dmidecode | grep -B1 "Microsoft\|Surface"
BIOS Information
        Vendor: Microsoft Corporation
--
System Information
        Manufacturer: Microsoft Corporation
        Product Name: Surface Laptop Go
--
        Wake-up Type: Unknown
        SKU Number: Surface_Laptop_Go_1943
        Family: Surface
--
Chassis Information
        Manufacturer: Microsoft Corporation
--
Base Board Information
        Manufacturer: Microsoft Corporation
        Product Name: Surface Laptop Go

Steps to Reproduce

$ ansible -i localhost, all -m setup | grep -A1 ansible_virtualization

Expected Results

Ansible should report a physical machine, not virtual.

Actual Results

"ansible_virtualization_role": "guest",
"ansible_virtualization_tech_guest": [
    "VirtualPC"
],
"ansible_virtualization_tech_host": [
    "kvm"
],
"ansible_virtualization_type": "VirtualPC",

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot
Copy link
Contributor

ansibot commented Mar 12, 2023

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.14 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. labels Mar 12, 2023
@bcoca bcoca added P3 Priority 3 - Approved, No Time Limitation and removed needs_triage Needs a first human triage before being processed. labels Mar 21, 2023
@nitzmahone nitzmahone self-assigned this Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.14 bug This issue/PR relates to a bug. P3 Priority 3 - Approved, No Time Limitation
Projects
None yet
Development

No branches or pull requests

4 participants