From dc308d59d8d540e6a63154d14c057151fd3a22ae Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Fri, 8 Oct 2021 13:50:08 -0700 Subject: [PATCH] [API replay] Avoid Octavia RPC errors During API replay we should not call get_active_loadbalancers or try and serve it, as the replay process will act both as a client and RPC server. Change-Id: I7cd620c2cca3ee8ac6e558f5aa7cb67a71e6b25b --- vmware_nsx/api_replay/client.py | 4 ++++ vmware_nsx/services/lbaas/octavia/octavia_listener.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/api_replay/client.py b/vmware_nsx/api_replay/client.py index d6c5154358..8428f64260 100644 --- a/vmware_nsx/api_replay/client.py +++ b/vmware_nsx/api_replay/client.py @@ -1272,6 +1272,10 @@ class ApiReplayClient(utils.PrepareObjectForMigration): # Do nothing pass + def get_active_loadbalancers(self, **kw): + # Do nothing + pass + endpoints = [MigrationOctaviaDriverEndpoint] access_policy = dispatcher.DefaultRPCAccessPolicy self.octavia_rpc_server = messaging.get_rpc_server( diff --git a/vmware_nsx/services/lbaas/octavia/octavia_listener.py b/vmware_nsx/services/lbaas/octavia/octavia_listener.py index cc83743bd8..3699a8152b 100644 --- a/vmware_nsx/services/lbaas/octavia/octavia_listener.py +++ b/vmware_nsx/services/lbaas/octavia/octavia_listener.py @@ -753,7 +753,7 @@ class NSXOctaviaStatisticsCollector(object): LOG.error("Octavia stats collect failed with %s", e) def collect(self): - if not self.core_plugin.octavia_listener: + if not self.core_plugin.octavia_listener or cfg.CONF.api_replay_mode: LOG.warning("Octavia stats collector cannot run with plugin %s", self.core_plugin) return