Enable the VMware balloon driver vmmemctl to prevent swapping in an imported Linux VM
Mon-2012-02-27 3 Comments
After running Alan Renouf’s excellent vCheck5 script against a vCenter Server, I noticed alot of VM’s where ESXi was actively swapping memory without any memory being ballooned
This, ofcourse, required further investigation.
I checked one of the ESXi hosts that was serving the VM’s using resxtop on our vMA and found that the balloon driver was not active:
I found the possible reasons for a non-working balloon driver on page 34 of the Resource Management guide (ESXI 4.1 U2 is in use):
ESX/ESXi hosts use swapping to forcibly reclaim memory from a virtual machine when the vmmemctl driver is not available or is not responsive.
– It was never installed.
– It is explicitly disabled.
– It is not running (for example, while the guest operating system is booting).
– It is temporarily unable to reclaim memory quickly enough to satisfy current system demands.
– It is functioning properly, but maximum balloon size is reached.
The balloon driver cannot be disabled on host level and the VM’s didn’t have their sched.mem.maxmemctl parameter set to 0. The VMware Tools were installed. This eliminated options 1 & 2. It was now time to look into the VM.
After cloning a test VM and disconnecting it’s virtual cable, it was time to boot. After logging in I ran the
command to show the version. It was running the latest version 8.3.12 build 559003, so that seemed OK. Next was running the config script
and I was promptly faced with the root cause of the problem because I received the following warning message
The module vmmemctl has already been installed on this system by another installer or package and will not be modified by this installer. Use the flag –clobber-kernel-modules=vmmemctl to override.
It seemed that almost every VM with this problem was an imported Oracle VM virtual machine. During it’s migration to the vSphere platform, the VMware Tools were installed, although now it seemed the installation was not correct/complete.
There were no obstacles to enable the correct VMware Tools vmmemctl driver, so running the suggested command
fixed the problem. After a reboot I checked if the balloon driver was working
All OK. Onto the next challenge. Did I mention I love my job? =]
EDIT: On some VM’s it seems the pvscsi, vmxnet3, vsock and vmci kernel modules were having the same problem. I choose to fix them too. The complete command would be