ubuntu qemu-kvm package attempts to start a service and fails

Bug #1316812 reported by Andrew Woodward on 2014-05-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
qemu-kvm (Ubuntu)
Serge Hallyn

Bug Description

impact: qemu-kvm cannot be installed if modprobe of kvm will fail
test case: create a precise container; rm /bin/running-in-container; ln -s /bin/false /bin/running-in-container; apt-get install qemu-kvm
regression potential: if the modprobe failures were due to real errors, kvm may fail later on

Iso 172, 180, 183

Ubuntu (guest) 12.04.04 qemu-kvm fails to install because upstart wont pass.

root@node-2:~# apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up qemu-kvm (1.2.0+noroms-0ubuntu7.12.10) ...
start: Job failed to start
invoke-rc.d: initscript qemu-kvm, action "start" failed.
dpkg: error processing qemu-kvm (--configure):
 subprocess installed post-installation script returned error exit status 1

expected result: qemu-kvm should install and "start" anyways even if acceleration can't be loaded.

grep "^flags.* svm" /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb lm 3dnowext 3dnow rep_good nopl extd_apicid pni cx16 popcnt hypervisor cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw

root@node-1:/etc/init# modprobe kvm
root@node-1:/etc/init# modprobe kvm_amd
FATAL: Error inserting kvm_amd (/lib/modules/3.11.0-18-generic/kernel/arch/x86/kvm/kvm-amd.ko): Operation not supported
root@node-1:/etc/init# ls -l /dev/kvm
ls: cannot access /dev/kvm: No such file or directory

[10925.939670] has_svm: can't execute cpuid_8000000a
[10925.939677] kvm: no hardware support

init fails due to
cat /etc/init/qemu-kvm.conf
pre-start script
        # Silently exit if the package isn't installed anymore
        if [ ! -e /usr/bin/kvm ]; then
                exit 0
        [ -r /etc/default/qemu-kvm ] && . /etc/default/qemu-kvm
        # Load the appropriate module, respecting blacklists
        if grep -qs "^flags.* vmx" /proc/cpuinfo; then
                modprobe -b kvm_intel "$KVM_NESTED" || true
                chown root:kvm /dev/kvm
                chmod 0660 /dev/kvm
        elif grep -qs "^flags.* svm" /proc/cpuinfo; then
                modprobe -b kvm_amd || true
                chown root:kvm /dev/kvm
                chmod 0660 /dev/kvm

It appears that guest might have been passed bad CPU flags and qemu-kvm in host might not be allowing kvm acceleration to load. It appears that similar results have been noted in Debian upstream, where they are testing for -e /dev/kvm before attempting to load more acceleration

in Debian SID

case "$1" in

        [ ! -e /dev/kvm ] || exit 0 # nothing to do

Andrew Woodward (xarses) wrote :
Ryan Moe (rmoe) on 2014-05-06
Changed in fuel:
importance: Critical → High
Andrew Woodward (xarses) wrote :
Andrew Woodward (xarses) on 2014-05-06
description: updated
Serge Hallyn (serge-hallyn) wrote :

Returning 0 if /dev/kvm does not exist after the modprobe would be ok, so long as those users do nto want to have hugetlbfs mounted. Otherwise we can simply guard the chmod with || true as we do the modprobe.

Changed in qemu-kvm (Ubuntu):
importance: Undecided → High
status: New → Triaged
Vladimir Kuklin (vkuklin) wrote :

this safe check should go write befor we do chown of /dev/kvm. it should not replace check for /usr/bin/kvm

Andrew Woodward (xarses) on 2014-05-06
description: updated
Andrew Woodward (xarses) on 2014-05-06
Changed in fuel:
status: Confirmed → Triaged
Vitaly Parakhin (vparakhin) wrote :
Changed in fuel:
status: Triaged → In Progress
assignee: Fuel OSCI Team (fuel-osci) → Fuel QA Team (fuel-qa)
Changed in qemu-kvm (Ubuntu Precise):
assignee: nobody → Serge Hallyn (serge-hallyn)
importance: Undecided → High
status: New → Confirmed
Changed in qemu-kvm (Ubuntu):
status: Triaged → Fix Released
description: updated
Tatyanka (tatyana-leontovich) wrote :

verified on 186 iso {"build_id": "2014-05-07_17-31-58", "mirantis": "yes", "build_number": "186", "ostf_sha": "fe718434f88f2ab167779770828a195f06eb29f8", "nailgun_sha": "82b9d42a7a5e9aa1caf6b2779c45ca045cad0ad2", "production": "prod", "api": "1.0", "fuelmain_sha": "013578cd17d28f3745d225ea2867edfc41b134fb", "astute_sha": "9c83d3ecec69df03cd94620e2df92249ba4ec786", "release": "5.0", "fuellib_sha": "bf4c169bdb858c2477ae3f486765dc1e4a178d13"}. Can not reproduce such problem

Mike Scherbakov (mihgen) on 2014-05-13
Changed in fuel:
assignee: Fuel QA Team (fuel-qa) → Tatyana (tatyana-leontovich)
status: In Progress → Fix Committed

Hello Andrew, or anyone else affected,

Accepted qemu-kvm into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/qemu-kvm/1.0+noroms-0ubuntu14.15 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 qemu-kvm (Ubuntu Precise):
status: Confirmed → Fix Committed
tags: added: verification-needed
Marc Deslauriers (mdeslaur) wrote :

Can someone please test this, or it will get superseded by a security update.

Serge Hallyn (serge-hallyn) wrote :

Testcase in description passed (and failed with precise-updates as expected).

Would still prefer to hear from the actual bug submitters.

tags: added: verification-done
removed: verification-needed

The verification of the Stable Release Update for qemu-kvm 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 qemu-kvm - 1.0+noroms-0ubuntu14.15

qemu-kvm (1.0+noroms-0ubuntu14.15) precise-proposed; urgency=low

  * qemu-kvm.upstart: ignore modprobe errors (LP: #1316812)
 -- Serge Hallyn <email address hidden> Wed, 07 May 2014 14:06:43 +0000

Changed in qemu-kvm (Ubuntu Precise):
status: Fix Committed → Fix Released
Tatyanka (tatyana-leontovich) wrote :

start verification on 5.0-26 iso

Tatyanka (tatyana-leontovich) wrote :

{"build_id": "2014-05-27_05-51-41", "mirantis": "yes", "build_number": "26", "ostf_sha": "a8b7660082a6f152794c610d6abe30d360fd577d", "nailgun_sha": "bd09f89ef56176f64ad5decd4128933c96cb20f4", "production": "docker", "api": "1.0", "fuelmain_sha": "505741e4f431f85a8d0252fc42754d10c0326c1a", "astute_sha": "a7eac46348dc77fc2723c6fcc3dbc66cc1a83152", "release": "5.0", "fuellib_sha": "2f79c0415159651fc1978d99bd791079d1ae4a06"}

root@node-8:/etc/init# modprobe kvm
root@node-8:/etc/init# modprobe kvm_amd
FATAL: Error inserting kvm_amd (/lib/modules/3.11.0-18-generic/kernel/arch/x86/kvm/kvm-amd.ko): Operation not supported

root@node-8:/etc/init# dpkg -l | grep qemu-kvm
ii qemu-kvm 1.2.0+noroms-0ubuntu7.12.12 Full virtualization on supported hardware

Changed in fuel:
assignee: Tatyana (tatyana-leontovich) → Fuel OSCI Team (fuel-osci)

Why do we have to have such a service running on the controller node? As far as I understand we need it to run on the compute nodes only. Once virtualization has been switched off in the BIOS of the controller the node will fail to deploy.

Colin Watson (cjwatson) on 2015-09-15
Changed in fuel:
assignee: Registry Administrators (registry) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers