vmware-esxi – How to ‘Unballoon’ RAM Ballooned by VMware

memoryvmware-esxivmware-vsphere

Given the constrained RAM situation described in this question, what is the cleanest method (manual or programmatically) to:

  • Identify VMware virtual machines whose RAM has been reclaimed by the VMware balloon driver.
  • "Unballoon" the RAM.

Assume that more physical RAM is available to the environment.

I've found that I can vMotion a VM to another host, and that clears the ballooned state. Is there any other method that works?

Note: I've added several hosts and ~512GB of RAM to the environment. The ballooned VMs did not trigger a DRS rebalance action or unballoon themselves. I've had to manually vMotion each of the affected virtual machines to clear this, as shown below…


Here's the before…
enter image description here

And the after… Following a vMotion to another host in the cluster.
enter image description here

Best Answer

VMware actually has a KB article that has this information:

To force the balloon driver to release its hold on memory and prevent the guest operating system from using swap space, use one of these options:

  • Set the value of sched.mem.max to the allocated memory or greater.
  • Select the virtual machine's Resources > Memory > Limit > Unlimited box.
  • Migrate the virtual machine to another host.