V2T migration: Support vlan networks migration

Change-Id: Ia413725400b49409812b2dae66ecdd32b4557242
This commit is contained in:
asarfaty 2021-02-10 14:46:58 +02:00 committed by Adit Sarfaty
parent 2a58c7b8bc
commit 59c0f2e384
2 changed files with 8 additions and 1 deletions

View File

@ -193,6 +193,12 @@ class PrepareObjectForMigration(object):
if 'provider:physical_network' in body:
del body['provider:physical_network']
# For VLAN network we are removing the physical_network so the default
# vlan TAZ will be used by the plugin
if (body.get('provider:network_type') == 'vlan'):
if 'provider:physical_network' in body:
del body['provider:physical_network']
# external networks needs some special care
if body.get('router:external'):
fields_reset = False

View File

@ -646,7 +646,8 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
kwargs['metadata_proxy_id'] = az._native_md_proxy_uuid
# Set the segment vni for nsx-v portgroups migration
if request_data.get('vni') and cfg.CONF.api_replay_mode:
if (cfg.CONF.api_replay_mode and
validators.is_attr_set(request_data.get('vni'))):
kwargs['overlay_id'] = request_data['vni']
self.nsxpolicy.segment.create_or_overwrite(