无法直接从VM中拔除vCPU, 但您可以通过关闭VM后再拔除vCPU;
[root@test-kvm ~]# virsh list --all
Id Name State
----------------------------------------------------
1 generic running
10 centos7 running
[root@test-kvm ~]# virsh setvcpus centos7 1
error: unsupported configuration: failed to find appropriate hotpluggable vcpus to reach the desired target vcpu count
[root@test-kvm log]# virsh setvcpus --config centos7 1
[root@test-kvm log]# virsh destroy centos7
Domain centos7 destroyed
[root@test-kvm log]# virsh start centos7
Domain centos7 started
[root@test-kvm log]# virsh dominfo centos7
Id: 11
Name: centos7
UUID: 6693189b-0a29-4225-b822-724001270bc0
OS Type: hvm
State: running
CPU(s): 1
CPU time: 3.3s
Max memory: 4194304 KiB
Used memory: 4194304 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: none
Security DOI: 0
本文介绍如何在KVM虚拟机中调整vCPU数量,包括动态调整失败的情况及解决方案。通过关闭虚拟机来减少vCPU数量,并展示了具体的virsh命令操作步骤。
490

被折叠的 条评论
为什么被折叠?



