[kvm] change check_enabled to /dev/kvm

Bug #1883320 reported by Eric Desrochers
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sosreport (Ubuntu)
Fix Released
Medium
Eric Desrochers
Xenial
Fix Released
Medium
Eric Desrochers
Bionic
Fix Released
Medium
Eric Desrochers
Eoan
Fix Released
Medium
Eric Desrochers
Focal
Fix Released
Medium
Eric Desrochers
Groovy
Fix Released
Medium
Eric Desrochers

Bug Description

[Impact]

The KVM plugin get triggered in a container
(e.g lxd) because of "/sys/module/kvm"
inheritance from the kernel host.

Not only it's a waste of sosreport time,
but running it inside a container may
unintentionally reveal details from its
host. Which is a undesired behaviour.

Switching to /dev/kvm, is more appropriate
and follow current standard as used by tool
such as cpu-checker (kvm-ok) for instance.

And taking benefit of this change to get rid
of the check_enabled() overwrite in favour of
using "files=" trigger.

[Test Case]

* Run sosreport inside a LXD container
* The container will contain KVM information from its host (Iff its host as KVM installed)

[Regression Potential]

We only change the way the plugin gets triggered to use a most conventional way.

If /dev/kvm exist, then exercise the kvm plugin.

No regression expected, but worse case scenario, it will only be isolated and impact the KVM plugin to collect data properly as expected.

It won't cause any harm to others plugins nor sosreport core functionalities itself.

The commit went through some upstream Travis testing which used a shell script called "simple.sh" to verify sosreport collection.

BTW, this same exact script is part of the sosreport autopkgtest, and will be run as part of the SRU to push this change.

[Other Information]

* Upstream bug:
https://github.com/sosreport/sos/issues/2062

* Upstream commit:
https://github.com/sosreport/sos/pull/2063/commits/dc58a038c18ff3e838d883d4b31aad5dac7ea9e1

Eric Desrochers (slashd)
tags: added: seg sts
Changed in sosreport (Ubuntu):
assignee: nobody → Eric Desrochers (slashd)
status: New → In Progress
Eric Desrochers (slashd)
description: updated
description: updated
Revision history for this message
Eric Desrochers (slashd) wrote :

Fixed in Groovy's sosreport (3.9.1-1ubuntu1) uploaded earlier today.

  * New 3.9.1 upstream release. (LP: #1884293)
    This maintenance release includes:
    - New plugins: sos_extras, ovirt_engine_backup, console,
      validation_framework.
    - lxd plugin collections have been overhauled.
    - Fixed handling of the namespace pattern for the networking
      plugin.
    - A basic path is now defined in Policy for all subclasses.

    Plugin API Enhancements:
    - Enablement checks have been extended to include architecture
      constraints.
    - SoSPredicate has been extended to include architecture constraints,
      as well as negative constraints for all elements.
    - Plugins will now capture service status information for all services
      defined in the services class attr.

    Further release information and tarballs are available at:
    - https://github.com/sosreport/sos/releases/tag/3.9.1

  * Former patches now fixed upstream:
    - d/p/0001-unittest-py3-fix.patch
    - d/p/0002-lxd-drop-db-collection-and-introduce-lxd-buginfo.patch

  * Other specific modifications:
    - d/p/0001-lshw-command.patch
    - d/p/0002-lds-substitute-oidc-conf.patch
==> - d/p/0003-kvm-change-trigger-to-dev-kvm.patch <==

Changed in sosreport (Ubuntu Groovy):
status: In Progress → Fix Released
Changed in sosreport (Ubuntu Focal):
status: New → In Progress
assignee: nobody → Eric Desrochers (slashd)
importance: Undecided → Medium
Eric Desrochers (slashd)
Changed in sosreport (Ubuntu Bionic):
status: New → In Progress
Changed in sosreport (Ubuntu Eoan):
status: New → In Progress
assignee: nobody → Eric Desrochers (slashd)
Changed in sosreport (Ubuntu Bionic):
assignee: nobody → Eric Desrochers (slashd)
Changed in sosreport (Ubuntu Groovy):
importance: Undecided → Medium
Changed in sosreport (Ubuntu Eoan):
importance: Undecided → Medium
Changed in sosreport (Ubuntu Bionic):
importance: Undecided → Medium
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Eric, or anyone else affected,

Accepted sosreport into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.9.1-1ubuntu0.20.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 on 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in sosreport (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Changed in sosreport (Ubuntu Eoan):
status: In Progress → Fix Committed
tags: added: verification-needed-eoan
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Eric, or anyone else affected,

Accepted sosreport into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.9.1-1ubuntu0.19.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 on 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, what testing has been performed on the package and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Eric, or anyone else affected,

Accepted sosreport into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.9.1-1ubuntu0.18.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 on 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, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in sosreport (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (sosreport/3.9.1-1ubuntu0.18.04.1)

All autopkgtests for the newly accepted sosreport (3.9.1-1ubuntu0.18.04.1) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

sosreport/3.9.1-1ubuntu0.18.04.1 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#sosreport

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Eric Desrochers (slashd) wrote :

[VERIFICATION BIONIC]

Test with sosreport: 3.9.1-1ubuntu0.18.04.1

* Running sosreport from for instance an LXD container, no longer reveal KVM details from its host as it was previously (if KVM was installed at the host level):

 ** ls -altr sos_commands/kvm
ls: cannot access 'sos_commands/kvm': No such file or directory

* Running sosreport from a system with KVM installed does triggers the KVM plugin as it should and the data is accurate and as expected.

* sos_logs/sos.log:
sos.log:2020-06-23 17:37:44,340 INFO: [plugin:kvm] collecting path '/sys/module/kvm/srcversion'
sos.log:2020-06-23 17:37:44,341 INFO: [plugin:kvm] collecting path '/sys/module/kvm_intel/srcversion'
sos.log:2020-06-23 17:37:44,341 INFO: [plugin:kvm] collecting output of 'kvm_stat --once'

# ls -altr sos_commands/kvm/
total 20
-rw-r--r-- 1 root root 8568 Jun 23 17:42 kvm_stat_--once

Revision history for this message
Eric Desrochers (slashd) wrote :

[VERIFICATION FOCAL]

Test with sosreport: 3.9.1-1ubuntu0.20.04.1

* Running sosreport from for instance an LXD container, no longer reveal KVM details from its host as it was previously (if KVM was installed at the host level):

 ** ls -altr sos_commands/kvm
ls: cannot access 'sos_commands/kvm': No such file or directory

* Running sosreport from a system with KVM installed does triggers the KVM plugin as it should and the data is accurate and as expected.

* sos_logs/sos.log:
INFO: [plugin:kvm] collecting path '/sys/module/kvm/srcversion'
INFO: [plugin:kvm] collecting path '/sys/module/kvm_intel/srcversion'
INFO: [plugin:kvm] collecting output of 'kvm_stat --once'

# ls sos_commands/kvm/
total 20
kvm_stat_--once

Revision history for this message
Eric Desrochers (slashd) wrote :

[VERIFICATION EOAN]

Test with sosreport: 3.9.1-1ubuntu0.19.10.1

* Running sosreport from for instance an LXD container, no longer reveal KVM details from its host as it was previously (if KVM was installed at the host level):

 ** ls -altr sos_commands/kvm
ls: cannot access 'sos_commands/kvm': No such file or directory

* Running sosreport from a system with KVM installed does triggers the KVM plugin as it should and the data is accurate and as expected.

* sos_logs/sos.log:
INFO: [plugin:kvm] collecting path '/sys/module/kvm/srcversion'
INFO: [plugin:kvm] collecting path '/sys/module/kvm_intel/srcversion'
INFO: [plugin:kvm] collecting output of 'kvm_stat --once'

# ls sos_commands/kvm/
total 20
kvm_stat_--once

tags: added: verification-done verification-done-bionic verification-done-eoan verification-done-focal
removed: verification-needed verification-needed-bionic verification-needed-eoan verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 3.9.1-1ubuntu0.20.04.1

---------------
sosreport (3.9.1-1ubuntu0.20.04.1) focal; urgency=medium

  * New 3.9.1 upstream release. (LP: #1884293) (LP: #1883320)
    This maintenance release includes:
    - New plugins: sos_extras, ovirt_engine_backup, console,
      validation_framework.
    - lxd plugin collections have been overhauled.
    - Fixed handling of the namespace pattern for the networking
      plugin.
    - A basic path is now defined in Policy for all subclasses.

    Plugin API Enhancements:
    - Enablement checks have been extended to include architecture
      constraints.
    - SoSPredicate has been extended to include architecture constraints,
      as well as negative constraints for all elements.
    - Plugins will now capture service status information for all services
      defined in the services class attr.

    Further release information and tarballs are available at:
    - https://github.com/sosreport/sos/releases/tag/3.9.1

  * Former patches now fixed upstream:
    - d/p/0001-unittest-py3-fix.patch
    - d/p/0002-lxd-drop-db-collection-and-introduce-lxd-buginfo.patch

  * Other specific modifications:
    - d/p/0001-lshw-command.patch
    - d/p/0002-lds-substitute-oidc-conf.patch
    - d/p/0003-kvm-change-trigger-to-dev-kvm.patch

 -- Eric Desrochers <email address hidden> Tue, 16 Jun 2020 12:18:58 +0000

Changed in sosreport (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for sosreport has completed successfully and the package is now being 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 regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 3.9.1-1ubuntu0.19.10.1

---------------
sosreport (3.9.1-1ubuntu0.19.10.1) eoan; urgency=medium

  * New 3.9.1 upstream release. (LP: #1884293) (LP: #1883320)
    This maintenance release includes:
    - New plugins: sos_extras, ovirt_engine_backup, console,
      validation_framework.
    - lxd plugin collections have been overhauled.
    - Fixed handling of the namespace pattern for the networking
      plugin.
    - A basic path is now defined in Policy for all subclasses.

    Plugin API Enhancements:
    - Enablement checks have been extended to include architecture
      constraints.
    - SoSPredicate has been extended to include architecture constraints,
      as well as negative constraints for all elements.
    - Plugins will now capture service status information for all services
      defined in the services class attr.

    Further release information and tarballs are available at:
    - https://github.com/sosreport/sos/releases/tag/3.9.1

  * Former patches now fixed upstream:
    - d/p/0001-unittest-py3-fix.patch
    - d/p/0002-lxd-drop-db-collection-and-introduce-lxd-buginfo.patch

  * Other specific modifications:
    - d/p/0001-lshw-command.patch
    - d/p/0002-lds-substitute-oidc-conf.patch
    - d/p/0003-kvm-change-trigger-to-dev-kvm.patch

 -- Eric Desrochers <email address hidden> Tue, 16 Jun 2020 12:18:58 +0000

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

This bug was fixed in the package sosreport - 3.9.1-1ubuntu0.18.04.1

---------------
sosreport (3.9.1-1ubuntu0.18.04.1) bionic; urgency=medium

  * New 3.9.1 upstream release. (LP: #1884293) (LP: #1883320)
    This maintenance release includes:
    - New plugins: sos_extras, ovirt_engine_backup, console,
      validation_framework.
    - lxd plugin collections have been overhauled.
    - Fixed handling of the namespace pattern for the networking
      plugin.
    - A basic path is now defined in Policy for all subclasses.

    Plugin API Enhancements:
    - Enablement checks have been extended to include architecture
      constraints.
    - SoSPredicate has been extended to include architecture constraints,
      as well as negative constraints for all elements.
    - Plugins will now capture service status information for all services
      defined in the services class attr.

    Further release information and tarballs are available at:
    - https://github.com/sosreport/sos/releases/tag/3.9.1

  * Former patches now fixed upstream:
    - d/p/0001-unittest-py3-fix.patch
    - d/p/0002-lxd-drop-db-collection-and-introduce-lxd-buginfo.patch

  * Other specific modifications:
    - d/p/0001-lshw-command.patch
    - d/p/0002-lds-substitute-oidc-conf.patch
    - d/p/0003-kvm-change-trigger-to-dev-kvm.patch

 -- Eric Desrochers <email address hidden> Tue, 16 Jun 2020 12:18:58 +0000

Changed in sosreport (Ubuntu Bionic):
status: Fix Committed → Fix Released
Eric Desrochers (slashd)
Changed in sosreport (Ubuntu Xenial):
status: New → In Progress
assignee: nobody → Eric Desrochers (slashd)
Eric Desrochers (slashd)
Changed in sosreport (Ubuntu Xenial):
importance: Undecided → Medium
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Eric, or anyone else affected,

Accepted sosreport into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.9.1-1ubuntu0.16.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 on 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, what testing has been performed on the package and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in sosreport (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-xenial
removed: verification-done
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (sosreport/3.9.1-1ubuntu0.16.04.1)

All autopkgtests for the newly accepted sosreport (3.9.1-1ubuntu0.16.04.1) for xenial have finished running.
The following regressions have been reported in tests triggered by the package:

sosreport/3.9.1-1ubuntu0.16.04.1 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/xenial/update_excuses.html#sosreport

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Eric Desrochers (slashd) wrote :

[VERIFICATION XENIAL]

Test with sosreport: 3.9.1-1ubuntu0.16.04.1

* Running sosreport from for instance an LXD container, no longer reveal KVM details from its host as it was previously (if KVM was installed at the host level):

 ** ls -altr sos_commands/kvm
ls: cannot access 'sos_commands/kvm': No such file or directory

* Running sosreport from a system with KVM installed does triggers the KVM plugin as it should and the data is accurate and as expected.

* sos_logs/sos.log:
INFO: [plugin:kvm] collecting path '/sys/module/kvm/srcversion'
INFO: [plugin:kvm] collecting path '/sys/module/kvm_intel/srcversion'
INFO: [plugin:kvm] collecting output of 'kvm_stat --once'

# ls sos_commands/kvm/
total 20
kvm_stat_--once

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

This bug was fixed in the package sosreport - 3.9.1-1ubuntu0.16.04.1

---------------
sosreport (3.9.1-1ubuntu0.16.04.1) xenial; urgency=medium

  * New 3.9.1 upstream release. (LP: #1884293)
    This maintenance release includes:
    - New plugins: sos_extras, ovirt_engine_backup, console,
      validation_framework.
    - lxd plugin collections have been overhauled.
    - Fixed handling of the namespace pattern for the networking
      plugin.
    - A basic path is now defined in Policy for all subclasses.

    Plugin API Enhancements:
    - Enablement checks have been extended to include architecture
      constraints.
    - SoSPredicate has been extended to include architecture constraints,
      as well as negative constraints for all elements.
    - Plugins will now capture service status information for all services
      defined in the services class attr.

    Further release information and tarballs are available at:
    - https://github.com/sosreport/sos/releases/tag/3.9.1

  * Former patches now fixed upstream:
    - d/p/0001-unittest-py3-fix.patch

  * Remaining patch:
    - d/p/0001-lshw-command.patch

  * Other specific modifications:
    - d/p/0002-lds-substitute-oidc-conf.patch
    - d/p/0003-kvm-change-trigger-to-dev-kvm.patch (LP: #1883320)
    - d/p/0004-maas-add-snap-support.patch (LP: #1886494)
    - Add simple.sh as part of the autopkgtest (LP: #1865212)

 -- Eric Desrochers <email address hidden> Wed, 15 Jul 2020 13:06:39 +0000

Changed in sosreport (Ubuntu Xenial):
status: Fix Committed → Fix Released
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.