Jira (FACT-3072) is_virtual in a LXC KVM vm is incorrect

15 views
Skip to first unread message

Dolf Schimmel (Jira)

unread,
Sep 8, 2021, 9:26:03 AM9/8/21
to puppe...@googlegroups.com
Dolf Schimmel created an issue
 
Facter / Bug FACT-3072
is_virtual in a LXC KVM vm is incorrect
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/09/08 6:25 AM
Environment:

# uname -a
Linux puppet1 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
 
# facter --version
4.2.3

# dmidecode
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.
11 structures occupying 462 bytes.
Table at 0x7F919000.
 
Handle 0x0100, DMI type 1, 27 bytes
System Information
	Manufacturer: QEMU
	Product Name: Standard PC (Q35 + ICH9, 2009)
	Version: pc-q35-6.1
	Serial Number: Not Specified
	UUID: cf3595ed-6d96-4f01-b8a7-d0f99f7fdef6
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Not Specified
 
Handle 0x0200, DMI type 2, 15 bytes
Base Board Information
	Manufacturer: Canonical Ltd.
	Product Name: LXD
	Version: pc-q35-6.1
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Features:
		Board is a hosting board
	Location In Chassis: Not Specified
	Chassis Handle: 0x0300
	Type: Motherboard
	Contained Object Handles: 0
 
Handle 0x0300, DMI type 3, 22 bytes
Chassis Information
	Manufacturer: QEMU
	Type: Other
	Lock: Not Present
	Version: pc-q35-6.1
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Safe
	Security Status: Unknown
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: Unspecified
	Contained Elements: 0
	SKU Number: Not Specified
 
Handle 0x0400, DMI type 4, 42 bytes
Processor Information
	Socket Designation: CPU 0
	Type: Central Processor
	Family: Other
	Manufacturer: QEMU
	ID: 10 0F 83 00 FF FB 8B 07
	Version: pc-q35-6.1
	Voltage: Unknown
	External Clock: Unknown
	Max Speed: 2000 MHz
	Current Speed: 2000 MHz
	Status: Populated, Enabled
	Upgrade: Other
	L1 Cache Handle: Not Provided
	L2 Cache Handle: Not Provided
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 1
	Core Enabled: 1
	Thread Count: 1
	Characteristics: None
 
Handle 0x1000, DMI type 16, 23 bytes
Physical Memory Array
	Location: Other
	Use: System Memory
	Error Correction Type: Multi-bit ECC
	Maximum Capacity: 3814 MB
	Error Information Handle: Not Provided
	Number Of Devices: 1
 
Handle 0x1100, DMI type 17, 40 bytes
Memory Device
	Array Handle: 0x1000
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: 3814 MB
	Form Factor: DIMM
	Set: None
	Locator: DIMM 0
	Bank Locator: Not Specified
	Type: RAM
	Type Detail: Other
	Speed: Unknown
	Manufacturer: QEMU
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Rank: Unknown
	Configured Memory Speed: Unknown
	Minimum Voltage: Unknown
	Maximum Voltage: Unknown
	Configured Voltage: Unknown
 
Handle 0x1300, DMI type 19, 31 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 2 GB
	Physical Array Handle: 0x1000
	Partition Width: 1
 
Handle 0x1301, DMI type 19, 31 bytes
Memory Array Mapped Address
	Starting Address: 0x00100000000
	Ending Address: 0x0016E5FFFFF
	Range Size: 1766 MB
	Physical Array Handle: 0x1000
	Partition Width: 1
 
Handle 0x2000, DMI type 32, 11 bytes
System Boot Information
	Status: No errors detected
 
Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
	Vendor: EFI Development Kit II / OVMF
	Version: 0.0.0
	Release Date: 02/06/2015
	Address: 0xE8000
	Runtime Size: 96 kB
	ROM Size: 64 kB
	Characteristics:
		BIOS characteristics not supported
		Targeted content distribution is supported
		UEFI is supported
		System is a virtual machine
	BIOS Revision: 0.0
 
Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table

Priority: Normal Normal
Reporter: Dolf Schimmel

Using LXC I create a KVM VM. Inside of the VM I install facter 4.2.3:

# facter --puppet | grep -i virtual
is_virtual => false
virtual => physical

I would expect 'is_virtual' to be true, and 'virtual' not to be 'physical' (but I don't know what value it should have).

At the same time, there are a few pointers that could potentially be used for determining that it is in fact a VM:

# facter --puppet dmi.manufacturer
QEMU
# facter --puppet dmi.board.product
LXD

I'm happy to contribute this (or at least give it a shot). But would like to get some feedback first.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Dolf Schimmel (Jira)

unread,
Sep 13, 2021, 8:13:03 AM9/13/21
to puppe...@googlegroups.com
Dolf Schimmel commented on Bug FACT-3072
 
Re: is_virtual in a LXC KVM vm is incorrect

Discussed on IRC what approach the LXC devs would prefer:

[18:54:43] <+stgraber> Freeaqingme: looking at what systemd-detect-virt does (as it correctly detects LXD VMs), looks like /sys/class/dmi/id/sys_vendor is probably the way to go
[18:54:46] <+sdeziel> Freeaqingme: systemd-detect-virt reads /sys/class/dmi/id/sys_vendor

Ciprian Badescu (Jira)

unread,
Sep 13, 2021, 10:10:03 AM9/13/21
to puppe...@googlegroups.com

Dolf Schimmel, can you do the same test with facter 3(available witn puppet 6)?

Josh Cooper (Jira)

unread,
Apr 21, 2022, 12:40:03 AM4/21/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Environment: {code:java}
# uname -a
Linux puppet1 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

# facter --version
4.2.3{code}

{code}
{code}
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 21, 2022, 12:41:02 AM4/21/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Using LXC I create a KVM VM. Inside of the VM I install facter 4.2.3:

{code}

# facter --puppet | grep -i virtual
is_virtual => false
virtual => physical
{code}


I would expect 'is_virtual' to be true, and 'virtual' not to be 'physical' (but I don't know what value it should have).

At the same time, there are a few pointers that could potentially be used for determining that it is in fact a VM:
{code}

# facter --puppet dmi.manufacturer
QEMU
# facter --puppet dmi.board.product
LXD
{code}


I'm happy to contribute this (or at least give it a shot). But would like to get some feedback first.

Josh Cooper (Jira)

unread,
Apr 21, 2022, 1:47:01 PM4/21/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-3072
 
Re: is_virtual in a LXC KVM vm is incorrect

Freeaqingme not sure this is the cause, but puppet-agent 7/facter 4 are missing virt-what or dmidecode (see PA-4423), which may explain the difference? Also could you try puppet-agent 6/facter 3  to see if you get the same/different behavior?

Dolf Schimmel (Jira)

unread,
Aug 2, 2022, 8:07:03 AM8/2/22
to puppe...@googlegroups.com

I'm sorry I missed the earlier comments. I've stopped using LXC & LXD due to the whole Snapd saga. 

 

If someone else runs into this issue, please feel free to reopen as you see fit.

This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages