Using Server Groups
The what, why, and how of Server Groups on OpenStack Flex
On the OpenStack platform, a Server Group is a way to tell the infrastructure how a set of VMs should be placed on the physical host servers.
Using affinity related policies you are essentially telling the system:
- "Keep these VMs apart."
- "Keep these VMs together."
OpenStack's scheduler uses then that information when deciding where to place each VM.
IMPORTANT: You cannot add an existing Virtual Machine (VM) to an Server Group if it wasn't assigned at the time of creation. Server group policies (like anti-affinity) are enforced by the OpenStack scheduler only during the initial VM boot process.
Affinity Policies
Below are the available Affinity Policies that can be set for Server Groups.
Affinity (mandatory): The instances in the affinity group are strictly allocated to the same physical machine. When there are no more physical machines to allocate, the allocation fails.
Anti-affinity (mandatory): The instances in the anti-affinity group are strictly allocated to different physical machines. When there are no more physical machines to allocate, the allocation fails.
Affinity (not mandatory): The instances in the affinity group are allocated to the same physical machine as much as possible, and when there are no more physical machines to allocate, the normal allocation strategy is returned.
Anti-affinity (not mandatory): The instances in the anti-affinity group are allocated to different physical machines as much as possible. When there are no more physical machines to allocate, the normal allocation strategy is returned.
Why Are They Useful?
The biggest benefit is controlling risk and performance. For example, if all three web servers are on the same physical host and that host fails - Everything goes down.
But if they're spread across different hosts then a single host failure only takes out one server, and the application can continue running.
The opposite can also be useful. Sometimes you want VMs that communicate constantly to be on the same physical host to reduce latency. That's what an affinity policy does.
How to Create a Server Group
1) Log in to the OpenStack Flex Skyline UI
2) On the left-hand pane, navigate to Compute > Server Groups
3) Click Create Server Group give your group a name and choose an Affinity policy.
4) You now create server instances directly from the Server Group page.
or
You can expand the 'Advanced Options' section on Step 3 of normal VM creation and choose the server group from the list there.