From d61ebbaadb79b1355aa055bf1df3c31835377dd5 Mon Sep 17 00:00:00 2001 From: asarfaty Date: Mon, 5 Oct 2020 08:57:53 +0200 Subject: [PATCH] NSX|P: Set port attachement even without device owner Thi may solve the case that when VM is boothed, an auto-generated MP logical port is created with the same vif-id, before neutron sets it on its port. Change-Id: I42593ab6fc3ea9d0849231c83795c9297674d419 --- vmware_nsx/plugins/nsx_p/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index d6ff422189..87e76b9274 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -1701,7 +1701,9 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): context, port_data) device_owner = port_data.get('device_owner') vif_id = None - if device_owner and device_owner != l3_db.DEVICE_OWNER_ROUTER_INTF: + if not device_owner or device_owner != l3_db.DEVICE_OWNER_ROUTER_INTF: + # Set vif_id even if no device owner so that auto-generated + # MP ports won't be created for VMs before neutron sets the vif-id vif_id = port_data['id'] tags = self._build_port_tags(port_data)