Server Groups
Server Groups¶
In order to build redundant applications it is a common practice to create clusters of instances that perform the same task with a load balancer in front of them. As long as their is at least one instance running that can serve the incoming calls, the application will still function. When building such clusters in a cloud platform where the instances are virtual machines running on underlaying hardware it is very important that the instances that forms the cluster does not run on the same hardware. If that would be the case, the administrator of the application could run the instances under the false pretence that the instances where running redundantly without knowing about the single point of failure being the hardware below serving all the instances through virtualisation.
To count this Server Groups can be used to tell the Openstack scheduler to spread out a number of instances on different underlaying hardware. In order to use Server Groups the user first must create a Server Group with the correct affinity policy. There are four available affinity policys in Openstack:
| Affinity | The scheduler will run the instance on the same hardware as the other instances in the Server Group. If that is not possible the addition of the instance to the Server Group will fail with an error. |
| Soft Affinity | The scheduler will try to run the instance on the same hardware as the other instances in the Server Group. If that is not possible the addition of the instance to the Server Group will silently run the instance on another hardware. |
| Soft Anti-affinity | The scheduler will try to run the instance on different hardware as the other instances in the Server Group. If that is not possible the addition of the instance to the Server Group will silently run the instance on the same hardware as another instance in the Server Group. |
| Anti affinity | The scheduler will run the instance on different hardware as the other instances in the Server Group. If that is not possible the addition of the instance to the Server Group will fail with an error. |
As can be seen in the table, the most common use for Server Groups are the ones with anti-affinity rules in them since they aim to spread out the instances on different hardware.
Create Server Groups¶
-
To create a Server Group the user goes to Compute→Server Groups.
-
The user creates a new server group by pressing the "Create Server Group" button on the top right. The user is then presented with the following dialoge:

-
The user gives the Server Group a Name, and chooses the Policy, in this case "Anti Affinity". The user the presses "Submit".
- The user now goes on and creates the instances and under the "Server Group" tab, makes sure to pick the Server Group just created:
This will force all the instances created to be run on different hardware in the platform, thus creating true redundancy.