Facter 1.6.X not considering Qemu/KVM virtual type
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
facter (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Precise |
Won't Fix
|
Undecided
|
Unassigned | ||
Quantal |
Fix Released
|
Undecided
|
Unassigned | ||
Raring |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
facter recognises a /proc/cpuinfo CPU model of "Common KVM processor" as a physical machine. facter is most often used with puppet, and causes puppet manifests to mis-classify virtual machines of this type and apply incorrect rules where the puppet manifests supplied by system administrators differ on this criterion.
[Stable and Development Fix]
A cherry-pick of the upstream fix, modified to be made minimal (one line). See the quilt patch for details.
[Test Case 1]
Run "facter is_virtual". On a physical machine, this should say false. On a virtual machine reporting in /proc/cpuinfo as "QEMU Virtual CPU" as well as a virtual machine reporting in /proc/cpuinfo as "Common KVM Processor", "facter is_virtual" should say true.
[Test Case 2]
As a shortcut, on Quantal and Raring you can fake the /proc/cpuinfo file as follows:
mkdir -p /tmp/proc/
cd /tmp/proc
mount -t proc none lower
mount -t tmpfs -o mode=755 none upper
mount -t overlayfs -o lowerdir=
stop rsyslog
stop acpid
umount /proc && mount --bind combined /proc
Then you can edit /proc/cpuinfo and run facter to test behaviour as per Test Case 1.
This is a hack and does not appear to work correctly in Precise.
[Regression Potential]
It looks like detection of other model strings in /proc/cpuinfo may have regressed upstream, fixed by a later commit. It's important to test that both model strings of "QEMU Virtual CPU" and "Common KVM processor" detect as virtual, and that another string (eg. "Other") detects as physical.
[Original Description]
On ubuntu 12.04 LTS, the official version for the facter package is 1.6.5-ubuntu1.
ii facter 1.6.5-1ubuntu1 collect and display facts about the system
The is_virtual? method is not recognized on last version of KVM, because of the output of /proc/cpuinfo, which does not contains “Qemu Server” Infos.
model name : Common KVM processor
The workaround was added in the next versions of facter, and so I would like to provide you this patch, which fixes this bug on Ubuntu 12.04 LTS.
Best regards
description: | updated |
Changed in facter (Ubuntu): | |
status: | New → Triaged |
Changed in facter (Ubuntu Precise): | |
status: | New → Triaged |
Changed in facter (Ubuntu Quantal): | |
status: | New → Triaged |
Changed in facter (Ubuntu Raring): | |
status: | New → Triaged |
description: | updated |
The attachment "new proposed version for virtual.rb" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]