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