Merge "Unlock max_instances_per_host in controller config"
diff --git a/README.rst b/README.rst
index 291ae80..551cf88 100644
--- a/README.rst
+++ b/README.rst
@@ -1561,3 +1561,15 @@
          all: True
          verbose: True
          all_cells: True
+
+
+Configure filter schedulers
+---------------------------
+At this moment only max_instances_per_host for NumInstancesFilter is supported.
+
+.. code-block:: yaml
+
+    nova:
+      controller:
+        filter_scheduler:
+          max_instances_per_host: 50
diff --git a/nova/files/pike/nova-controller.conf.Debian b/nova/files/pike/nova-controller.conf.Debian
index 162e6e1..10c6f81 100644
--- a/nova/files/pike/nova-controller.conf.Debian
+++ b/nova/files/pike/nova-controller.conf.Debian
@@ -4778,7 +4778,7 @@
 #  (integer value)
 # Deprecated group/name - [DEFAULT]/max_instances_per_host
 #max_instances_per_host=50
-max_instances_per_host=50
+max_instances_per_host = {{ controller.get('filter_scheduler',{}).get('max_instances_per_host', 50) }}
 
 #
 # Enable querying of individual hosts for instance information.
diff --git a/nova/files/queens/nova-controller.conf.Debian b/nova/files/queens/nova-controller.conf.Debian
index 85a2183..db38aac 100644
--- a/nova/files/queens/nova-controller.conf.Debian
+++ b/nova/files/queens/nova-controller.conf.Debian
@@ -4737,7 +4737,7 @@
 #   scheduled on a host.
 #  (integer value)
 # Minimum value: 1
-max_instances_per_host = 50
+max_instances_per_host = {{ controller.get('filter_scheduler',{}).get('max_instances_per_host', 50) }}
 
 #
 # Enable querying of individual hosts for instance information.