Bug 700384 - qemu-kvm -enable-kvm fails to start on EC2: kvm_create_vm: Device or resource busy
qemu-kvm -enable-kvm fails to start on EC2: kvm_create_vm: Device or resource...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
15
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Virtualization Maintainers
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-28 05:31 EDT by Marek Goldmann
Modified: 2013-01-09 18:50 EST (History)
15 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-28 19:18:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Marek Goldmann 2011-04-28 05:31:42 EDT
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 05:33:10 EDT
dmesg output?
Comment 2 Richard W.M. Jones 2011-04-28 05:40:24 EDT
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 05:41:17 EDT
Clear NEEDINFO.
Comment 4 Justin M. Forbes 2011-05-19 09:35:46 EDT
This only happens on EC2? As in while running as a xen pv guest?
Comment 5 Benny Halevy 2011-09-20 03:42:37 EDT
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 03:49:06 EDT
(Virtualization and VT-d cpu features are enabled in BIOS in my case above)
Comment 7 Benny Halevy 2011-09-20 03:55:21 EDT
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 13:52:39 EDT
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 19:18:00 EDT
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.