[CentOS-virt] CPU Hot Plug/Unplug with KVM on CentOS

Thu Jan 8 17:52:39 UTC 2015
roy simkes <roysimkes at gmail.com>


I'm trying to plug and unplug cpus with a host CentOS 7 on a guest machine
with CentOS too. I have created the guest with virt-install command,
modified my domxml to have maximum 4 vcpus and updated the current cpu to 2.

After that I open the virsh console, and used command setvcpus to
add/remove cpus. I was able to increase the vcpu count until 4 but can't
increase it after 4 as it exceeds maximum vcpu count. However when I want
to remove vcpus, again by using setvcpus command, I noticed that it's not
possbile. I have looked around and found a changelog related to CentOS 6.5
where unplugging was supported. To check that, I have installed CentOS 6.5
on the host machine and tried again and noticed that it worked.

I used the commands as this:

virsh -c qemu:///system
setvcpus myguest 3
setvcpus myguest 2 (Caused an error on CentOS 7 but not on 6.5)

The excerpt from my domxml related to the cpus is like this:

<vcpu placement='static' current="2">4</vcpu>

I can again see those cpus being plugged and unplugged using the

I have looked around a little bit but I was unable to find why this
happened. Can you direct me to the right place to look or tell me if this
is a bug or not? Or is it something related to the libvirt and not kvm/qemu?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20150108/4fd2e56e/attachment-0002.html>