可能原因一
默认的开源QEMU配置中,kvm配置项为auto,使用默认参数创建虚拟机时,可能并未开启KVM硬件加速。可参考解决方案处理。
可能原因二
与CPU型号有关,当前环境CPU不支持KVM硬件加速功能。
执行virt-host-validate命令查询当前环境CPU是否支持KVM硬件加速功能,若显示如下,表示当前环境不支持KVM硬件加速功能。请咨询相关CPU处理器技术支持人员或更换为支持KVM硬件加速功能的环境解决。
chmod +x ./qemu-4.1.0.tar.xz
tar -xf ./qemu-4.1.0.tar.xz
cd qemu-4.1.0/
[root@localhost etc]# service libvirtd restart Redirecting to /bin/systemctl restart libvirtd.service
systemctl disable apparmor
若系统环境为openEuler 22.03 LTS/openEuler 20.03 LTS/Kylin V10 SP2/Kylin V10/UOS V20(1050e)/CULinux 3.0/Tlinux3.1/UOS V20(1050u2e)/Kylin V10 SP3/Debian11.8/BC Linux 8.2/Debian10.13/veLinux 1.2系统,可跳过此步骤。
若系统环境为openEuler 22.03 LTS/openEuler 20.03 LTS/Kylin V10 SP2/Kylin V10/UOS V20(1050e)/CULinux 3.0/Tlinux3.1/UOS V20(1050u2e)/Kylin V10 SP3/Debian11.8/BC Linux 8.2/Debian10.13/veLinux 1.2系统,可跳过此步骤。
[root@localhost qemu-4.1.0]# virsh version Compiled against library: libvirt 6.0.0 Using library: libvirt 6.0.0 Using API: QEMU 6.0.0 Running hypervisor: QEMU 4.1.0
[root@localhost ~]# virsh list --all Id Name State ---------------------------- 1 centos running
virsh shutdown <domain>
[root@localhost vm]# virsh shutdown centos Domain centos is being shutdown
<domain type='kvm'> <name>xxx</name> <uuid>xxxxxx</uuid> <memory unit='KiB'>xxxx</memory> <currentMemory unit='KiB'>xxxx</currentMemory> <vcpu placement='static' cpuset=xxxxx</vcpu> ...... <cpu mode='host-passthrough' check='none'> <topology sockets='1' cores='20' threads='1'/> </cpu> ... ...