Patent ID: 8589921

Claim:
A method, comprising: determining, by a host controller machine, that a load balancing operation is triggered, the load balancing operation performed by the host controller machine; identifying, by the host controller machine, source host machines and virtual machines (VMs) hosted by the source host machines, the VMs comprising candidates for migration in the load balancing operation; for each of a subset of the VMs, adjusting, by the host controller machine, a selection score for the VM based on one or more metrics of the VM and of the source host hosting the VM, wherein the one or more metrics measure a shared resource between the VM and a target host machine that is a candidate to host the VM, wherein the subset of VMs comprises at least one of a predetermined number of the VMs or a predetermined percentage of the VMs in terms of selection scores of the VMs, and wherein the selection score is adjusted to be proportionally related to a level of sharing of the shared resource between the VM and the target host machine by: determining a number of the subset of VMs hosted by each target host machine comprising the shared resource; and increasing the selection score for the VM and the candidate source host machine hosting that VM with a highest amount of shared resource at the candidate target host machines; and selecting, by the host controller machine, a VM of the VMs comprising a highest selection score, wherein the selected VM is migrated as part of the load balancing operation.