You can place instances using OpenStack server groups with an affinity or anti-affinity policy. Affinity indicates that all instances in the group must placed on the same host, and anti-affinity indicates that no instances in the group can be placed on the same host.


Verify that the intended filter configuration does not conflict with any existing administrative configuration, such as DRS rules that manage instance placement on hosts.


  1. Log in to the OpenStack Management Server as viouser.
  2. Load the credentials file for your user account.
    source user-credentials.rc
  3. Create a server group with the desired policy.
    openstack server group create group-name --policy {affinity | anti-affinity}
    Option Description
    group-name Enter a name for the server group.
    --policy Enter affinity to place instances on the same host or anti-affinity to prevent instances from being placed on the same host.
  4. When you launch an instance, pass the server group as a scheduler hint to implement affinity or anti-affinity.
    openstack server create instance-name --image image-uuid --flavor flavor-name --nic net-id=network-uuid --hint group=servergroup-uuid

What to do next

Confirm that the affinity rules and instances are configured correctly. In vCenter Server, select the compute cluster, open the Configure tab, and click VM/Host Rules.