Openstack - ServerGroupAffinityFilter



we need to use the Openstack-Feature ‘ServerGroupAffinityFilter’.
We have, for instance, a DB-Cluster with three node and need to ensure, that all nodes are running on different hosts.

To take advantage of this filter, you must create a server group with an anti-affinity policy in openstack, and pass a scheduler hint, using group as the key and the server group UUID as the value. Using the nova command-line tool, you need to use the --hint flag. For example:

 $ nova server-group-create --policy anti-affinity group-1
 $ nova boot --image IMAGE_ID --flavor 1 --hint group=SERVER_GROUP_UUID server-1

How can this be achieved with Cloudforms? We are using the standard automate code to instantiate new VMs in Openstack. I don’t see any option to pass key/values as hints while provisioning.

Thanks and kind regards,


I fixed this now by adding the following Line to ‘app/models/manageiq/providers/openstack/cloud_manager/provision/cloning.rb’:

@@ -20,6 +20,7 @@
     clone_options[:nics]              = configure_network_adapters unless configure_network_adapters.blank?

     clone_options[:block_device_mapping_v2] = configure_volumes unless configure_volumes.blank?
+    clone_options[:os_scheduler_hints]  = options[:os_scheduler_hints] unless options[:os_scheduler_hints].nil?


And set a dictionary ‘{“group” => “foobar”}’ as ‘os_scheduler_hints’-Option in the automate code.

I would prefer a builtin solution, anyway…