
This patch will allow moving neutron from using the nsx_v3 plugin to the nsx_p plugin. This includes: - admin utility to move all resources to the policy api: nsxadmin -r nsx-migrate-t2p -o import (--verbose) This utility will: -- Migrate all neutron used & created resource using the nsx migration api -- roll back all resources in case it failed -- post migration fix some of the policy resources to better match the expectation of the policy plugin - admin utility that will cleanup left overs in the nsx_v3 db: nsxadmin -r nsx-migrate-t2p -o clean-all (can be used, but everything should work without calling it as well) - Some minor changes to the policy plugin and drivers to allow it to handle migrated resource which are a bit different than those created with the policy plugin -- Delete DHCP server config once a migrated network is deleted -- Update LB L7 rules by their name suffix as their full display name is unknown Change-Id: Ic17e0de1f4b2a2d95afa61ce33ffb0bc9e667b89
32 lines
1.3 KiB
Python
32 lines
1.3 KiB
Python
# Copyright 2020 VMware, Inc. All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from neutron_lib.callbacks import registry
|
|
|
|
from vmware_nsx.shell.admin.plugins.common import constants
|
|
from vmware_nsx.shell.admin.plugins.common import utils as admin_utils
|
|
from vmware_nsx.shell.admin.plugins.nsxv3.resources import migration
|
|
from vmware_nsx.shell import resources as shell
|
|
|
|
|
|
@admin_utils.output_header
|
|
def cleanup_db_mappings(resource, event, trigger, **kwargs):
|
|
"""Delete all entries from nsx-t mapping tables in DB"""
|
|
return migration.cleanup_db_mappings(resource, event, trigger, **kwargs)
|
|
|
|
|
|
registry.subscribe(cleanup_db_mappings,
|
|
constants.NSX_MIGRATE_T_P,
|
|
shell.Operations.CLEAN_ALL.value)
|