From 4be367da5d7a5cc343df5a73c0a26cecc0b33d7e Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Wed, 17 Aug 2016 22:57:12 -0700 Subject: [PATCH] NSX|V: ensure that metadata works with 'internal' ipam Commit 625de54de3936b0da8760c3da76d2d315d05f94e changed the default behaviors of IPAM in neutron. This caused the metadata service initialization to hang. Change-Id: Ia3ff8ca9db6bcb971caa90c87edad6430c233e5e --- vmware_nsx/plugins/nsx_v/plugin.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index cab2b5b4c9..66332f450b 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -224,15 +224,6 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, callbacks_resources.QOS_POLICY) self._start_rpc_listeners() - has_metadata_cfg = ( - cfg.CONF.nsxv.nova_metadata_ips - and cfg.CONF.nsxv.mgt_net_moid - and cfg.CONF.nsxv.mgt_net_proxy_ips - and cfg.CONF.nsxv.mgt_net_proxy_netmask) - if has_metadata_cfg: - self.metadata_proxy_handler = ( - nsx_v_md_proxy.NsxVMetadataProxyHandler(self)) - # Service insertion driver register self._si_handler = fc_utils.NsxvServiceInsertionHandler(self) registry.subscribe(self.add_vms_to_service_insertion, @@ -243,6 +234,15 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, self.supported_extension_aliases.append("provider-security-group") def init_complete(self, resource, event, trigger, **kwargs): + has_metadata_cfg = ( + cfg.CONF.nsxv.nova_metadata_ips + and cfg.CONF.nsxv.mgt_net_moid + and cfg.CONF.nsxv.mgt_net_proxy_ips + and cfg.CONF.nsxv.mgt_net_proxy_netmask) + if has_metadata_cfg: + self.metadata_proxy_handler = ( + nsx_v_md_proxy.NsxVMetadataProxyHandler(self)) + self.init_is_complete = True def add_vms_to_service_insertion(self, sg_id):