Server groups can be used to control the affinity and anti-affinity scheduling policy for a group of servers.
An affinity policy for a server group denotes that all the virtual machine instances belonging to the server group would be hosted on a single hypervisor host.
You can configure a server group with an affinity policy and assign the server group to instances that host services that are closely tied together and frequently communicate with one another. When you have all such instances on the same hypervisor host, the communication between the instances is efficient.
An anti-affinity policy for a server group denotes that each virtual machine instance belonging to the server group would be hosted on a different hypervisor host.
You can assign a server group with an anti-affinity policy to virtual machine instances that run applications or services such as SQL server, and cannot afford to have a downtime. When the replicas of the such applications or services are placed on distinct hosts, the anti-affinity policy offers resiliency and the services suffer a negligible downtime.
An anti-affinity policy facilitates fault tolerance through redundancy, and helps in disaster recovery.
Refer to OpenStack Server Group API reference for information on OpenStack server group APIs.
Configuring affinity and anti-affinity server groups in Platform9 Clarity UI
When you add a server group, you can assign an affinity or anti-affinity policy to it.
Similarly, when you add an instance you can assign an affinity or anti-affinity server group to it.