I'm trying to upgrade RAM on a Xen VM without reboot. Although it looks working from the host node, the VM isn't picking up the upgraded memory.

Upgrading from 756 MB to 1024 MB. Below are the commands I used along with relevant info

xm list vm2
Name                                        ID   Mem VCPUs      State   Time(s)
vm2                                         35   768    2     -b----    180.5

RAM upgrade on the fly using xm mem-set

xm mem-max vm2 1024
xm mem-set vm2 1024

Host node now see it has upgraded RAM,

xm list vm2
Name                                        ID   Mem VCPUs      State   Time(s)
vm2                                         35  1024     2     -b----    210.6

However checking memory on the VM still shows only 756MB,

# free -m
             total       used       free     shared    buffers     cached
Mem:           750        669         80          0         23        145
-/+ buffers/cache:        500        249
Swap:          767        106        661

It picks any downgrade of the memory instantaneously, say to 512 MB.

Any advise would be appreciated.

2 Answers 2


Your kernel needs to support Linux Memory Hotplug

which will provide a sysfs interface to the server's RAM configuration under /sys/devices/system/memory from where you can en/dis-able modules by writing to /sys/devices/system/memory/memory[number]/state

This VMWare KB article has a step-by-step procedure.

You may also want to dig around CentOS forums for "memory hot plug not working on CentOS vm" as it's supposed to work and the solution is quite probably a general configuration issue.

  • That did the trick, I'm able to hotplug memory into the VM now without reboot.
    – shad
    Oct 18, 2013 at 14:31
  • Is there a way to enable the hot-plugging in the VM from the beginning? The VMWare-KB-article only describes how to fix this afterwards. I would have expected a syctl-setting that will enable memory-hot-plugging...
    – Nils
    Oct 22, 2013 at 7:58
  • Hot-plugging is there, just not automatic. I guess the firmware doesn't send the ACPI event. You can use a script though; see adaptivethinking.wordpress.com/2009/07/27/…
    – Eddy
    Oct 22, 2013 at 8:07

If that is anywhere like in Hyper-V then the max ram the VM has is fixed at boot - the balloon driver can hide ram, but not magically add it to the simulated hardware. So this likely is not possible without vm reboot.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .