From ab980ce5d6792a273db3e93eb3d163bfdc38b1de Mon Sep 17 00:00:00 2001
From: Matt Riedemann <mriedem.os@gmail.com>
Date: Tue, 1 Aug 2017 16:38:42 -0400
Subject: [PATCH] Disable track_instance_changes when in superconductor mode

When configured for superconductor mode, which is the default,
nova-compute can't reach the MQ for nova-scheduler so there is
no point in even enabling the track_instance_changes code since
it's a waste of time as the scheduler will never get the message.

Change-Id: I2662ebd47323428b403d3c2236bec78f1fb1050f
---
 lib/nova | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/nova b/lib/nova
index 8311a54930..7266ac70e9 100644
--- a/lib/nova
+++ b/lib/nova
@@ -440,6 +440,9 @@ function create_nova_conf {
             local db="nova_cell1"
         else
             local db="nova_cell0"
+            # When in superconductor mode, nova-compute can't send instance
+            # info updates to the scheduler, so just disable it.
+            iniset $NOVA_CONF filter_scheduler track_instance_changes False
         fi
 
         iniset $NOVA_CONF database connection `database_connection_url $db`
@@ -843,6 +846,9 @@ function start_nova_compute {
         cp $compute_cell_conf $NOVA_CPU_CONF
         # FIXME(danms): Should this be configurable?
         iniset $NOVA_CPU_CONF workarounds disable_group_policy_check_upcall True
+        # Since the nova-compute service cannot reach nova-scheduler over
+        # RPC, we also disable track_instance_changes.
+        iniset $NOVA_CPU_CONF filter_scheduler track_instance_changes False
         iniset_rpc_backend nova $NOVA_CPU_CONF DEFAULT "nova_cell${NOVA_CPU_CELL}"
     fi