为什么硬件升级后我的虚拟机变得更慢了?

为什么硬件升级后我的虚拟机变得更慢了?

旧主机 centos 8:

old cpu : AMD Ryzen 3 2200g Quad-core (4 Core, 4 Threads) 3.50 Ghz Processor 
old ram : 2 x Corsair 8 GB Vengeance LPX DDR4 2400MHz
SATA 3 SSD

Guest : microsoft windows pro ( image format : qcow2 )
cpu given : 1 cores, 1 threads
ram given : 4 GiB
disk size : 70 GB
<domain type='kvm' id='1'>

新主机 centos 8:

Current cpu : Intel® Core™ i9-10900 Processor 20M Cache, up to 5.20 GHz ( base freq 2.8, 10 core, 20 threads )
current ram : 2 x Corsair 32 GB Vengeance LPX DDR4 3000MHz
SATA 3 SSD

Guest : microsoft windows pro ( image format : raw )
cpu given : 2 core, 4 threads
ram given : 8 GiB
disk size : 150 GB
<domain type='qemu' id='1'>

为什么即使有了更好的硬件,我的新客户仍然运行缓慢?

编辑:这似乎是由于 CPU 占用 100%,但我还是不明白。因为我刚刚安装了客户机 在此处输入图片描述

答案1

旧的使用 KVM 运行:<domain type='kvm' id='1'> 新的使用 qemu 运行:<domain type='qemu' id='1'>

下面几行代码有助于解释问题所在,

[msingh@localhost Compressed]$ virsh capabilities | grep kvm
      <baselabel type='kvm'>system_u:system_r:svirt_t:s0</baselabel>
      <emulator>/usr/libexec/qemu-kvm</emulator>
      <emulator>/usr/libexec/qemu-kvm</emulator>
[msingh@localhost Compressed]$ virt-host-validate
  QEMU: Checking for hardware virtualization                                 : PASS
  QEMU: Checking if device /dev/kvm exists                                   : FAIL (Check that the 'kvm-intel' or 'kvm-amd' modules are loaded & the BIOS has enabled virtualization)
  QEMU: Checking if device /dev/vhost-net exists                             : PASS
  QEMU: Checking if device /dev/net/tun exists                               : PASS
  QEMU: Checking for cgroup 'cpu' controller support                         : PASS
  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS
  QEMU: Checking for cgroup 'memory' controller support                      : PASS
  QEMU: Checking for cgroup 'devices' controller support                     : PASS
  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
  QEMU: Checking for device assignment IOMMU support                         : WARN (No ACPI DMAR table found, IOMMU either disabled in BIOS or not supported by this hardware platform)


[msingh@localhost Compressed]$ dmesg | grep kvm
[    4.057616] kvm: disabled by bios
[    4.103434] kvm: disabled by bios
[    4.153237] kvm: disabled by bios
[    4.189655] kvm: disabled by bios
[    4.226248] kvm: disabled by bios
[    4.255269] kvm: disabled by bios
[    4.280338] kvm: disabled by bios
[    4.304822] kvm: disabled by bios
[    4.329817] kvm: disabled by bios
[    4.354095] kvm: disabled by bios
[    4.380921] kvm: disabled by bios
[    4.407032] kvm: disabled by bios
[    4.434890] kvm: disabled by bios
[    4.461832] kvm: disabled by bios
[    4.501926] kvm: disabled by bios
[    4.531737] kvm: disabled by bios
[    4.556759] kvm: disabled by bios
[    4.582904] kvm: disabled by bios
[    4.610824] kvm: disabled by bios
[    4.640933] kvm: disabled by bios

我必须按照以下说明在 bios 中启用 KVM如何在华硕主板上启用硬件虚拟化

而且,我取消options kvm_intel nested=1/etc/modprobe.d/kvm.conf

通过这个简单的改变,我重新创建了 VM 以使用 KVM 而不是 qemu 作为虚拟机管理程序。

目前运行良好。

相关内容