From 4533958da24025432987a41dba23b664c105f4a8 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Wed, 7 Apr 2021 00:52:48 -0700 Subject: [PATCH] [nsx_v3] Register security group resources at startup This will avoid an error from the quota manager while trying to create security group rules for the default security group. Change-Id: I85a46931a96f90a084af10e85f9155c8ed850195 --- vmware_nsx/plugins/nsx_v3/plugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index a5c961056c..603eae0a3b 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -172,6 +172,11 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base, router=l3_db_models.Router, floatingip=l3_db_models.FloatingIP) def __init__(self): + # Register these resources before the relevant extensiosn are loaded + # to prevent failures due to QuotaResourceUnknown error while creating + # default security group + resource_registry.register_resource_by_name('security_group') + resource_registry.register_resource_by_name('security_group_rule') self.fwaas_callbacks = None self._is_sub_plugin = tvd_utils.is_tvd_core_plugin() self.init_is_complete = False