VMWare ESXi/VSphere Disable Balloon Segfault in Services Solution

After looking at several deployments of VMWare, we had one deployment where the company enabled balloon mode which is essentially a way to overcommit memory the hostnode(s) don't have.  Let's say you have put your database into memory or use a cached service in Apache or haproxy/nginx. VMWare will start taking some portions of these and at some point it corrupts things and the application running will either crash, malfunction or segfault.

Another factor is that OOM will be triggered artificially.  Take say a 16G VM that runs on a VMWare ESXi/Vsphere with the EXACT same OS image/kernel, and running the same container.  At some point the one with balloon will probably hit OOM and you may never be able to reproduce it on a non-Balloon VM/host.

Balloon is horrible because it feels like the old days of computing with a slow HDD where you have too little RAM and your computer is swapping.

It sounds similar to KSM in KVM but KSM is smart enough to only work with shared pages of duplicated memory.  Eg. if you had 200 VMs or containers using duplicated memory (eg. using a certain binary) it will combine those into one memory space to conveniently save memory duplication.

Is my VM even using balloon?

vmware-toolbox-cmd stat balloon
0 MB

 

You are looking for the number to be 0 but note it doesn't mean it won't start ballooning later on.  This is more likely when you have processes that use more memory 1-2G+.  Another symptom is that you will likely find the process that is getting ballooned will be slow (eg. even a docker ps or kubectl will be slower than normal).

How to disable balloon in the VM

#Temporarily and instantly disable balloon:

modprobe -r vmw_balloon

# disable for next boot
echo "blacklist vmw_balloon" | tee /etc/modprobe.d/disable-balloon.conf


#update iniitramfs so it will be disabled after reboot

update-initramfs -u
 

 


Tags:

Latest Articles

  • PHP2Shell Patching, Migration and Vulnerability Guide With Solutions
  • Firefox PDF Does Not Display - Shows Desktop Or Other App Instead Solution
  • How To Convert HTML to Text Based PDF
  • How To Emulate Android in Linux
  • How to use KVM and GUI inside Docker
  • python spacey ERROR: No matching distribution found for thinc<8.4.0,>=8.3.12
  • Debian 11 security repo fixes due to EOL
  • MySQL vs MariaDB how to create a socket user tutorial
  • Ubuntu Linux Mint Desktop Dark Black Cannot See Solution
  • How to combine .txt ACLs without breaking things
  • How to ping all of Googlebot's IPs script
  • 'virtio0' uses a qcow2 feature which is not supported by this qemu version: QCOW version 3
  • Linux bash script to get the IP of a list of hostnames
  • How To Use Camera Webcam in Docker for OBS Studio etc...
  • Computer Server Won't Post Boot Or Enter BIOS Setup After Installing RAID SAS or GPU Card etc..
  • How To Test PHP Scripts from CLI with GET variables/query string
  • apt-cache how to see all available versions of a package in Debian Ubuntu Mint
  • Virtualbox VBox Guest-utils drag and drop files stops working with Windows VMs
  • How To Remove Ubuntu Netplan and Go Back to /etc/network/interfaces
  • How To Force Flash an AMD Instinct GPU To Another Model Using Debian Ubuntu Mint Linux