Skip to content

Add CPU and memory to a running VM

Updated

A classic VM can take more vCPUs and more memory while it runs, with no restart and no shutdown, as long as it was started with live hot-add on. The guest sees the new CPUs and memory within seconds.

Live hot-add is off by default. Turn it on in either place:

  • When you create the VM: under the vCPU and memory fields, switch on Allow live CPU and memory hot-add.
  • On a stopped VM: open Hardware, switch on Live hot-add and save.

When you switch it on, two ceilings appear: Max vCPUs and Max memory. They start at four times the size you set, capped at what the host has (and at 254 vCPUs). Change them if you want a different limit. A running VM can grow up to these ceilings and no further. Max memory is also limited by how much memory the host’s processors can address for one VM; the form does not accept a larger value.

The ceilings take effect at the next boot. A VM that is already running keeps the ceilings it booted with until you stop it and start it again.

Enabling live hot-add adds guest memory overhead even before you grow the VM. Choose ceilings you expect to use rather than setting every VM to the host maximum.

Live hot-add is not available for AppVMs.

  1. Open the VM and go to Hardware. The note at the top says how far vCPUs and memory can still grow.
  2. Raise vCPU or Memory, up to the ceilings, and save. The VM keeps running. Memory grows in steps of 128 MB from its current size.
  3. Watch the In the guest row. It shows what the guest has online, for example vCPUs: 4 of 4 online., and anything that is not online yet.

A running VM can add memory at most 8 times per boot. Hardware shows how many additions are left. After the eighth, stop the VM and start it again: its current memory becomes its starting size, and it can grow again up to the same ceiling.

Sometimes the number of additions left in the current boot cannot be determined, for example after an interrupted memory change or on a VM started by an earlier version. Hardware then says Memory hot-add history is unknown. and does not let you add memory while the VM runs; you can still add vCPUs. To add memory again, stop the VM and start it again. The new boot has its full 8 additions.

On Linux, the Virtainer guest agent brings new CPUs and memory online if the kernel and the distribution’s rules do not. On Windows, Windows brings them online itself. The guest agent reports vCPUs on Windows only in versions that support it, and never reports memory there, so the row says so instead of showing a number.

A running VM cannot be made smaller. Removing CPUs from a running guest is not supported, and a guest cannot be relied on to give up memory it has brought online. To shrink, stop the VM, lower the values in Hardware and start it again.

On a Linux guest, Memory reclaim returns memory to the host while the VM runs, and you can undo it at any time. It is not available for Windows guests.

Each of these grew from 2 vCPUs and 2 GiB to 4 vCPUs and 4 GiB while running, and showed the new values without a restart:

Guest Result
Debian 13 CPU and memory available without a restart
Rocky Linux 10 CPU and memory available without a restart
Ubuntu 24.04 CPU and memory available without a restart
Windows Server 2022 Standard CPU and memory available without a restart

Other Windows Server editions and versions have not been tested.