Browse code

Explicitly set scheduler_available_filters

Tempest's scheduler_available_filters has a special 'all' value that
is understood to mean 'all filters are enabled' by various tempest
tests. However, what it really means is 'the default nova filters are
enabled.' In an effort to help clean that up, this patch explicitly
sets scheduler_available_filters to nova's $FILTERS. Because $FILTERS
is now used in both lib/nova and lib/tempest, it is renamed
$NOVA_FILTERS.

Change-Id: I6ffc1e9989cd61d666f9c1db9c94fbabd7151918
Related-bug: 1628443

Artom Lifshitz authored on 2018/05/23 23:08:56
Showing 2 changed files
... ...
@@ -103,9 +103,9 @@ FORCE_CONFIG_DRIVE=${FORCE_CONFIG_DRIVE:-"False"}
103 103
 # should work in most cases.
104 104
 SCHEDULER=${SCHEDULER:-filter_scheduler}
105 105
 
106
-# The following FILTERS contains SameHostFilter and DifferentHostFilter with
106
+# The following NOVA_FILTERS contains SameHostFilter and DifferentHostFilter with
107 107
 # the default filters.
108
-FILTERS="RetryFilter,AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,SameHostFilter,DifferentHostFilter"
108
+NOVA_FILTERS="RetryFilter,AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,SameHostFilter,DifferentHostFilter"
109 109
 
110 110
 QEMU_CONF=/etc/libvirt/qemu.conf
111 111
 
... ...
@@ -423,7 +423,7 @@ function create_nova_conf {
423 423
     iniset $NOVA_CONF wsgi api_paste_config "$NOVA_API_PASTE_INI"
424 424
     iniset $NOVA_CONF DEFAULT rootwrap_config "$NOVA_CONF_DIR/rootwrap.conf"
425 425
     iniset $NOVA_CONF scheduler driver "$SCHEDULER"
426
-    iniset $NOVA_CONF filter_scheduler enabled_filters "$FILTERS"
426
+    iniset $NOVA_CONF filter_scheduler enabled_filters "$NOVA_FILTERS"
427 427
     if [[ $SCHEDULER == "filter_scheduler" ]]; then
428 428
         iniset $NOVA_CONF scheduler workers "$API_WORKERS"
429 429
     fi
... ...
@@ -372,6 +372,11 @@ function configure_tempest {
372 372
     iniset $TEMPEST_CONFIG compute-feature-enabled block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
373 373
     iniset $TEMPEST_CONFIG compute-feature-enabled live_migrate_back_and_forth ${LIVE_MIGRATE_BACK_AND_FORTH:-False}
374 374
     iniset $TEMPEST_CONFIG compute-feature-enabled attach_encrypted_volume ${ATTACH_ENCRYPTED_VOLUME_AVAILABLE:-True}
375
+
376
+    if [[ -n "$NOVA_FILTERS" ]]; then
377
+        iniset $TEMPEST_CONFIG compute-feature-enabled scheduler_enabled_filters ${NOVA_FILTERS}
378
+    fi
379
+
375 380
     if is_service_enabled n-cell; then
376 381
         # Cells doesn't support shelving/unshelving
377 382
         iniset $TEMPEST_CONFIG compute-feature-enabled shelve False