# VM Affinity Anti-Affinity Rules

This document describes the method to create affinity and anti-affinity groups for your virtual machines.

Server groups are the mechanism to enable you to create groups of VMs with affinity or anti-affinity rules associated with them.

Server Groups are logical groups of virtual machines, so you can specify "Affinity" or "Anti-Affinity" policies while scheduling VMs. Server group membership impacts the placement of the VM on a host in your virtualized cluster in the following manner:

* An affinity policy for a server group specifies that all the virtual machines belonging to the server group should be provisioned on a single hypervisor.
* An anti-affinity policy for a server group specifies that each virtual machine in the server group should be hosted on a different hypervisor.

To create a Server Group, follow the steps below.

1. Navigate to **Virtual Machines** > **Server Groups** and click on the **Create Server Group** button.
2. Provide a descriptive name for the Server Group.
3. Select a policy: Affinity or Anti-Affinity.
4. Click the **Create Server Group** button.

You can now add a VM to this Server Group as part of the VM creation wizard.
