Bug 700384 - qemu-kvm -enable-kvm fails to start on EC2: kvm_create_vm: Device or resource busy
Summary: qemu-kvm -enable-kvm fails to start on EC2: kvm_create_vm: Device or resource...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 15
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-28 09:31 UTC by Marek Goldmann
Modified: 2013-01-09 23:50 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-28 23:18:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
dmesg output (19.20 KB, text/plain)
2011-04-28 09:31 UTC, Marek Goldmann
no flags Details

Description Marek Goldmann 2011-04-28 09:31:42 UTC
Created attachment 495461 [details]
dmesg output

Description of problem:

$ unset LIBGUESTFS_QEMU
$ guestfish -v -a /dev/null launch
libguestfs: [00000ms] febootstrap-supermin-helper --verbose -f checksum '/usr/lib64/guestfs/supermin.d' x86_64
supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel = (null), initrd = (null), appliance = (null)
supermin helper [00000ms] inputs[0] = /usr/lib64/guestfs/supermin.d
checking modpath /lib/modules/2.6.38.2-9.fc15.x86_64 is a directory
picked vmlinuz-2.6.38.2-9.fc15.x86_64 because modpath /lib/modules/2.6.38.2-9.fc15.x86_64 exists
supermin helper [00000ms] finished creating kernel
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [00017ms] visiting /usr/lib64/guestfs/supermin.d/base.img
supermin helper [00017ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
supermin helper [00017ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
supermin helper [00056ms] visiting /usr/lib64/guestfs/supermin.d/init.img
supermin helper [00174ms] finished creating appliance
libguestfs: [00182ms] begin testing qemu features
libguestfs: [00216ms] finished testing qemu features
libguestfs: accept_from_daemon: 0x9b1930 g->state = 1
libguestfs: [00219ms] /usr/bin/qemu-kvm \
    -drive file=/dev/null,if=virtio \
    -nodefconfig \
    -enable-kvm \
    -nodefaults \
    -nographic \
    -m 500 \
    -no-reboot \
    -no-hpet \
    -device virtio-serial \
    -serial stdio \
    -chardev socket,path=/tmp/libguestfsdar4N0/guestfsd.sock,id=channel0 \
    -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
    -kernel /var/tmp/.guestfs-0/kernel.28765 \
    -initrd /var/tmp/.guestfs-0/initrd.28765 \
    -append 'panic=1 console=ttyS0 udevtimeout=300 noapic acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1 TERM=xterm-color ' \
    -drive file=/var/tmp/.guestfs-0/root.28765,snapshot=on,if=virtio,cache=unsafe
kvm_create_vm: Device or resource busy
failed to initialize KVM: Operation not permitted
libguestfs: error: unexpected end of file when reading from daemon
libguestfs: child_cleanup: 0x9b1930: child process died
libguestfs: closing guestfs handle 0x9b1930 (state 0)


Version-Release number of selected component (if applicable):

libguestfs-1.10.1-1.fc15.x86_64
qemu-kvm-0.14.0-7.fc15.x86_64

How reproducible:

Always on EC2

Steps to Reproduce:

guestfish -v -a /dev/null launch
  
Actual results:

Error.

Expected results:

No error.

Comment 1 Richard W.M. Jones 2011-04-28 09:33:10 UTC
dmesg output?

Comment 2 Richard W.M. Jones 2011-04-28 09:40:24 UTC
The relevant dmesg lines are:

[ 3403.483140] kvm: enabling virtualization on CPU1 failed
[ 3403.483173] kvm: enabling virtualization on CPU0 failed

I would say this is a KVM or kernel bug.  Possible dupe of
bug 680821.

Comment 3 Richard W.M. Jones 2011-04-28 09:41:17 UTC
Clear NEEDINFO.

Comment 4 Justin M. Forbes 2011-05-19 13:35:46 UTC
This only happens on EC2? As in while running as a xen pv guest?

Comment 5 Benny Halevy 2011-09-20 07:42:37 UTC
I'm seeing this on my laptop - Lenovo T420

# qemu-kvm fedora-15-4g.img
kvm_create_vm: Device or resource busy
Could not initialize KVM, will disable KVM support

# dmesg|grep -i kvm
[33660.334484] kvm: enabling virtualization on CPU1 failed
[33660.334515] kvm: enabling virtualization on CPU2 failed
[33660.334520] kvm: enabling virtualization on CPU3 failed
[33660.334530] kvm: enabling virtualization on CPU0 failed

# head -25 /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
stepping	: 7
cpu MHz		: 800.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips	: 4984.61
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

Comment 6 Benny Halevy 2011-09-20 07:49:06 UTC
(Virtualization and VT-d cpu features are enabled in BIOS in my case above)

Comment 7 Benny Halevy 2011-09-20 07:55:21 UTC
Found the problem in my case.  I had VirtualBox running at the same time.  I got qemu-kvm started.

Comment 11 Fedora Admin XMLRPC Client 2012-03-15 17:52:39 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 12 Cole Robinson 2012-05-28 23:18:00 UTC
AIUI EC2 guests are basically xen paravirt, which does not allow running a nested full virt hypervisor like KVM in the guest. So this isn't expected to work.


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