=> Virt Host info: <= #-----------------------------------------------------------# [root@moon ~]# virsh nodeinfo CPU model: x86_64 CPU(s): 4 CPU frequency: 1995 MHz CPU socket(s): 1 Core(s) per socket: 4 Thread(s) per core: 1 NUMA cell(s): 1 Memory size: 10242960 KiB [root@moon ~]# #-----------------------------------------------------------# => Version Info: <= #-----------------------------------------------------------# [root@moon ~]# uname -r ; arch ; rpm -q qemu-kvm libvirt 3.4.6-2.fc17.x86_64 x86_64 qemu-kvm-1.1.0-9.fc17.x86_64 libvirt-0.9.13-3.fc17.x86_64 [root@moon ~]# #-----------------------------------------------------------# => Confirm if Nested Virt is enabled: <= #-----------------------------------------------------------# [root@moon ~]# modinfo kvm_intel | grep -i nested parm: nested:bool [root@moon ~]# cat /sys/module/kvm_intel/parameters/nested Y [root@moon ~]# systool -m kvm_intel -v | grep -i nested nested = "Y" [root@moon ~]# #-----------------------------------------------------------# => Regular guest info <= #-----------------------------------------------------------# [root@moon qemu]# virsh dominfo regular-guest-f17 Id: 3 Name: regular-guest-f17 UUID: 21774949-7093-5cff-d16c-057d226730e4 OS Type: hvm State: running CPU(s): 4 CPU time: 458.0s Max memory: 4194304 KiB Used memory: 4194304 KiB Persistent: yes Autostart: disable Managed save: no Security model: selinux Security DOI: 0 Security label: system_u:system_r:svirt_t:s0:c195,c936 (permissive) [root@moon qemu]# #-----------------------------------------------------------# => Enable VMX in the regular-guest, by adding the host cpu model info in its libvirt xml file <= #-----------------------------------------------------------# [root@moon qemu]# virsh capabilities | virsh cpu-baseline /dev/stdin Penryn Intel #-----------------------------------------------------------# => Ensure KVM character device is present in the regular-guest <= #-----------------------------------------------------------# [root@dhcp201-170 ~]# file /dev/kvm /dev/kvm: character special [root@dhcp201-170 ~]# #-----------------------------------------------------------# =>As we enabled vmx in the guest-hypervisor, let’s confirm that vmx is exposed in the emulated CPU by ensuring qemu-kvm is invoked with 'vmx' extensions by grepping the qemu-kvm command line on the host <= #-----------------------------------------------------------# [root@moon qemu]# ps -ef | grep qemu-kvm qemu 25537 1 7 20:06 ? 00:00:25 /usr/bin/qemu-kvm -name regular-guest-f17 -S -M pc-1.1 -cpu Penryn,+osxsave,+xsave,+dca,+pdcm,+xtpr,+tm2,+vmx,+ds_cpl,+monitor,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds,+vme -enable-kvm -m 4096 -smp 4,sockets=4,cores=1,threads=1 -uuid 21774949-7093-5cff-d16c-057d226730e4 -nographic -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/regular-guest-f17.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/export/vmimgs/regular-guest-f17.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=18,id=hostnet0,vhost=on,vhostfd=19 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:1a:e6:27,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 root 25848 20961 0 20:12 pts/8 00:00:00 grep --color=auto qemu-kvm [root@moon qemu]# #-----------------------------------------------------------# => Attempt to create a nested guest. <= Seems like it's hung again.. #-----------------------------------------------------------# [root@dhcp201-170 nested-test]# ./create-nested-guest.bash Creating qcow2 disk image.. Formatting '/export/vmimgs/nested-guest-f17.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 preallocation='metadata' 11G -rw-r--r--. 1 root root 11G Jul 28 10:47 /export/vmimgs/nested-guest-f17.qcow2 Starting install... Retrieving file .treeinfo... | 1.8 kB 00:00 !!! Retrieving file vmlinuz... | 8.9 MB 00:00 !!! Retrieving file initrd.img... | 47 MB 00:00 !!! Creating domain... | 0 B 00:00 #-----------------------------------------------------------# => Even virsh appears to be hung, inside the regular guest. <= #-----------------------------------------------------------# [root@dhcp201-170 ~]# virsh list #-----------------------------------------------------------# Check what's going on with the 'qemu-kvm' process: #-----------------------------------------------------------# [root@dhcp201-170 ~]# ps -ef | grep qemu-kvm qemu 1134 1 99 10:47 ? 00:11:36 /usr/bin/qemu-kvm -name nested-guest-f17 -S -M pc-1.1 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -uuid 5c4626a9-9d92-7a1b-2778-d65e7cd65d6f -nographic -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/nested-guest-f17.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-reboot -no-shutdown -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.bIfGFV -initrd /var/lib/libvirt/boot/virtinst-initrd.img.6IjyxH -append method=http://download.eng.pnq.redhat.com/pub/fedora/linux/development/17/x86_64/os/ ks=file:/fed.ks console=tty0 console=ttyS0,115200 serial rd_NO_PLYMOUTH -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/export/vmimgs/nested-guest-f17.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=19,id=hostnet0,vhost=on,vhostfd=20 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:97:f6:6d,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 root 1142 506 0 10:47 ? 00:00:00 /usr/bin/qemu-kvm -no-user-config -device ? -device pci-assign,? -device virtio-blk-pci,? -device virtio-net-pci,? -device scsi-disk,? root 1222 1148 0 10:58 pts/2 00:00:00 grep --color=auto qemu-kvm [root@dhcp201-170 ~]# #-----------------------------------------------------------# LIBVIRT_DEBUG=1 #-----------------------------------------------------------# [root@dhcp201-170 ~]# 'virsh list' . . . 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCalculateTimeout:324 : Calculate expiry of 0 timers 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCalculateTimeout:350 : Timeout at 0 due in -1 ms 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollRunOnce:618 : EVENT_POLL_RUN: nhandles=1 timeout=-1 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollRunOnce:629 : Poll got 1 event(s) 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollDispatchTimeouts:414 : Dispatch 0 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollDispatchHandles:459 : Dispatch 1 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollDispatchHandles:473 : i=0 w=1 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollDispatchHandles:487 : EVENT_POLL_DISPATCH_HANDLE: watch=1 events=1 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCleanupTimeouts:505 : Cleanup 0 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCleanupTimeouts:541 : Found 0 out of 0 timeout slots used, releasing 0 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCleanupHandles:553 : Cleanup 2 2012-07-28 14:59:50.827+0000: 1236: debug : virEventRunDefaultImpl:244 : running default event implementation 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCleanupTimeouts:505 : Cleanup 0 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCleanupTimeouts:541 : Found 0 out of 0 timeout slots used, releasing 0 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCleanupHandles:553 : Cleanup 2 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollMakePollFDs:382 : Prepare n=0 w=1, f=4 e=1 d=0 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollMakePollFDs:382 : Prepare n=1 w=2, f=6 e=0 d=0 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCalculateTimeout:324 : Calculate expiry of 0 timers 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollCalculateTimeout:350 : Timeout at 0 due in -1 ms 2012-07-28 14:59:50.827+0000: 1236: debug : virEventPollRunOnce:618 : EVENT_POLL_RUN: nhandles=1 timeout=-1 #-----------------------------------------------------------#