How Virtual Machine Manager determines whether a host is over-committed

How VMM determines whether a host is over-committed

  1. Find out the HAVM with the largest RAM. Let’s call this slot size.
  2. Calculate number of “used slots” on each host. For this:
  3. First sort all VMs on the host in ascending order of VM memory size
  4. Then follow the sorted order and start fitting as many VMs as possible in slots
  5. Number of non-empty slots are the “used slots”
  6. 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

  1. 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.