diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index 9b4d5d04cb..7954579ac8 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -742,6 +742,11 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): super(NsxPolicyPlugin, self).delete_network( context, net_id) + # this extra lookup is necessary to get the + # latest db model for the extension functions + net_model = self._get_network(context, net_id) + resource_extend.apply_funcs('networks', created_net, net_model) + # MD Proxy is currently supported by the passthrough api only if is_backend_network and cfg.CONF.nsx_p.allow_passthrough: try: @@ -754,11 +759,6 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): LOG.error("Failed to create mdproxy port for network %s: %s", net_id, e) - # this extra lookup is necessary to get the - # latest db model for the extension functions - net_model = self._get_network(context, net_id) - resource_extend.apply_funcs('networks', created_net, net_model) - # Update the QoS policy (will affect only future compute ports) qos_com_utils.set_qos_policy_on_new_net( context, net_data, created_net) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 84910a7c78..c9ac6385a3 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -988,6 +988,12 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base, {'network': {'vlan_transparent': vlt}}) rollback_network = True + + # this extra lookup is necessary to get the + # latest db model for the extension functions + net_model = self._get_network(context, created_net['id']) + resource_extend.apply_funcs('networks', created_net, net_model) + if is_backend_network: self._create_net_mdproxy_port( context, created_net, az, nsx_net_id) @@ -1008,11 +1014,6 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base, super(NsxV3Plugin, self).delete_network( context, created_net['id']) - # this extra lookup is necessary to get the - # latest db model for the extension functions - net_model = self._get_network(context, created_net['id']) - resource_extend.apply_funcs('networks', created_net, net_model) - # Update the QoS policy (will affect only future compute ports) qos_com_utils.set_qos_policy_on_new_net( context, net_data, created_net)