# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2'
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
'neutron.plugins.ml2.plugin.Ml2Plugin',
'neutron.plugins.nec.nec_plugin.NECPluginV2',
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
- 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2'
+ 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2'
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
migration_for_plugins = [
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
- 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin'
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
- 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2',
+ 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
+ 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2'
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
+ 'neutron.plugins.cisco.network_plugin.PluginV2',
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.ml2.plugin.Ml2Plugin',
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
- 'neutron.plugins.cisco.network_plugin.PluginV2',
- 'neutron.plugins.ml2.plugin.Ml2Plugin'
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin',
]
from alembic import op
down_revision = 'e197124d4b9'
migration_for_plugins = [
+ 'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2',
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
'neutron.plugins.nec.nec_plugin.NECPluginV2',
- 'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2',
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin',
'neutron.services.loadbalancer.plugin.LoadBalancerPlugin',
]
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2',
'neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin',
'neutron.plugins.midonet.plugin.MidonetPluginV2',
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2'
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin',
]
from neutron.db import migration
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2'
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2'
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
migration_for_plugins = [
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
'neutron.plugins.nec.nec_plugin.NECPluginV2',
'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin',
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2'
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
--- /dev/null
+# Copyright 2014 OpenStack Foundation
+#
+# 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.
+#
+
+"""VMware NSX rebranding
+
+Revision ID: 3d2585038b95
+Revises: 157a5d299379
+Create Date: 2014-02-11 18:18:34.319031
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '3d2585038b95'
+down_revision = '157a5d299379'
+
+# Change to ['*'] if this migration applies to all plugins
+
+migration_for_plugins = [
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
+]
+
+from alembic import op
+
+from neutron.db import migration
+
+
+def upgrade(active_plugins=None, options=None):
+ if not migration.should_run(active_plugins, migration_for_plugins):
+ return
+
+ op.rename_table('nvp_network_bindings', 'tz_network_bindings')
+ op.rename_table('nvp_multi_provider_networks', 'multi_provider_networks')
+
+ engine = op.get_bind().engine
+ if engine.name == 'postgresql':
+ op.execute("ALTER TYPE nvp_network_bindings_binding_type "
+ "RENAME TO tz_network_bindings_binding_type;")
+
+
+def downgrade(active_plugins=None, options=None):
+ if not migration.should_run(active_plugins, migration_for_plugins):
+ return
+
+ engine = op.get_bind().engine
+ if engine.name == 'postgresql':
+ op.execute("ALTER TYPE tz_network_bindings_binding_type "
+ "RENAME TO nvp_network_bindings_binding_type;")
+
+ op.rename_table('multi_provider_networks', 'nvp_multi_provider_networks')
+ op.rename_table('tz_network_bindings', 'nvp_network_bindings')
migration_for_plugins = [
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
- 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin'
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2'
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2'
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
+ 'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2',
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
+ 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
'neutron.plugins.nec.nec_plugin.NECPluginV2',
- 'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin',
]
from alembic import op
migration_for_plugins = [
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
- 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin'
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
migration_for_plugins = [
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin'
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
migration_for_plugins = [
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
- 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin'
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin'
]
from alembic import op
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
- 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
+ 'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2',
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
- 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
'neutron.plugins.nec.nec_plugin.NECPluginV2',
- 'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2',
- 'neutron.services.loadbalancer.plugin.LoadBalancerPlugin',
+ 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
+ 'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
+ 'neutron.plugins.vmware.plugin.NsxPlugin',
+ 'neutron.plugins.vmware.plugin.NsxServicePlugin',
+ 'neutron.services.loadbalancer.plugin.LoadBalancerPlugin'
]
from alembic import op
from neutron.plugins.nicira.common import nsx_utils
from neutron.plugins.nicira.common import securitygroups as nvp_sec
from neutron.plugins.nicira.common import sync
+from neutron.plugins.nicira.dbexts import db as nsx_db
from neutron.plugins.nicira.dbexts import distributedrouter as dist_rtr
from neutron.plugins.nicira.dbexts import maclearning as mac_db
from neutron.plugins.nicira.dbexts import networkgw_db
-from neutron.plugins.nicira.dbexts import nicira_db
from neutron.plugins.nicira.dbexts import qos_db
from neutron.plugins.nicira import dhcpmeta_modes
from neutron.plugins.nicira.extensions import maclearning as mac_ext
def _nvp_find_lswitch_for_port(self, context, port_data):
network = self._get_network(context, port_data['network_id'])
- network_bindings = nicira_db.get_network_bindings(
+ network_bindings = nsx_db.get_network_bindings(
context.session, port_data['network_id'])
max_ports = self.nvp_opts.max_lp_per_overlay_ls
allow_extra_lswitches = False
# Remove orphaned port from NSX
switchlib.delete_port(self.cluster, ls_uuid, lp_uuid)
# rollback the neutron-nvp port mapping
- nicira_db.delete_neutron_nsx_port_mapping(context.session,
- port_id)
+ nsx_db.delete_neutron_nsx_port_mapping(context.session,
+ port_id)
msg = (_("An exception occurred while creating the "
"quantum port %s on the NVP plaform") % port_id)
LOG.exception(msg)
selected_lswitch['uuid'],
port_data,
True)
- nicira_db.add_neutron_nsx_port_mapping(
+ nsx_db.add_neutron_nsx_port_mapping(
context.session, port_data['id'],
selected_lswitch['uuid'], lport['uuid'])
if port_data['device_owner'] not in self.port_special_owners:
self.cluster, context, nsx_router_id, port_data,
"PatchAttachment", ls_port['uuid'],
subnet_ids=[subnet_id])
- nicira_db.add_neutron_nsx_port_mapping(
+ nsx_db.add_neutron_nsx_port_mapping(
context.session, port_data['id'],
selected_lswitch['uuid'], ls_port['uuid'])
LOG.debug(_("_nvp_create_router_port completed for port "
selected_lswitch['uuid'],
port_data,
True)
- nicira_db.add_neutron_nsx_port_mapping(
+ nsx_db.add_neutron_nsx_port_mapping(
context.session, port_data['id'],
selected_lswitch['uuid'], lport['uuid'])
l2gwlib.plug_l2_gw_service(
'max_id': constants.MAX_VLAN_TAG})
else:
# Verify segment is not already allocated
- bindings = nicira_db.get_network_bindings_by_vlanid(
+ bindings = nsx_db.get_network_bindings_by_vlanid(
context.session, segmentation_id)
if bindings:
raise q_exc.VlanIdInUse(
def _extend_network_dict_provider(self, context, network,
multiprovider=None, bindings=None):
if not bindings:
- bindings = nicira_db.get_network_bindings(context.session,
- network['id'])
+ bindings = nsx_db.get_network_bindings(context.session,
+ network['id'])
if not multiprovider:
- multiprovider = nicira_db.is_multiprovider_network(context.session,
- network['id'])
+ multiprovider = nsx_db.is_multiprovider_network(context.session,
+ network['id'])
# With NVP plugin 'normal' overlay networks will have no binding
# TODO(salvatore-orlando) make sure users can specify a distinct
# phy_uuid as 'provider network' for STT net type
transport_zone_config)
# add a mapping between the neutron network and the newly
# created logical switch
- nicira_db.add_neutron_nsx_network_mapping(
+ nsx_db.add_neutron_nsx_network_mapping(
context.session, network.id, selected_lswitch['uuid'])
return selected_lswitch
else:
# Add mapping between neutron network and NSX switch
if (not attr.is_attr_set(external) or
attr.is_attr_set(external) and not external):
- nicira_db.add_neutron_nsx_network_mapping(
+ nsx_db.add_neutron_nsx_network_mapping(
context.session, new_net['id'],
lswitch['uuid'])
if (net_data.get(mpnet.SEGMENTS) and
isinstance(provider_type, bool)):
net_bindings = []
for tz in net_data[mpnet.SEGMENTS]:
- net_bindings.append(nicira_db.add_network_binding(
+ net_bindings.append(nsx_db.add_network_binding(
context.session, new_net['id'],
tz.get(pnet.NETWORK_TYPE),
tz.get(pnet.PHYSICAL_NETWORK),
tz.get(pnet.SEGMENTATION_ID, 0)))
if provider_type:
- nicira_db.set_multiprovider_network(context.session,
- new_net['id'])
+ nsx_db.set_multiprovider_network(context.session,
+ new_net['id'])
self._extend_network_dict_provider(context, new_net,
provider_type,
net_bindings)
# Ensure neutron router is moved into the transaction's buffer
context.session.flush()
# Add mapping between neutron and nsx identifiers
- nicira_db.add_neutron_nsx_router_mapping(
+ nsx_db.add_neutron_nsx_router_mapping(
context.session, router_db['id'], lrouter['uuid'])
if has_gw_info:
# a non-existent NSX router is not left in the DB in case of
# failure while removing the router from the neutron DB
try:
- nicira_db.delete_neutron_nsx_router_mapping(
+ nsx_db.delete_neutron_nsx_router_mapping(
context.session, router_id)
except db_exc.DBError as d_exc:
# Do not make this error fatal
# under the License.
from neutron.openstack.common import log
-from neutron.plugins.nicira.dbexts import nicira_db
+from neutron.plugins.nicira.dbexts import db as nsx_db
from neutron.plugins.nicira import nsx_cluster
from neutron.plugins.nicira.nsxlib import router as routerlib
from neutron.plugins.nicira.nsxlib import switch as switchlib
First lookup for mappings in Neutron database. If no mapping is
found, query the NSX backend and add the mappings.
"""
- nsx_switch_ids = nicira_db.get_nsx_switch_ids(
+ nsx_switch_ids = nsx_db.get_nsx_switch_ids(
session, neutron_network_id)
if not nsx_switch_ids:
# Find logical switches from backend.
nsx_switch_id = nsx_switch['uuid']
nsx_switch_ids.append(nsx_switch_id)
# Create DB mapping
- nicira_db.add_neutron_nsx_network_mapping(
+ nsx_db.add_neutron_nsx_network_mapping(
session,
neutron_network_id,
nsx_switch_id)
the backend logical switch identifier is equal to the neutron
network identifier.
"""
- nsx_switch_id, nsx_port_id = nicira_db.get_nsx_switch_and_port_id(
+ nsx_switch_id, nsx_port_id = nsx_db.get_nsx_switch_and_port_id(
session, neutron_port_id)
if not nsx_switch_id:
# Find logical switch for port from backend
['LogicalSwitchConfig']['uuid'])
if nsx_port_id:
# Mapping already exists. Delete before recreating
- nicira_db.delete_neutron_nsx_port_mapping(
+ nsx_db.delete_neutron_nsx_port_mapping(
session, neutron_port_id)
else:
nsx_port_id = nsx_port['uuid']
# (re)Create DB mapping
- nicira_db.add_neutron_nsx_port_mapping(
+ nsx_db.add_neutron_nsx_port_mapping(
session, neutron_port_id,
nsx_switch_id, nsx_port_id)
return nsx_switch_id, nsx_port_id
First, look up the Neutron database. If not found, execute
a query on NSX platform as the mapping might be missing.
"""
- nsx_router_id = nicira_db.get_nsx_router_id(
+ nsx_router_id = nsx_db.get_nsx_router_id(
session, neutron_router_id)
if not nsx_router_id:
# Find logical router from backend.
nsx_router_id = nsx_router['uuid']
with session.begin(subtransactions=True):
# Create DB mapping
- nicira_db.add_neutron_nsx_router_mapping(
+ nsx_db.add_neutron_nsx_router_mapping(
session,
neutron_router_id,
nsx_router_id)
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2012 Nicira, Inc.
+# Copyright 2012 VMware, Inc.
+#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
from sqlalchemy.orm import exc
import neutron.db.api as db
-from neutron.openstack.common.db import exception as d_exc
+from neutron.openstack.common.db import exception as db_exc
from neutron.openstack.common import log as logging
+from neutron.plugins.nicira.dbexts import models
from neutron.plugins.nicira.dbexts import networkgw_db
-from neutron.plugins.nicira.dbexts import nicira_models
LOG = logging.getLogger(__name__)
def get_network_bindings(session, network_id):
session = session or db.get_session()
- return (session.query(nicira_models.NvpNetworkBinding).
+ return (session.query(models.TzNetworkBinding).
filter_by(network_id=network_id).
all())
def get_network_bindings_by_vlanid(session, vlan_id):
session = session or db.get_session()
- return (session.query(nicira_models.NvpNetworkBinding).
+ return (session.query(models.TzNetworkBinding).
filter_by(vlan_id=vlan_id).
all())
def add_network_binding(session, network_id, binding_type, phy_uuid, vlan_id):
with session.begin(subtransactions=True):
- binding = nicira_models.NvpNetworkBinding(network_id, binding_type,
- phy_uuid, vlan_id)
+ binding = models.TzNetworkBinding(network_id, binding_type,
+ phy_uuid, vlan_id)
session.add(binding)
return binding
def add_neutron_nsx_network_mapping(session, neutron_id, nsx_switch_id):
with session.begin(subtransactions=True):
- mapping = nicira_models.NeutronNsxNetworkMapping(
+ mapping = models.NeutronNsxNetworkMapping(
neutron_id=neutron_id, nsx_id=nsx_switch_id)
session.add(mapping)
return mapping
nsx_switch_id, nsx_port_id):
session.begin(subtransactions=True)
try:
- mapping = nicira_models.NeutronNsxPortMapping(
+ mapping = models.NeutronNsxPortMapping(
neutron_id, nsx_switch_id, nsx_port_id)
session.add(mapping)
session.commit()
- except d_exc.DBDuplicateEntry:
+ except db_exc.DBDuplicateEntry:
session.rollback()
# do not complain if the same exact mapping is being added, otherwise
# re-raise because even though it is possible for the same neutron
LOG.debug(_("Port mapping for %s already available"), neutron_id)
else:
raise
- except d_exc.DBError:
+ except db_exc.DBError:
# rollback for any other db error
session.rollback()
raise
def add_neutron_nsx_router_mapping(session, neutron_id, nsx_router_id):
with session.begin(subtransactions=True):
- mapping = nicira_models.NeutronNsxRouterMapping(
+ mapping = models.NeutronNsxRouterMapping(
neutron_id=neutron_id, nsx_id=nsx_router_id)
session.add(mapping)
return mapping
# This function returns a list of NSX switch identifiers because of
# the possibility of chained logical switches
return [mapping['nsx_id'] for mapping in
- session.query(nicira_models.NeutronNsxNetworkMapping).filter_by(
+ session.query(models.NeutronNsxNetworkMapping).filter_by(
neutron_id=neutron_id)]
def get_nsx_switch_and_port_id(session, neutron_id):
try:
- mapping = (session.query(nicira_models.NeutronNsxPortMapping).
+ mapping = (session.query(models.NeutronNsxPortMapping).
filter_by(neutron_id=neutron_id).
one())
return mapping['nsx_switch_id'], mapping['nsx_port_id']
def get_nsx_router_id(session, neutron_id):
try:
- mapping = (session.query(nicira_models.NeutronNsxRouterMapping).
+ mapping = (session.query(models.NeutronNsxRouterMapping).
filter_by(neutron_id=neutron_id).one())
return mapping['nsx_id']
except exc.NoResultFound:
def delete_neutron_nsx_port_mapping(session, neutron_id):
return _delete_by_neutron_id(
- session, nicira_models.NeutronNsxPortMapping, neutron_id)
+ session, models.NeutronNsxPortMapping, neutron_id)
def delete_neutron_nsx_router_mapping(session, neutron_id):
return _delete_by_neutron_id(
- session, nicira_models.NeutronNsxRouterMapping, neutron_id)
+ session, models.NeutronNsxRouterMapping, neutron_id)
def unset_default_network_gateways(session):
def set_multiprovider_network(session, network_id):
with session.begin(subtransactions=True):
- multiprovider_network = nicira_models.MultiProviderNetworks(
+ multiprovider_network = models.MultiProviderNetworks(
network_id)
session.add(multiprovider_network)
return multiprovider_network
def is_multiprovider_network(session, network_id):
with session.begin(subtransactions=True):
return bool(
- session.query(nicira_models.MultiProviderNetworks).filter_by(
+ session.query(models.MultiProviderNetworks).filter_by(
network_id=network_id).first())
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2013 Nicira Networks, Inc. All rights reserved.
+# Copyright 2013 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
# License for the specific language governing permissions and limitations
# under the License.
#
-# @author: Salvatore Orlando, Nicira, Inc
-#
from neutron.plugins.nicira.dbexts import nsxrouter
from neutron.plugins.nicira.extensions import distributedrouter as dist_rtr
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
# Copyright 2013 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2012 Nicira, Inc.
+# Copyright 2013 VMware, Inc.
+#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
from neutron.db.models_v2 import model_base
-class NvpNetworkBinding(model_base.BASEV2):
+class TzNetworkBinding(model_base.BASEV2):
"""Represents a binding of a virtual network with a transport zone.
This model class associates a Neutron network with a transport zone;
optionally a vlan ID might be used if the binding type is 'bridge'
"""
- __tablename__ = 'nvp_network_bindings'
+ __tablename__ = 'tz_network_bindings'
# TODO(arosen) - it might be worth while refactoring the how this data
# is stored later so every column does not need to be a primary key.
primary_key=True)
# 'flat', 'vlan', stt' or 'gre'
binding_type = Column(Enum('flat', 'vlan', 'stt', 'gre', 'l3_ext',
- name='nvp_network_bindings_binding_type'),
+ name='tz_network_bindings_binding_type'),
nullable=False, primary_key=True)
phy_uuid = Column(String(36), primary_key=True, nullable=True)
vlan_id = Column(Integer, primary_key=True, nullable=True,
class MultiProviderNetworks(model_base.BASEV2):
- """Networks that were provision through multiprovider extension."""
+ """Networks provisioned through multiprovider extension."""
- __tablename__ = 'nvp_multi_provider_networks'
+ __tablename__ = 'multi_provider_networks'
network_id = Column(String(36),
ForeignKey('networks.id', ondelete="CASCADE"),
primary_key=True)
class NSXRouterExtAttributes(model_base.BASEV2):
- """Router attributes managed by Nicira plugin extensions."""
+ """Router attributes managed by NSX plugin extensions."""
router_id = Column(String(36),
ForeignKey('routers.id', ondelete="CASCADE"),
primary_key=True)
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
-# Copyright 2013 Nicira Networks, Inc. All rights reserved.
+# Copyright 2013 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
# License for the specific language governing permissions and limitations
# under the License.
#
-# @author: Salvatore Orlando, VMware
-#
import sqlalchemy as sa
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2013 Nicira Networks, Inc. All rights reserved.
+# Copyright 2013 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
# License for the specific language governing permissions and limitations
# under the License.
#
-# @author: Salvatore Orlando, Nicira, Inc
-#
from neutron.db import db_base_plugin_v2
from neutron.extensions import l3
from neutron.openstack.common import log as logging
-from neutron.plugins.nicira.dbexts import nicira_models
+from neutron.plugins.nicira.dbexts import models
LOG = logging.getLogger(__name__)
name = attr['name']
default = attr['default']
kwargs[name] = router_req.get(name, default)
- nsx_attributes = nicira_models.NSXRouterExtAttributes(
+ nsx_attributes = models.NSXRouterExtAttributes(
router_id=router_db['id'], **kwargs)
context.session.add(nsx_attributes)
router_db['nsx_attributes'] = nsx_attributes
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
# Copyright 2013 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
# Copyright 2013 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2013 Nicira, Inc.
+# Copyright 2013 VMware, Inc.
+#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2013 Nicira, Inc.
+# Copyright 2013 VMware, Inc.
+#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
from neutron.db import api as db
from neutron.db import models_v2
from neutron.openstack.common.db import exception as d_exc
-from neutron.plugins.nicira.dbexts import nicira_db as nsx_db
-from neutron.plugins.nicira.dbexts import nicira_models as models
+from neutron.plugins.nicira.dbexts import db as nsx_db
+from neutron.plugins.nicira.dbexts import models
from neutron.tests import base
from neutron.openstack.common import uuidutils
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.nicira.common import sync
-from neutron.plugins.nicira.dbexts import nicira_db as nsx_db
+from neutron.plugins.nicira.dbexts import db as nsx_db
from neutron.plugins.nicira.extensions import distributedrouter as dist_router
from neutron.plugins.nicira import NeutronPlugin
from neutron.plugins.nicira import nsxlib
# This will allow for avoiding setting up the plugin
# for creating db entries
mock.patch(nsx_method('get_nsx_switch_and_port_id',
- module_name='dbexts.nicira_db'),
+ module_name='dbexts.db'),
return_value=ret_value).start()
mock.patch(nsx_method('add_neutron_nsx_port_mapping',
- module_name='dbexts.nicira_db')).start()
+ module_name='dbexts.db')).start()
mock.patch(nsx_method('delete_neutron_nsx_port_mapping',
- module_name='dbexts.nicira_db')).start()
+ module_name='dbexts.db')).start()
def _mock_network_mapping_db_calls(self, ret_value):
# Mock relevant db calls
# This will allow for avoiding setting up the plugin
# for creating db entries
mock.patch(nsx_method('get_nsx_switch_ids',
- module_name='dbexts.nicira_db'),
+ module_name='dbexts.db'),
return_value=ret_value).start()
mock.patch(nsx_method('add_neutron_nsx_network_mapping',
- module_name='dbexts.nicira_db')).start()
+ module_name='dbexts.db')).start()
def _mock_router_mapping_db_calls(self, ret_value):
# Mock relevant db calls
# This will allow for avoiding setting up the plugin
# for creating db entries
mock.patch(nsx_method('get_nsx_router_id',
- module_name='dbexts.nicira_db'),
+ module_name='dbexts.db'),
return_value=ret_value).start()
mock.patch(nsx_method('add_neutron_nsx_router_mapping',
- module_name='dbexts.nicira_db')).start()
+ module_name='dbexts.db')).start()
def _verify_get_nsx_switch_and_port_id(self, exp_ls_uuid, exp_lp_uuid):
# The nvplib and db calls are mocked, therefore the cluster