facter does not recognize KVM VMs as 'virtual'

Bug #708080 reported by Oliver Brakmann
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
facter (Ubuntu)
Fix Released
Undecided
Unassigned
Lucid
Fix Released
Undecided
Unassigned
Maverick
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: facter

On current Ubuntu releases (the latest LTS most notably), puppet's
facter library does not recognize KVM virtual machines as virtual:

$ facter | grep virtual
is_virtual => false
virtual => physical

$ grep -i qemu /proc/cpuinfo
model name : QEMU Virtual CPU version 0.12.3

This has already been fixed upstream in version 1.5.8. However, this
version has not been packaged for any Ubuntu release yet (not even Natty).

The upstream commit with the fix is here:
https://github.com/puppetlabs/facter/commit/62b6773a63bb96273fbcb6f79bec524fb67df075

Please also see http://thread.gmane.org/gmane.linux.ubuntu.server/4917.

Thanks!

TEST CASE:
Run "facter | grep virtual" in a KVM virtual machine.

Buggy output: see above.

Expected output:
$ facter | grep virtual
is_virtual => true
virtual => kvm

Revision history for this message
Oliver Brakmann (obrakmann) wrote :

Hmpf, it's been fixed already in 1.5.7-3ubuntu1, by way of Debian.

Changed in facter (Ubuntu):
status: New → Fix Released
Revision history for this message
Oliver Brakmann (obrakmann) wrote :
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Oliver, looking at your patch, a couple of minor changes are necessary:

* the distribution target is set to 'lucid', should be 'lucid-proposed' in debian/changelog
* The version in the changelog should be 1.5.6-2ubuntu2.1 (this is SRU policy)

tags: added: lucid patch
Revision history for this message
Oliver Brakmann (obrakmann) wrote :

Changelog entry of the fixed version:

 facter (1.5.7-2) unstable; urgency=low
 .
   [ Stig Sandbeck Mathisen ]
   * Fix "upgrade from 1.3.5 to 1.5.1 requires puppet to be restarted",
     added a note in debian/NEWS about restarting puppet (Closes: #515726)
   * Add versioned dependency for ruby1.8 (Closes: #585867)
   * debian/control: bump standards version: no changes
   * debian/control: Remove unused build dependency on "cdbs"
   * Add versioned dependency for ruby1.8 (Closes: #585867)
   * Cherry-pick domain/fqdn fact fix from upstream (Closes: #515591)
 .
   [ Micah Anderson ]
   * debian/control: add Vcs-Git, Vcs-Browser, and Homepage fields
   * debian/NEWS: fix lintian syntax-error-in-debian-news-file
   * debian/facter.8: fix manpage-section-mismatch
   * cherry pick upstream virtualization support:
     . openvz fix [#4156]
     . add kvm support (Closes: #603001)
     . fix Linux-Vserver of virtual fact [#3397]
     . add xendomains fact

Revision history for this message
Oliver Brakmann (obrakmann) wrote :

Corrected debdiff for Lucid, thanks to Clint for the advice!

Revision history for this message
Oliver Brakmann (obrakmann) wrote :
Changed in facter (Ubuntu Lucid):
status: New → Triaged
Changed in facter (Ubuntu Maverick):
status: New → Triaged
Revision history for this message
Oliver Brakmann (obrakmann) wrote :

Nominating for SRU, fulfills: (1) have an obviously safe patch and (2) affect an application rather than critical infrastructure packages

Justification: it fixes obviously wrong behaviour in regard to a package that is central to the Ubuntu Server product (KVM).

The fix is from upstream and has been verified to exist in Natty.

Regression potential: Existing puppet manifests which evaluate either the "virtual" or "is_virtual" fact will be impacted when run on KVM guests. However, the existence of such manifests is to be doubted, since they would be broken in such an environment anyway. Administrators that have worked around this bug may possibly notice a regression, though.

description: updated
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hi Oliver,

Thanks for your debdiffs. They look good to me. I have sponsored your changes into lucid-proposed and maverick-proposed. As soon as they build, we'll need you (or anyone else) to test the resulting packages and ensure sure that they fix this bug and don't cause other regressions.

Thanks again!

your patch pilot,
Dustin

Changed in facter (Ubuntu Lucid):
status: Triaged → Fix Committed
Changed in facter (Ubuntu Maverick):
status: Triaged → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted facter into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted facter into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Revision history for this message
Oliver Brakmann (obrakmann) wrote :

I have just verified that the new packages fix this bug for both Lucid and Maverick. I did not notice any regressions on either VM, nor on a physical system running Lucid.

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package facter - 1.5.6-2ubuntu2.1

---------------
facter (1.5.6-2ubuntu2.1) lucid-proposed; urgency=low

  * Cherry-picked KVM detection for 'virtual' fact from upstream commit
    62b6773a63bb96273fbc. (LP: #708080).
 -- Oliver Brakmann <email address hidden> Wed, 26 Jan 2011 21:36:23 +0100

Changed in facter (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package facter - 1.5.7-1ubuntu1.1

---------------
facter (1.5.7-1ubuntu1.1) maverick-proposed; urgency=low

  * Cherry-picked KVM detection for 'virtual' fact from upstream commit
    62b6773a63bb96273fbc. (LP: #708080).
 -- Oliver Brakmann <email address hidden> Thu, 27 Jan 2011 19:03:10 +0100

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.