From ce99ca0fad41e47dbc359e7d820524f6b3503807 Mon Sep 17 00:00:00 2001 From: asarfaty Date: Sun, 4 Oct 2020 10:11:56 +0200 Subject: [PATCH] V2T migration: do not create SG on NSX during api-replay Change-Id: Id9aa2363169fa46ceeeaa5f2d069d647ae673144 --- vmware_nsx/plugins/nsx_p/plugin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index cbed4255ab..d6ff422189 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -3844,6 +3844,10 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): if cfg.CONF.api_replay_mode: self._handle_api_replay_default_sg(context, secgroup_db) + if cfg.CONF.api_replay_mode: + # Do not create backend resources for SG with api_replay + return secgroup_db + try: # create all the rule entries sg_rules = secgroup_db['security_group_rules'] @@ -3965,6 +3969,10 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): self._process_security_group_rule_properties( context, rules_db[i], r['security_group_rule']) + if cfg.CONF.api_replay_mode: + # Do not create backend resources for SG with api_replay + return rules_db + is_provider_sg = sg.get(provider_sg.PROVIDER) secgroup_logging = self._is_security_group_logged(context, sg_id) category = (NSX_P_PROVIDER_SECTION_CATEGORY if is_provider_sg