OpenStack provides a feature called scheduler hints that allow a user to inform the scheduler where they desire their instance to run.
Policies available to use:
- Affinity (same host using server groups)
- Anti-affinity (different hosts using server groups)
- DifferentHost (using instance UUIDs)
- SameHost (using instance UUIDs)
Code Block |
---|
openstack server create --image IMAGE_ID --flavor 1 --hint group=SERVER_GROUP_UUID server-1 openstack server create --image IMAGE_ID \ --flavor 1 --hint different_host=INSTANCE_ID_1 \ --hint different_host=INSTANCE_ID_2 MY_THIRD_INSTANCE |
More documentation on how to use these filters is available upstream at: https://docs.openstack.org/ocata/config-reference/compute/schedulers.html#servergroupaffinityfilter