Using VM affinity and anti-affinity rules
When virtual machines are powered on in a DRS cluster, vCenter determines where the virtual machines should be placed in order to balance resource usage across the cluster. The DRS scheduler runs periodically to migrate virtual machines using vMotion in order to maintain a balance of resource usage across the cluster. Affinity or anti-affinity rules can be used to control where VMs are placed within a cluster. Affinity rules keep VMs on the same physical host, reducing the load on the physical network by keeping traffic between them from leaving the host. Anti-affinity rules keep VMs separated on different physical hosts, ensuring higher availability.
One case of an affinity rule would be to keep all of the virtual machines supporting an application on the same host. This would ensure that network communications between the virtual machines supporting the application do not traverse the physical network.
An example use case of an anti-affinity rule...