如何判断 KVM 中的 VM 是否正在使用 VT-x

如何判断 KVM 中的 VM 是否正在使用 VT-x

我有一台在 KVM 下运行的机器,性能不太好。我一直在谷歌上搜索确定虚拟机是否使用 VT-x 的方法。我可以找到很多关于如何确定您的处理器是否支持 VT-x 以及它是否在 bios 中启用的链接,但我如何验证我的虚拟机是否正在使用它?服务器支持 vtx 并且已启用。

ps ax | grep kvm 的结果

2039 ? S 0:00 [kvm-irqfd-clean] 21158 ? Sl 50:43 /usr/libexec/qemu-kvm -name cws-QV1 -S -M rhel6.6.0 -cpu SandyBridge,+erms,+smep,+fsgsbase,+pdpe1gb,+rdrand,+f16c,+osxsave,+dca,+pcid,+pdcm,+xtpr,+tm2,+est,+smx,+vmx,+ds_cpl,+monitor,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds,+vme -enable-kvm -m 200000 -realtime mlock=off -smp 32,sockets=2,cores=16,threads=1 -uuid ea794c0c-2f56-9eae-1859-98be632e44df -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/cws-QV1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -no-shutdown -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x6.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x6 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x6.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x6.0x2 -drive file=/kvm/cws-QV1/SAD_SOE_W2008-R2-ENT-x64.qcow2,if=none,id=drive-ide0-0-0,format=qcow2,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive file=/var/lib/libvirt/images/cws-QV1.img,if=none,id=drive-ide0-0-1,format=qcow2,cache=none -device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/var/lib/libvirt/images/cws-QV1-1.img,if=none,id=drive-ide0-1-1,format=qcow2,cache=none -device ide-drive,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1 -netdev tap,fd=23,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:81:1e:c7,bus=pci.0,addr=0x3 -netdev tap,fd=24,id=hostnet1,vhost=on,vhostfd=25 -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:8f:39:e5,bus=pci.0,addr=0x4 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga std -device intel-hda,id=sound0,bus=pci.0,addr=0x5 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on

答案1

在主机上:

查看您的进程列表。使用 VT-x 加速启动的 KVM 机器将包含命令行选项-machine accel=kvm(可能与其他相关的机器选项一起)。

$ ps ax | grep accel=kvm
14912 ?        Sl    90:09 /usr/bin/qemu-system-x86_64 -machine accel=kvm -name Windows2012R2 ...........

相关内容