$ cat proxmox-vms-crash-on-boot-after-you-hot-add-ram-or-cpus-what.md

Proxmox VMs Crash on Boot After You Hot-Add RAM or CPUs: What the NUMA and Hotplug Flags Do

2026-11-30 · proxmox qemu virtualization troubleshooting

The Hardware tab in Proxmox has a Hotplug option under the VM’s Options. Tick “Memory” and “CPU” and you can raise RAM or vCPU counts on a running guest without a reboot. It’s a nice feature. It also has a few dependencies that the UI doesn’t mention, and when they’re missing you get a VM that boots slowly, boots with the wrong amount of memory, or refuses to start at all.

I hit this after turning hotplug on for a handful of VMs because I was tired of scheduling reboots just to bump memory. Two of them came back fine. One came up with half the RAM I’d assigned. One hung before the kernel finished loading.

What the flags actually change

Under Options, “Hotplug” is a comma-separated list in the VM config. You can see it in /etc/pve/qemu-server/<vmid>.conf:

hotplug: disk,network,usb,memory,cpu
numa: 1

The default is disk,network,usb. Those three work on almost anything. Memory and CPU are different because the guest kernel has to cooperate. QEMU presents the extra RAM as DIMM devices and the extra CPUs as hot-pluggable sockets, and the guest has to notice them and bring them online.

The NUMA requirement

Memory hotplug needs NUMA enabled on the VM. Proxmox will tell you this if you try to set memory hotplug without it, but it’s easy to miss if you edit the config by hand or restore a backup from a VM that had a different setup.

qm set 105 --numa 1

With NUMA on, Proxmox splits the memory into virtual DIMMs. The base allocation is the memory the guest boots with, and added memory arrives in chunks on top of it. That’s why the visible total can look odd right after a change. If a guest is meant to have 8 GB and you see 4 GB, the hotplugged half has not been onlined yet.

The guest has to online the memory

This is the part that bit me. A Linux guest sees new DIMMs but doesn’t always switch them on. Check inside the guest:

grep -H . /sys/devices/system/memory/memory*/state | grep offline

Any blocks listed as offline are memory the kernel knows about and isn’t using. Modern distro kernels usually ship with auto-online enabled. Verify it:

cat /sys/devices/system/memory/auto_online_blocks

If it prints offline, hotplugged memory sits unused. The quick fix is a udev rule inside the guest:

# /etc/udev/rules.d/80-hotplug-memory.rules
SUBSYSTEM=="memory", ACTION=="add", ATTR{state}=="offline", ATTR{state}="online"

Alternatively, boot with memhp_default_state=online on the kernel command line. Either way, test it before you depend on it.

CPUs follow the same pattern. New vCPUs show up under /sys/devices/system/cpu/cpu*/online, and a udev rule that writes 1 to that file brings them up. Many distros already include a rule for this, but minimal or older images often don’t.

Why one VM hung at boot

The hung guest was an older install with a kernel that predated decent memory hotplug support. With the hotplug flags set, QEMU built the guest with empty DIMM slots, and the kernel stalled early on. Turning the flags off fixed it instantly.

Other things I’ve seen cause trouble:

  • Ballooning together with hotplug. Both change guest memory. If you leave ballooning on with a minimum below the maximum, results get unpredictable. For VMs where I want hotplug, I set the balloon minimum equal to the memory size, or disable ballooning on that VM.
  • Windows guests. Windows handles CPU hotplug but memory hotplug support depends on the edition. Desktop editions generally ignore it. Don’t assume it works because the config accepted it.
  • Hugepages. Memory hotplug and hugepages don’t mix. If a VM has hugepages set, leave memory hotplug off.
  • Very large hot additions. Adding a big amount on a small base can fail, because the kernel needs memory itself to track the new blocks. Small base plus huge hot-add is the pattern to avoid.

Hot-removal is not the same thing

Adding works. Removing is far less reliable. Linux can only offline a memory block if nothing unmovable lives in it, and after a guest has been running a while, that’s rarely true. In practice I treat hotplug as a one-way increase and plan a reboot when I want to scale down.

A test routine before you rely on it

I now run this on any VM before I flip the flags in production:

  1. Set numa: 1 and the hotplug list, then do a full stop and start. A reboot from inside the guest doesn’t apply new QEMU hardware definitions.
  2. Inside the guest, note free -m and nproc.
  3. Raise memory and cores from the Proxmox side while the guest is running.
  4. Run free -m and nproc again, and check dmesg | tail for hotplug messages.
  5. If numbers didn’t change, look for offline memory blocks as shown above.

Step 1 is the one people skip. The config changing in the UI doesn’t mean the running QEMU process has the new device layout. Until the VM is fully stopped and started, hotplug flags are only a pending change, and the first “hot” add you try will behave like nothing happened.

If a VM won’t boot after you enable the flags, remove memory,cpu from the hotplug: line in the conf file and start it again. You lose the feature, but the guest is back, and you can sort out the kernel side from a console.