NSX|P: verify segment realization before creating MP md proxy

Change-Id: Ie85be9ece59394a55cde48c4d3a9c9d1e6191924
This commit is contained in:
asarfaty 2019-11-21 10:16:38 +02:00 committed by Adit Sarfaty
parent 5e7f8dad6d
commit bb41520880
1 changed files with 10 additions and 3 deletions

View File

@ -765,10 +765,17 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
# MD Proxy is currently supported by the passthrough api only
if (is_backend_network and not az.use_policy_md and
cfg.CONF.nsx_p.allow_passthrough):
# The new segment was not realized yet. Waiting for a bit.
time.sleep(cfg.CONF.nsx_p.realization_wait_sec)
nsx_net_id = self._get_network_nsx_id(context, net_id)
if not nsx_net_id:
msg = ("Unable to obtain backend network id for metadata "
"proxy creation for network %s" % net_id)
LOG.error(msg)
raise nsx_exc.NsxPluginException(err_msg=msg)
try:
# The new segment was not realized yet. Waiting for a bit.
time.sleep(cfg.CONF.nsx_p.realization_wait_sec)
nsx_net_id = self._get_network_nsx_id(context, net_id)
self._create_net_mp_mdproxy_port(
context, created_net, az, nsx_net_id)
except Exception as e: