Facter 1.6.X not considering Qemu/KVM virtual type

Bug #1170325 reported by bigbigbadass on 2013-04-18
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
facter (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned
Quantal
Undecided
Unassigned
Raring
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/{lower,upper,combined}
cd /tmp/proc
mount -t proc none lower
mount -t tmpfs -o mode=755 none upper
mount -t overlayfs -o lowerdir=lower,upperdir=upper none combined
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

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.]

tags: added: patch
Robie Basak (racb) wrote :

Thank you for reporting this bug and helping to make Ubuntu better.

Is this a duplicate of bug 708080? That bug claims this problem was fixed in 1.5.7-3ubuntu1. So is this a different issue, or has there been a regression?

Thanks for your swift reply.

According to me, this bug is not a duplicate of bug 708080.

This new bug occurs with the latest version of qemu-server (v 2.3.18)

When using qemu-server v2.0.72, the output of /proc/cpuinfo shows "QEMU Virtual CPU", and the fix was added to integrate QEMU/KVM types in facter.

Now qemu-server has been updated, the /proc/cpuinfo does not show "QEMU Virtual CPU" anymore, but "Common KVM processor". This causes this announced facter bugs, which does not recognize KVM as virtual machines.

Please, let me know if I could submit you a valid bug report : on my side, I don't think the 2 cases are related, and this should not be a regression.

Thanks a lot,

Best regards,

--
rustx

Any update on this matter ?

Robie Basak (racb) wrote :

Next steps are:

1) Verify that the fix is present in the development release, or land it there if necessary.
2) Go through the SRU procedure (https://wiki.ubuntu.com/StableReleaseUpdates#Procedure)

If you'd like to help with any of this, then please go right ahead. Thanks!

Sebastien Bacher (seb128) wrote :

seems like the patch correspond to this upstream bug: http://projects.puppetlabs.com/issues/20265

OK.

First of all, i am pasting here the commit that fixed that bug on puppet repositories :

https://github.com/puppetlabs/facter/commit/5c653e98e97ba8e83a46b8e0c1fd72dfe672964b

You can see that this fix is really close to the patch I provided you.

Here are the SRU explanation I can provide you.

[Impact]

When running Ubuntu OS with Proxmox VE updated on version 2.3, the output for the /proc/cpuinfo file changes on the running VM, and the facter utils will not recognized the VM as being 'virtual', but as being 'physical'

[Test Case]

see 2 attached files (old_version, new_version)

[Regression Potential]

According to me, there is no regression related to that bug.

Regards

[Test case update ]

No BUG :

- Download Promox VE on version 2.0, and install this one on a server
- Create a simple Ubuntu VM on version 12.04 LTS running on the Proxmox VE node you've juste installed
- Install facter : apt-get install facter
- Retrieve facter execution output -> the virtual informations shows 'KVM', which is good.
- Get /proc/cpuinfo line on the VM showing model name -> it shows "QEMU Virtual CPU version" string

BUG APPEARS :

- Download Proxmox VE on version 2.3, or update the current node on 2.0 version to the 2.3 version
- check the facter execution output on the running VM (the same one you've installed before) -> the virutal informations shows 'physical', which is wrong
- Get /proc/cpuinfo line on the VM showing model name -> it shows "Common KVM processor" string, and not "QEMU Virtual CPU version" an ymore

This is the reason why I am updating you about that bug, which only occurs because of qemu-server packages changes on /proc/cpuinfo output. The proposed patch should fix that bug, without causing any other troubles of any kind.

Robie Basak (racb) wrote :

Is this bug fixed in 13.04? If not, is it fixed in a release of facter yet? If so, which exact upstream release version fixed it?

Robie Basak (racb) wrote :

(I ask because we need this fixed in the development version of Ubuntu before we can update 12.04, in order to avoid a future regression)

Hi Robie,

This bug was not fixed in 13.04, as the integrated version of facter is :

 facter_1.6.9-2ubuntu1

I could check the source code for this package, and the bug is still there, only showing "QEMU Virtual CPU" in facter-1.6.9/lib/facter/util/virtual.rb

The upstream version that releases it is facter 1.7.0, and the exact commit that fixes this bug in the upstream release is the following one :

https://github.com/puppetlabs/facter/commit/5c653e98e97ba8e83a46b8e0c1fd72dfe672964b

I hope I could provide you the information you were looking for.

Regards,

Robie Basak (racb) wrote :
Robie Basak (racb) wrote :

I just found bug 1173265, which I think needs to be fixed in order for any other facter bugs to be successfully SRU'd.

Robie Basak (racb) wrote :

Proposed fix to Saucy in bug 1173265. SRU pending upload to Saucy.

Hi Robie,

Do you have any update concerning this matter ?
I went to check the IRC channel at #Ubuntu, and infinity told me it was just a 'pet bug' which was not worth being looked into.
With that reply, be sure II won't try to get more information on the IRC any more now, and will be waiting for your update,
Thank you for your reply.

Regards,

Robie Basak (racb) wrote :

08:45 <infinity> rustx: You might want to talk to rbasak (who is posting patches to the bugs). This channel isn't for bringing up your pet bugs.
...
08:51 <infinity> rbasak is also in #ubuntu-devel, which would be a better place to discuss bugfixes.

Please don't misrepresent my colleagues. He advised you that you were in the wrong channel, and pointed you to the right place. At no point did he tell you that this bug was not worth being looked into. #ubuntu-release is not an appropriate place to discuss bugs in general. I have answered you there in the past because I only needed a short reply and it was easier to do that then make you go to the right place and answer you there.

As I explained in comments #18 and #19, it turns out that this bug cannot be fixed without bug 1173265 being fixed first. I am waiting sponsorship on the other bug, although I have just discussed the details with a sponsor and I will be doing more to speed things up soon by working on the SRU as well.

In the meantime, perhaps your expectations are wrong here? I am endeavouring to fix this bug because I care about the quality of Ubuntu Server in general. But right now, you appear to be the only one affected by this bug (see "This bug affects one person" at the top of this bug). I will still try to get this fixed soon, but I hope you can understand that with only you affected, this bug has not been a priority, so I had just left it to work its way up the sponsorship queue so it will get seen to in time.

OK.
I am done.
I will erase my launchpad account, which seems to be completely useless.
I will just fix my bugs on my side.
Thank you

Robie Basak (racb) on 2013-05-20
description: updated
Robie Basak (racb) on 2013-05-21
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
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package facter - 1.7.0-1ubuntu1

---------------
facter (1.7.0-1ubuntu1) saucy; urgency=low

  * Merge from Debian unstable (LP: #1173265). Remaining changes:
    - debian/control: ruby-json is not in main, so move Depends to Suggests.
  * Dropped changes:
    - gem2deb and ruby-pkg-tools are now in main:
      + use what we had in natty; we don't want ruby-pkg-tools
         in main. (LP: #408402)
      + Continue using ruby + libopenssl-ruby as Build-Depends even tho Debian
        has moved to gem2deb (not in main).
    - No longer necessary:
      + Use dh_prep instead of dh_clean, add build-arch + build-indep targets
    - Debian packaging now supports multiple Ruby versions:
      + Make binary package depend on ruby1.8 explicitly
    - Applied in Debian:
      + debian/patches/ubuntu_xen_print_virtual.patch: correctly detect
        xen0,xenu. (LP: #980291)
  * d/control: virt-what is not in main, so move Depends to Suggests.
  * d/control, d/tests: add dep8 smoke test.
  * d/p/kvm-cpuinfo: detect "Common KVM processor" in /proc/cpuinfo as virtual
    (LP: #1170325).

facter (1.7.0-1) unstable; urgency=low

  [ Micah Anderson ]
  * fix xen0/xenu detection (Closes: #682417)

  [ Stig Sandbeck Mathisen ]
  * New upstream release
  * Recommend virt-what for virtualization detection
  * Update copyright information

facter (1.6.10-1) unstable; urgency=low

  * New upstream release
  * Remove upstream LSB patch included in this release
 -- Robie Basak <email address hidden> Mon, 20 May 2013 14:09:11 +0000

Changed in facter (Ubuntu):
status: Triaged → Fix Released
Brian Murray (brian-murray) wrote :

I've uploaded this to raring.

Brian Murray (brian-murray) wrote :

And quantal and precise.

Hello bigbigbadass, or anyone else affected,

Accepted facter into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/facter/1.6.5-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in facter (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Brian Murray (brian-murray) wrote :

Hello bigbigbadass, or anyone else affected,

Accepted facter into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/facter/1.6.9-2ubuntu1.12.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in facter (Ubuntu Quantal):
status: Triaged → Fix Committed
Changed in facter (Ubuntu Raring):
status: Triaged → Fix Committed
Brian Murray (brian-murray) wrote :

Hello bigbigbadass, or anyone else affected,

Accepted facter into raring-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/facter/1.6.9-2ubuntu1.13.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Dave Walker (davewalker) wrote :

Hi, this upload has been blocked for 36 days on verification of the uploads that have been prepared. Please would bigbigbadass, or anyone else affected, please test the proposed updates.

This update is now blocking further bug fixing on facter.

Thanks.

Robie Basak (racb) on 2013-09-19
description: updated
Robie Basak (racb) wrote :

Verified from -proposed in Precise, Quantal and Raring.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package facter - 1.6.9-2ubuntu1.12.10.1

---------------
facter (1.6.9-2ubuntu1.12.10.1) quantal; urgency=low

  * d/p/kvm-cpuinfo: detect "Common KVM processor" in /proc/cpuinfo as virtual
    (LP: #1170325).
  * d/control: force build against ruby 1.8 to match the existing archive
    binary (LP: #1173265).
  * Add dep8 smoke test.
 -- Robie Basak <email address hidden> Fri, 17 May 2013 12:35:40 +0000

Changed in facter (Ubuntu Quantal):
status: Fix Committed → Fix Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package facter - 1.6.9-2ubuntu1.13.04.1

---------------
facter (1.6.9-2ubuntu1.13.04.1) raring; urgency=low

  * d/p/kvm-cpuinfo: detect "Common KVM processor" in /proc/cpuinfo as virtual
    (LP: #1170325).
  * d/control: force build against ruby 1.8 to match the existing archive
    binary (LP: #1173265).
  * Add dep8 smoke test.
 -- Robie Basak <email address hidden> Mon, 20 May 2013 13:48:59 +0000

Changed in facter (Ubuntu Raring):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers