Managing server groups
Server groups allow to specify placement policies for the VMs on hypervisors. Two use cases :
affinity : two VMs workloads are tightly coupled and you wish to keep the VMs running on the same hypervisor,
anti-affinity : N VMs implement a clustered service and you wish to those VMs on seperate hypervisors all the time.
Manage a server group
Create
% openstack server group create --policy anti-affinity mygroup
List
% openstack server group list [--long]
+------------+------------+---------------+-----------------------+------------+---------+
| ID | Name | Policies | Members | Project Id | User Id |
+------------+------------+---------------+-----------------------+------------+---------+
| 39ca7[...] | mygroup | anti-affinity | 1c11[...], 93a0c[...] | | |
| 56342[...] | un_autre | affinity | e747[...] | | |
+------------+------------+---------------+-----------------------+------------+---------+
Display
% openstack server group show mygroup
+----------+-------------------------------------------+
| Field | Value |
+----------+-------------------------------------------+
| id | 39ca7dca[...] |
| members | 1c11[...], 93a0c[...] |
| name | mygroup |
| policies | anti-affinity |
+----------+-------------------------------------------+
Set a specific group for an instance
% openstack server create --hint group=$GROUPID [...]
Attention
You can fix the server group only at instanciation time, not after.