I am working on increasing the number of virtual cores of the KVM virtual machines lively using libvirt. I created a virtual machine with 2 cores. Here are the initial core settings.
virsh vcpucount 2
maximum config 32
maximum live 32
current config 2
current live 2
I also attach initial CPU usage output using htop.
After that, I increase the number of cores to 4 using the following command
virsh setvcpus 2 4 --live
I check the current core configuration of the VM
virsh vcpucount 2
maximum config 32
maximum live 32
current config 2
current live 4
It looks like I was able to increase the number of cores from 2 to 4. However, I realize weirdness in terms of CPU usage. After I allocated 2 more cores, I observed the following CPU usage. The problem here is that added two cores are at the 100% level. When I back to 2 cores again, CPU usage returns to normal.
Do you know why it happens?
Thank you in advance,
The problem was fixed after I upgraded Ubuntu OS version. I was using version
18.04.4 LTS
. In addition, the kernel version was4.15.0-153-generic
. After I upgraded the OS to20.04.4 LTS (kernel version: 5.4.0-121-generic)
, it was fixed. The problem must have about KVM kernel module version.