Environment

  • Red Hat Enterprise Linux 7.0
  • kernel-3.10.0-123.6.3.el7.x86_64

Issue

  • How to hot plug memory in RHEL7 on the VMware guests?
  • How to check the memory state on RHEL7 in the VMware guests?

Resolution

Note: The hardware or virtualization provider must support hot plug functionality. Historically VMware has supported hot-add memory, but not hot-remove memory. Verify functionality with your hardware or virtualization provider before proceding.

  • We can check current memory status :

    • If the memory section is online, you'll read "online".
    • If the memory section is offline, you'll read "offline".

      #cat /sys/devices/system/memory/memory*/state
      
  • Hot-add memory to the system :

    #echo online > /sys/devices/system/memory/memory<num>/state
    
  • Hot-remove memory from the system :

    • We can remove the memory which the /sys/devices/system/memory/memory/removable is 1.

      #echo offline > /sys/devices/system/memory/memory<num>/state
      
  • For more details about memory hotplug, please check kernel-doc-/Documentation/memory-hotplug.txt.