V2T migration: Skip public networks in validation

And skip octavia statistics updates in api_replay

Change-Id: Icb7f83403979db16b4b9eb6e3136ba4ebb9436e6
This commit is contained in:
asarfaty 2020-11-11 14:01:21 +02:00 committed by Adit Sarfaty
parent 5c36808332
commit 208d29868c
2 changed files with 11 additions and 3 deletions

View File

@ -895,7 +895,7 @@ class ApiReplayClient(utils.PrepareObjectForMigration):
def migrate_octavia(self): def migrate_octavia(self):
"""Migrates Octavia NSX objects to the new neutron driver. """Migrates Octavia NSX objects to the new neutron driver.
The Octavia proccess & DB will remain unchanged. The Octavia process & DB will remain unchanged.
Using RPC connection to connect directly with the new plugin driver. Using RPC connection to connect directly with the new plugin driver.
""" """
# Read all existing octavia resources # Read all existing octavia resources
@ -919,7 +919,7 @@ class ApiReplayClient(utils.PrepareObjectForMigration):
self.octavia_rpc_client = messaging.RPCClient(transport, target) self.octavia_rpc_client = messaging.RPCClient(transport, target)
# Initialize RPC listener for getting status updates from the driver # Initialize RPC listener for getting status updates from the driver
# so that the rsource status will not change in the octavia DB # so that the resource status will not change in the octavia DB
topic = d_const.DRIVER_TO_OCTAVIA_MIGRATION_TOPIC topic = d_const.DRIVER_TO_OCTAVIA_MIGRATION_TOPIC
server = socket.gethostname() server = socket.gethostname()
target = messaging.Target(topic=topic, server=server, target = messaging.Target(topic=topic, server=server,
@ -932,6 +932,10 @@ class ApiReplayClient(utils.PrepareObjectForMigration):
# Do nothing # Do nothing
pass pass
def update_listener_statistics(self, **kw):
# Do nothing
pass
endpoints = [MigrationOctaviaDriverEndpoint] endpoints = [MigrationOctaviaDriverEndpoint]
access_policy = dispatcher.DefaultRPCAccessPolicy access_policy = dispatcher.DefaultRPCAccessPolicy
self.octavia_rpc_server = messaging.get_rpc_server( self.octavia_rpc_server = messaging.get_rpc_server(

View File

@ -116,10 +116,14 @@ def validate_config_for_migration(resource, event, trigger, **kwargs):
# Networks & subnets validations: # Networks & subnets validations:
networks = plugin.get_networks(admin_context) networks = plugin.get_networks(admin_context)
for net in networks: for net in networks:
# skip internal networks # Skip internal networks
if net['project_id'] == nsxv_constants.INTERNAL_TENANT_ID: if net['project_id'] == nsxv_constants.INTERNAL_TENANT_ID:
continue continue
# Skip public networks
if plugin._network_is_external(admin_context, net['id']):
continue
# VXLAN or portgroup provider networks # VXLAN or portgroup provider networks
net_type = net.get(pnet.NETWORK_TYPE) net_type = net.get(pnet.NETWORK_TYPE)
if (net_type == c_utils.NsxVNetworkTypes.VXLAN or if (net_type == c_utils.NsxVNetworkTypes.VXLAN or