VMware Memory Hotplug Linux: Ubuntu Memory Hotplug VMware, VMware Memory CPU Hotplug CentOS, and VMware Hotplug Memory Linux — Complete Per-Distro Guide
Dynamic scaling of VM resources is critical in production workloads where downtime is unacceptable. VMware Memory Hotplug allows administrators to add RAM to a running Linux VM without rebooting — eliminating service interruptions during demand spikes. Unlike CPU hotplug, which has limited OS edition support, memory hotplug is broadly supported across modern Linux distributions.
This guide focuses on Ubuntu, CentOS, and Debian — the three most common Linux server platforms in VMware environments. You’ll learn:
- How to enable memory hotplug in vSphere and confirm guest OS support.
- Kernel and configuration requirements for each distribution.
- Step‑by‑step verification that the guest recognizes newly added memory.
- Limitations and best practices to avoid performance or NUMA issues.
📌 Core takeaway → With proper configuration, Linux guests on VMware can scale memory live, ensuring workloads remain responsive without planned downtime.
VMware Hot‑Add Memory and CPU: What It Does and What It Requires
⚙️ What VMware Hot‑Add Actually Does
VMware hot‑add (hot‑plug) lets you increase a VM’s vCPU count 🖥️ and RAM allocation 💾 without shutting it down. Once enabled in the VM’s settings, ESXi delivers new virtual hardware through ACPI hotplug events. The guest OS kernel must detect these events and integrate the new resources into its scheduler and memory allocator.
- ✅ If the kernel auto‑handles the event → resources are instantly available.
- ⚠️ If not → new CPUs or memory blocks appear in
/sys/devices/system/cpu/or/sys/devices/system/memory/as offline, requiring manual onlining commands.
🛠️ Prerequisites Before Enabling Hot‑Add
- 📦 VMware Tools / open‑vm‑tools → Must be installed for proper communication between ESXi and the guest OS. Without them, hardware change events are not registered.
- 🔢 Virtual Hardware Version → Requires version 7 or higher for both memory and CPU. Check via Edit Settings → VM Options → General in vSphere.
- ⏻ VM Power State → Hot‑add must be enabled while the VM is powered off. The toggle cannot be changed on a running VM.
- 🧩 vNUMA Trade‑off → Enabling hot‑add disables vNUMA optimization. For VMs with >8 vCPUs spanning multiple NUMA nodes, this can reduce memory‑access performance.
- ➕ One‑directional limitation → Hot‑add supports adding resources only. Removing RAM or vCPUs always requires a full VM power cycle.
🐧 Linux Kernel Support for ACPI Hotplug
Modern Linux kernels (3.x+) include ACPI memory and CPU hotplug support. The difference lies in distribution defaults:
- 🔴 RHEL / CentOS / Rocky / AlmaLinux → Auto‑online new memory and CPUs via udev rules and systemd services.
- 🟢 Ubuntu / Debian → Accept ACPI events but leave new memory blocks offline. Admins must manually online memory or configure auto‑online behavior.
📌 Key takeaway → Hot‑add depends not only on VMware configuration but also on how each Linux distribution handles ACPI hotplug events.
Enabling VMware Memory Hotplug in vSphere: Step‑by‑Step
(Keyword: vmware hotplug memory linux)
Enable Memory and CPU Hot‑Add via vSphere Client
- 1. 🔌 Power off the target VM.
- 2. In the vSphere Client, right‑click the VM → Edit Settings.
- 3. On the Virtual Hardware tab:
- Expand Memory → check Enable Hot Plug.
- Expand CPU → check Enable CPU Hot Add.
- 4. Click OK and power on the VM.
- 5. ✅ Verify hot‑add is enabled by reopening Edit Settings while the VM is running — the checkboxes should reflect the configured values.
Enable Memory Hot‑Add via VMX File (ESXi SSH)
For environments without vSphere Client access or when automating template configuration:
- 1. 🔌 Power off the VM.
- 2. SSH into the ESXi host.
- 3. Navigate to the VM directory:
cd /vmfs/volumes/[datastore]/[VMname]- 4. Edit the VMX file:
vi VMname.vmx- 5. Add or confirm these lines:
mem.hotadd = "TRUE"
vcpu.hotadd = "TRUE"- 6. Save the file and power on the VM.
Hot‑Adding Memory After the VM Is Running
- 1. With the VM running and hot‑add enabled, right‑click the VM in vSphere → Edit Settings.
- 2. In the Memory field, increase the allocation to the desired value. This field is editable on a running VM only when hot‑add is enabled.
- 3. Click OK. vSphere delivers the new memory blocks to the VM via ACPI hotplug events.
- 4. 🐧 Inside the guest OS, verify whether the memory was auto‑onlined or requires manual intervention (see per‑distribution sections below).
Ubuntu Memory Hotplug VMware: Manually Onlining Added RAM
❓ Why Ubuntu Does Not Auto‑Online Hotplugged Memory
Ubuntu and Debian do not auto‑online hotplugged memory by default. The kernel accepts the ACPI memory hotplug event and creates entries in /sys/devices/system/memory/, but leaves them in an offline state. Running free -m immediately after a vSphere hot‑add shows no change in total memory — the blocks exist in hardware view but are not available to the allocator. 📌 This is a deliberate safety design, not a bug. Admins must either manually online the blocks or configure Ubuntu to auto‑online them.
🛠️ Step‑by‑Step: Manually Online Hotplugged Memory in Ubuntu
- 1. After increasing RAM in vSphere, connect to the Ubuntu VM via SSH.
- 2. Check which memory blocks are offline:
grep -i offline /sys/devices/system/memory/*/stateExample output:
/sys/devices/system/memory/memory100/state: offline- 3. Online each offline block individually:
echo online > /sys/devices/system/memory/memory100/state- 4. For multiple blocks, use a loop:
for mem in /sys/devices/system/memory/*/state; do
if [ "$(cat $mem)" = "offline" ]; then
echo online > "$mem"
echo "Onlined: $mem"
fi
done- 5. Verify new memory is registered:
free -m✅ The MemTotal line should now reflect the added RAM.
⚙️ Configure Ubuntu to Auto‑Online Hotplugged Memory Automatically
To avoid manual steps every time:
Option 1 — Kernel boot parameter (persistent across reboots):
- 1. Edit GRUB:
sudo nano /etc/default/grub- 2. Add parameter:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash memhp_default_state=online"- 3. Update GRUB:
sudo update-grub- 4. Reboot VM → future hotplug events will auto‑online memory.
Option 2 — udev rule (immediate, no reboot):
- 1. Create rule:
echo 'SUBSYSTEM=="memory", ACTION=="add", ATTR{state}=="offline", ATTR{state}="online"' | \
sudo tee /etc/udev/rules.d/40-hotplug-memory.rules- 2. Reload rules:
sudo udevadm control --reload-rules- 3. Future hotplug events will trigger auto‑online automatically.
📌 Key takeaway → On Ubuntu/Debian, hotplugged memory is offline by default. Admins must either manually online blocks or configure GRUB/udev for auto‑online to ensure seamless scaling.
VMware Memory CPU Hotplug CentOS: RHEL and CentOS Automatic Onlining
🤖 Why RHEL and CentOS Handle Hotplug Automatically
Red Hat Enterprise Linux, CentOS, Rocky Linux, AlmaLinux, and CentOS Stream include default udev rules and systemd configurations that automatically online hotplugged memory and CPUs.
- When ESXi delivers a new memory block via ACPI, the RHEL‑family kernel brings it online immediately — no administrator action required.
- Running
free -mafter a vSphere hot‑add shows the updated total memory instantly. - CPU hot‑add works the same way: new cores appear in
/proc/cpuinfoandlscpuwithout manual onlining.
📌 Key point → RHEL‑based distributions are designed for seamless hotplug operations, making them ideal for production workloads.
🛠️ Step‑by‑Step: Verify and Online Hotplugged Memory in CentOS/RHEL (Manual Path)
In most cases, auto‑onlining works. Use this manual procedure only if it does not (older CentOS 6/7 or custom kernels):
- 1. After vSphere hot‑adds memory, check for offline blocks:
grep -i offline /sys/devices/system/memory/*/stateLook for entries marked offline.
- 2. Online a specific block (replace
memoryNwith the block number):
echo online > /sys/devices/system/memory/memoryN/state- 3. Verify memory is registered:
free -m- 4. For CPU hotplug, verify new CPUs:
lscpu
cat /proc/cpuinfo | grep "processor"If CPUs appear offline:
echo 1 > /sys/devices/system/cpu/cpuN/online⚙️ Enable acpiphp Module on Older CentOS/RHEL for CPU Hotplug
On CentOS 6 and early CentOS 7, the acpiphp module must be loaded for the kernel to detect hot‑added CPUs and PCI devices:
sudo modprobe acpiphpTo load automatically at boot:
echo "acpiphp" | sudo tee /etc/modules-load.d/acpiphp.conf📌 Modern RHEL 8/9 and CentOS Stream handle this automatically — manual module loading is only required on legacy distributions.
VMware Memory Hotplug Debian: Same Behavior as Ubuntu, Same Fixes
🐧 Debian's Default Hotplug Behavior
Debian shares Ubuntu’s default behavior: the kernel accepts ACPI memory hotplug events but leaves new memory blocks in an offline state. Running free -m after a vSphere hot‑add shows no change in total memory until blocks are onlined.
- The same fixes apply as in Ubuntu.
- Both the
memhp_default_state=onlinekernel parameter and udev rule approaches work identically on Debian stable releases (Bookworm, Bullseye).
🛠️ Step‑by‑Step: Online Hotplugged Memory in Debian
- 1. After hot‑adding memory in vSphere, check for offline blocks:
grep -i offline /sys/devices/system/memory/*/state- 2. Online all offline blocks with a single loop:
for mem in /sys/devices/system/memory/*/state; do
[ "$(cat $mem)" = "offline" ] && echo online > "$mem"
done- 3. Verify memory is now registered:
free -m✅ The MemTotal line should reflect the added RAM.
- 4. For persistent auto‑onlining, apply the same GRUB or udev approaches documented in the Ubuntu section.
- Commands and file paths are identical across Debian‑family distributions.
📌 Key takeaway → Debian behaves exactly like Ubuntu for VMware memory hotplug: blocks remain offline until manually onlined or configured for auto‑online.
SLES: Loading Required Modules for Memory Hotplug
🧩 SLES‑Specific Module Requirements
SUSE Linux Enterprise Server (SLES) requires two kernel modules to be loaded before memory hotplug events are processed (per Broadcom KB 309841). Without them, ESXi delivers the ACPI event but the guest kernel ignores it.
Step‑by‑Step:
- 1. 📦 Load the ACPI hotplug module:
sudo modprobe acpiphp- 2. 📦 Load the ACPI memory hotplug module:
sudo modprobe acpi_memhotplug- 3. ⚙️ In the vSphere Client, increase the VM’s memory allocation while the VM is running.
- 4. 🔍 Check for offline memory blocks:
grep -i offline /sys/devices/system/memory/*/state- 5. ➕ Online any offline blocks:
echo online > /sys/devices/system/memory/memory[number]/state- 6. ✅ Verify memory is registered:
free -mAuto‑load at boot: To ensure these modules are always available, add both to /etc/modules-load.d/acpi-hotplug.conf:
acpiphp
acpi_memhotplug📌 Key takeaway → Unlike Ubuntu, Debian, or RHEL‑based systems, SLES requires explicit module loading for hotplug to function. Once configured, memory hotplug works seamlessly in VMware environments.
VMware Hotplug Memory Linux: Distro Behavior Comparison
| Distribution | Auto-Online Memory? | Auto-Online CPU? | Manual Fix Required? | Notes |
|---|---|---|---|---|
| RHEL 8/9, Rocky, AlmaLinux | Yes — automatic | Yes — automatic | No | udev rules included by default |
| CentOS 7/8 | Yes (7+) | Yes (7+) | No for modern; manual for CentOS 6 | acpiphp module needed on CentOS 6 |
| CentOS 6 | No | No | Yes | Requires modprobe acpiphp |
| Ubuntu 20.04/22.04/24.04 | No | No | Yes | Use loop script or memhp_default_state=online |
| Debian 11/12 | No | No | Yes | Same approach as Ubuntu |
| SLES 12/15 | No | No | Yes | Requires acpiphp + acpi_memhotplug modules |
| FreeBSD | Not supported | Not supported | N/A — reboot required | No ACPI hotplug handler in FreeBSD |
| Windows Server 2016/2019/2022 | Yes — automatic | Yes — automatic | No | Hot-add supported natively |
Memory Hotplug Linux VMware: Troubleshooting Common Failures
🛑 Memory Added in vSphere but Not Visible in /sys/devices/system/memory/
- Cause → VMware Tools not installed or outdated. The guest OS is not receiving ACPI hotplug events from ESXi.
- Fix →
- Ubuntu/Debian:
sudo apt install open-vm-tools- CentOS/RHEL:
After installing VMware Tools, retry the hot‑add operation in vSphere.
⚙️ Hot‑Add Option Is Greyed Out in vSphere Edit Settings
- Cause → VM is powered on and hot‑add was not enabled before power‑on, or the virtual hardware version does not support hot‑add.
- Fix →
- Power off the VM.
- Check virtual hardware version (minimum version 7 required).
- Enable hot‑add while powered off, then power on again.
📉 Memory Appears Online in /sys but free -m Shows No Change
- Cause → Memory blocks were onlined but the kernel allocator has not refreshed. Rare on modern kernels but possible.
- Fix →
sudo sync && echo 3 > /proc/sys/vm/drop_cachesThen re‑run:
free -mIf the issue persists, the online operation may have silently failed. Re‑check block states:
grep -i offline /sys/devices/system/memory/*/state🚦 vNUMA Performance Degradation After Enabling Hot‑Add
- Cause → Hot‑add disables vNUMA. VMs spanning multiple physical NUMA nodes experience degraded memory bandwidth when topology is hidden from the guest OS.
- Fix →
- Do not enable hot‑add on VMs with >8 vCPUs spanning multiple NUMA nodes.
- Provision adequate resources at initial deployment.
- Use planned maintenance windows for resource changes instead of hot‑add.
📌 Key takeaway → Most hotplug failures stem from missing VMware Tools, unsupported hardware versions, allocator refresh issues, or vNUMA trade‑offs. Systematic checks of /sys, free -m, and vSphere settings resolve the majority of problems.
VM File Recovery When Hot‑Add Operations Go Wrong
⚠️ How Hot‑Add Can Affect VMFS Datastores and VMDK Integrity
Memory hot‑add operations are generally safe — they do not modify VM disk files. However, edge cases can introduce storage risk:
- A VM running I/O‑intensive workloads during a hot‑add may experience a brief I/O pause as ESXi reconfigures virtual hardware.
- If the ESXi host encounters a storage path issue at that same moment, VMFS metadata may be written inconsistently.
- More commonly, administrators editing the VMX file directly to add
mem.hotadd = "TRUE"while the VM is running (instead of powered off) risk VMX corruption if the save operation is interrupted. - A corrupted VMX file removes the VM from vSphere inventory. The VMDK data remains intact, but the VM cannot be registered or started until the VMX is repaired or recovered.
🛠️ Recovering VM Data with DiskInternals VMFS Recovery™
DiskInternals VMFS Recovery™ is purpose‑built to recover data from:
- Corrupted or inaccessible VMFS datastores
- Deleted or damaged VMDK files
- Failed VMware VM environments across ESXi, vSphere, and Workstation
Recovery scenarios:
- VMX corruption → Recovers deleted or corrupted VMX files from VMFS volumes, allowing the VM to be re‑registered and started without data loss.
- VMFS datastore damage → Reconstructs VMFS volume metadata and mounts VMDK files without requiring a running ESXi host.
Workflow:
- 1. Connect to the affected VMFS volume.
- 2. Run a full scan.
- 3. Locate VMX and VMDK files in the recovery browser. Repair VMware VMDK.
- 4. Preview file integrity (read‑only).
- 5. Extract to a safe destination for re‑registration or conversion.
Ready to get your data back?
To start VMware data recovery (recovering your data, documents, databases, images, videos, and other files), press the FREE DOWNLOAD button below to get the latest version of DiskInternals VMFS Recovery® and begin the step-by-step recovery process. You can preview all recovered files absolutely for FREE. To check the current prices, please press the Get Prices button. If you need any assistance, please feel free to contact Technical Support. The team is here to help you recover deleted VMware virtual machine!
FAQ
Does Ubuntu automatically online hot-added memory in VMware?
No. Ubuntu leaves hotplugged memory blocks in an offline state by default. Bring them online manually using the loop script, or configure persistent auto-onlining with the memhp_default_state=online kernel parameter or a udev rule.Does CentOS automatically online hot-added memory in VMware?
CentOS 7 and above (including RHEL 8/9, Rocky Linux, AlmaLinux) auto-online hotplugged memory via default udev rules. CentOS 6 requires manual onlining and the acpiphp module.Can I hot-remove memory from a Linux VM in VMware?
No. VMware hot-add is one-directional — resources can be added but not removed from a running VM. Reducing RAM or vCPUs requires a VM power cycle.Do I need to reboot after memory hot-add in Ubuntu?
Not if you manually online the memory blocks using the /sys/devices/system/memory/*/state interface. After running the onlining commands, free -m shows the updated total without a reboot.Why does enabling hot-add disable vNUMA?
VMware disables vNUMA when hot-add is enabled because the NUMA topology must be fixed at VM power-on for the guest OS to use it correctly. Dynamic resource addition is incompatible with the static NUMA topology configuration.What is the difference between hot-add and hot-plug in VMware?
VMware uses "hot-add" for CPU and memory (adding resources to a running VM) and "hot-plug" for devices like network adapters and disk controllers. The terms are sometimes used interchangeably but refer to different hardware categories.
