3

I am trying to increase vCPUs on a VM. I have done this in the past.

  1. Poweroff the VM

  2. Configure for maximum allowed vCPUs

    virsh setvcpus vm-1 10 --maximum --config
    
  3. Change for current settings

    virsh setvcpus vm-1 10 --current
    
  4. Power on the VM

This way successfully adds 10 vCPUs to my VM. For some reasons, I need to add vCPUs on the VM without powering off. Is there a way to do this?

D34DM347
  • 1,461
  • 2
  • 19
  • 32

2 Answers2

3

Not at present. It looks like CPU hotplug used to be possible in QEMU, but the patch is old and crusty, never worked with windows guests, and not shipped natively anymore.

http://www.linux-kvm.org/page/CPUHotPlug

Andrew Domaszek
  • 5,103
  • 1
  • 14
  • 26
0

--maximum only sets the upperlimit that the number of vCPUs can be. It is different from the number that can be actually assigned.

--current can update the vCPUs number without powering off. The constraint you have is that the maximum number allowed has to be already set high enough to allow such change (while the machine was off) so that you can tune it at runtime. You probably need to set the maximum possible number you might need once and then adapt it at runtime.

Ahmed
  • 411
  • 4
  • 5