How VMM determines whether a host is over-committed
- Find out the HAVM with the largest RAM. Let’s call this slot size.
- Calculate number of “used slots” on each host. For this:
- First sort all VMs on the host in ascending order of VM memory size
- Then follow the sorted order and start fitting as many VMs as possible in slots
- Number of non-empty slots are the “used slots”
- Calculate number of “free slots” on each host. For this:
- Get available memory on the host, subtract host memory reserves, subtract inactive VMs and divide by the largest RAM VM size.
AvailableMemory – HostMemoryReserve – StoppedVMMemory – SavedVMMemory) / SlotSize = X Slots remaining
60GB(available memory) – 4GB (Reserve) – 40GB (Stopped/Saved VMs Memory) = 16GB/4GB(largest VM RAM size) = 4 slots remaining
- Let’s say R is cluster reserve. Find out R largest hosts by sum of “used slots” and “free slots”.
As long as the number of “free slots” in the entire cluster (summation of # obtained in step 3) is greater than sum of slots in R largest hosts (both free and used), the cluster is not over committed.