Bug 772395 - VMs fail to start
Summary: VMs fail to start
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 16
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-07 15:09 UTC by Steve Grubb
Modified: 2012-01-16 13:39 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-16 13:39:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Steve Grubb 2012-01-07 15:09:36 UTC
Description of problem:
Error starting domain: internal error Child process (LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -device ? -device pci-assign,? -device virtio-blk-pci,? -device virtio-net-pci,?) status unexpected: exit status 1

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 44, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1050, in startup
    self._backend.create()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 510, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error Child process (LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -device ? -device pci-assign,? -device virtio-blk-pci,? -device virtio-net-pci,?) status unexpected: exit status 1

There is nothing useful in syslog and there are no AVC's associated with this.


Version-Release number of selected component (if applicable):
libvirt-0.9.6-4.fc16.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Start any VM

Comment 1 Laine Stump 2012-01-09 16:04:59 UTC
This is failing while executing the basic "probe" command to figure out the version / capabilities of the qemu-kvm binary. What happens when you run:

  /usr/bin/qemu-kvm -device ? -device pci-assign,? -device virtio-blk-pci,? \
                    -device virtio-net-pci,?

manually from a shell prompt?

Comment 2 Steve Grubb 2012-01-09 16:40:07 UTC
I get the following:

[root ~]# /usr/bin/qemu-kvm -device ? -device pci-assign,? -device virtio-blk-pci,? -device virtio-net-pci,?
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
No accelerator found!

Comment 3 Laine Stump 2012-01-09 17:34:56 UTC
Well, there's your problem :-)

The kvm module isn't loaded. Try running "modprobe -i kvm-intel" (or kvm-amd, whichever is appropriate). If that solves your problem, you should look into why the kvm modules aren't loaded on your system. If it doesn't solve the problem, it's possible that virtualization is disabled in your bios.

In the meantime, Dan Berrange points out that although libvirt can't make the guest run in this situation (since it has <domain type='kvm'/>, but kvm isn't available), we should still probably spit out a better error message, perhaps by doing a preliminary check to see if /dev/kvm exists.

Comment 4 Steve Grubb 2012-01-09 22:40:03 UTC
Yeah, if it would output a message instead of a traceback, that would be helpful. But regarding the module not loading, I found this in syslog:

Dec 11 20:24:34 centaur kernel: [    7.867038] kvm: disable TXT in the BIOS or activate TXT before enabling KVM
Dec 11 20:24:34 centaur kernel: [    7.867041] kvm: disabled by bios

The same system works fine running F14.

Comment 5 Laine Stump 2012-01-16 13:39:53 UTC
I pushed the following to upstream libvirt last week. The message logged when kvm isn't loaded is now:

  Domain requires KVM, but it is not available. Check that virtualization
  is enabled in the host BIOS, and host configuration is setup to load
  the kvm modules.

I'm marking this as CLOSED UPSTREAM. If you think the problem is serious enough to backport, please reopen the bug and make a comment to that effect.

==============================================

32f63e912d3bef42a7fa70a0f2d5b04b98afe936
Author: Laine Stump <laine>
Date:   Mon Jan 9 14:54:14 2012 -0500

    qemu: check for kvm availability before starting kvm guests
    
    This *kind of* addresses:
    
      https://bugzilla.redhat.com/show_bug.cgi?id=772395
    
    (it doesn't eliminate the failure to start, but causes libvirt to give
    a better idea about the cause of the failure).
    
    If a guest uses a kvm emulator (e.g. /usr/bin/qemu-kvm) and the guest
    is started when kvm isn't available (either because virtualization is
    unavailable / has been disabled in the BIOS, or the kvm modules
    haven't been loaded for some reason), a semi-cryptic error message is
    logged:
    
      libvirtError: internal error Child process (LC_ALL=C
      PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -device ? -device
      pci-assign,? -device virtio-blk-pci,? -device virtio-net-pci,?) status
      unexpected: exit status 1
    
    This patch notices at process start that a guest needs kvm, and checks
    for the presence of /dev/kvm (a reasonable indicator that kvm is
    available) before trying to execute the qemu binary. If kvm isn't
    available, a more useful error is logged.


Note You need to log in before you can comment on or make changes to this bug.