Hot adding memory


#1

I added some ram to a NixOS guest running under VM ware and tried to follow the instructions to make the OS recognize the ram without rebooting.

The first step is to run the following:

grep line /sys/devices/system/memory/*/state

Unfortunately /sys/devices/system/memory doesn’t exist. Does anyone know what I need to add to my configuration file so that my NixOS guests can have ram added without needing to reboot?

Thanks!

https://kb.vmware.com/s/article/1012764


#2

A quick google showed this: https://www.mjmwired.net/kernel/Documentation/memory-hotplug.txt#115
So maybe the kernel in NixOS isn’t configured with these flags?


#3

hotplug seems missing:

─ % zgrep CONFIG_SPARSEMEM /proc/config.gz
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_VMEMMAP=y

╭─[~/git/nixpkgs]
╰─ % zgrep CONFIG_MEMORY_HOTPLUG /proc/config.gz
# CONFIG_MEMORY_HOTPLUG is not set

#4

Mic92 - thank you for confirming!

Issue filed: https://github.com/NixOS/nixpkgs/issues/53814


#5

I’ve created a PR for this:

I would appreciate if anyone else could test this in any other environments as well. I have confirmed with this kernel I can hotplug memory on a VMWare guest.

Notes on testing: http://www.supermaru.com/2016/10/hot-add-cpu-memory-ubuntu-guest-vmware/