From bafe365e06008413b1a74489814fbc2f475ea45c Mon Sep 17 00:00:00 2001 From: asarfaty Date: Tue, 16 Mar 2021 09:28:16 +0200 Subject: [PATCH] NSX|P: Do not update backend port vif id after creation On update ports action, do not update the vif-id, and use the one already set. This will makee migrated ports keep their original vif-ids. Change-Id: Ieffa359e8314319c74be3412e5e673040033a8c5 --- vmware_nsx/plugins/nsx_p/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index 3c07781b6b..3eb97104b2 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -1756,8 +1756,8 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): device_owner.startswith('compute:') and port_data.get('vif_id')): # During api-replay, migrated vm port should have this vif-id vif_id = port_data['vif_id'] - elif (not device_owner or - device_owner != l3_db.DEVICE_OWNER_ROUTER_INTF): + elif (is_create and (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']