Hot Add CPU and RAM on VMware vSphere: Upgrade Virtual Machine Resources Without Rebooting

VMware tutorial - IT technology blog
VMware tutorial - IT technology blog

The Real-World Problem: A Production VM Needs More RAM but Can’t Be Shut Down

This situation comes up more often than you’d think: a VM running a production database, queries getting slower by the day due to insufficient RAM. The DBA urgently requests an upgrade from 8GB to 16GB. But shut the VM down to change the config? Not an option — maintenance windows require two weeks’ notice, and this needs to be resolved today.

I ran into exactly this situation while managing an ESXi 7.0 cluster for a project. The VM running PostgreSQL urgently needed more RAM, but nobody had enabled Hot Add from the start. The result: we had to wait until next week’s maintenance window while the application kept running slowly. After that incident, every VM template had Hot Add enabled before deployment.

This is where VMware vSphere’s Hot Add CPU and Hot Add Memory features shine. If enabled beforehand, you can add CPU cores and RAM to a running VM without a reboot — the guest OS picks up the new resources immediately.

Why Hot Add Doesn’t Work Even Though vSphere Supports It

Many people assume Hot Add is an automatic, always-available feature. In reality, three conditions must all be met simultaneously:

  • Appropriate license: ESXi Standard only supports Hot Add Memory. Hot Add CPU requires Enterprise Plus
  • Must be enabled while the VM is powered off: This option cannot be enabled while the VM is powered on — this is the most common trap
  • Guest OS must support it: Linux kernel 2.6.25+ and Windows Server 2008+ are both fine, but some older distros require manually loading a module

The biggest trap: this option must be enabled while the VM is completely powered off. If the VM is running, all the options are grayed out — you have to power it down, enable the feature, then power it back on. This is exactly why the best practice is to configure it from the start when creating the VM or from the template.

Ways to Enable Hot Add

Method 1: Via vSphere Client (GUI)

Best suited for configuring individual VMs manually:

  1. Power off the VM
  2. Right-click the VM → Edit Settings
  3. Select the VM Options tab → expand the Advanced section
  4. Find the Memory section → check Enable Hot Plug
  5. Go back to the Virtual Hardware tab → click CPU
  6. Check Enable CPU Hot Add
  7. Click OK → power the VM back on

Once the VM has booted, you can go into Edit Settings while the VM is running and increase the number of CPU cores or RAM — no reboot required.

Method 2: Via PowerCLI (Bulk Processing)

If you need to enable it for multiple VMs at once, PowerCLI is a much more efficient choice. Connect to vCenter first:

# Connect to vCenter
Connect-VIServer -Server vcenter.lab.local -User [email protected] -Password "P@ssw0rd"

# Enable Hot Add for a specific VM (VM must be powered off)
$vm = Get-VM -Name "db-postgres-01"

$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.memoryHotAddEnabled = $true
$spec.cpuHotAddEnabled = $true
$vm.ExtensionData.ReconfigVM($spec)

Write-Host "Hot Add enabled for: $($vm.Name)"

Enable in bulk by VM name pattern:

# Only process powered-off VMs — safe for bulk runs
Get-VM -Name "db-*" | Where-Object {$_.PowerState -eq "PoweredOff"} | ForEach-Object {
    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
    $spec.memoryHotAddEnabled = $true
    $spec.cpuHotAddEnabled = $true
    $_.ExtensionData.ReconfigVM($spec)
    Write-Host "Hot Add enabled for: $($_.Name)"
}

Method 3: Edit the .vmx File Directly on the ESXi Host

Use this when you need low-level access or don’t have vSphere Client permissions. SSH into the ESXi host:

# Get the VMID
vim-cmd vmsvc/getallvms | grep "db-postgres-01"

# Power off the VM (replace 42 with the actual VMID)
vim-cmd vmsvc/power.off 42

# Find and edit the .vmx file
find /vmfs/volumes/ -name "db-postgres-01.vmx"
vi /vmfs/volumes/datastore1/db-postgres-01/db-postgres-01.vmx

Add the following two lines to the .vmx file:

mem.hotadd = "TRUE"
vcpu.hotadd = "TRUE"
# Reload the configuration and power the VM back on
vim-cmd vmsvc/reload 42
vim-cmd vmsvc/power.on 42

The Best Approach: Enable Hot Add in Your VM Template

After forgetting to enable it on new VMs a few times, the real solution is to enable Hot Add in the template — every VM cloned from it has it pre-configured, with nothing to remember.

# Convert template to VM for editing
$template = Get-Template -Name "ubuntu-22.04-base"
Set-Template -Template $template -ToVM

$vm = Get-VM -Name "ubuntu-22.04-base"

# Enable Hot Add
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.memoryHotAddEnabled = $true
$spec.cpuHotAddEnabled = $true
$vm.ExtensionData.ReconfigVM($spec)

# Convert back to template
Set-VM -VM $vm -ToTemplate -Confirm:$false
Write-Host "Template updated with Hot Add enabled"

From this point on, every VM deployed from this template automatically has Hot Add enabled — the deployment pipeline requires no additional manual configuration steps.

Verifying the Guest OS Picks Up the New Resources

After increasing CPU/RAM through vSphere while the VM is running, confirm the guest OS has received the changes:

On Linux:

# Check current RAM
free -h

# dmesg logs events when hot-add succeeds
dmesg | grep -i "memory\|acpi\|hot"

# Check CPU count
nproc
lscpu | grep "^CPU(s):"

Some older Linux kernels require loading the acpiphp module to pick up CPU hot-add:

# Load the module immediately
modprobe acpiphp

# Auto-load on boot
echo "acpiphp" >> /etc/modules

On Windows Server, open Task Manager → Performance — RAM and CPU update immediately without a reboot.

Things to Know Before Enabling It at Scale

When migrating from VMware to Proxmox for a personal lab, I noticed that Proxmox handles hot-plug very differently — no pre-configuration needed, you can modify resources whether the VM is on or off. That surprised me, since I was used to vSphere’s “must power off first” workflow. Each platform has its own design philosophy, and understanding these differences helps you avoid a lot of unnecessary incidents.

Back in vSphere, there are a few things to keep in mind when enabling Hot Add:

  • Hot Add CPU increases NUMA overhead: When adding CPUs beyond the physical NUMA node boundary, performance can degrade. Consider this carefully for latency-sensitive VMs like databases
  • Memory Hot Add cannot be Hot Removed: You can add RAM, but reducing it still requires a reboot. This is an OS limitation, not a VMware limitation
  • VM Hardware Version must be 7 or higher: VMs created with ESX 3.x or earlier need a hardware version upgrade before Hot Add can be enabled
  • Monitor NUMA after adding CPUs: Use esxtop (press m to view memory stats) to check for NUMA imbalance after hot-adding CPUs
# Check Hot Add status for all VMs in the cluster via PowerCLI
Get-VM | Select-Object Name,
    @{N="MemHotAdd";E={$_.ExtensionData.Config.MemoryHotAddEnabled}},
    @{N="CPUHotAdd";E={$_.ExtensionData.Config.CpuHotAddEnabled}},
    @{N="PowerState";E={$_.PowerState}} | Format-Table -AutoSize

The script above produces a cluster-wide overview table — quickly identifying any VMs that don’t have Hot Add enabled before an incident strikes.

Wrapping Up

Hot Add CPU/RAM is an extremely practical feature in production environments where downtime is kept to an absolute minimum. Enabling it in your templates from the start is the approach that requires no memorization and leaves nothing to forget. Combined with PowerCLI for auditing and bulk updates, ensuring every VM in the cluster is Hot Add-ready takes only a few minutes.

If you’re managing a vSphere environment without a Hot Add policy in place, now is a good time to establish one — before you urgently need it and don’t have it.

Share: