Finish off rebranding of the Nicira NVP plugin

Old names are kept for backward compatibility.

Last references to the old NVP plugins are going
to be dropped in Juno.

Completes blueprint nicira-plugin-renaming

Change-Id: Ia1aa4f658891e7ce9469748432c338353195edfd
This commit is contained in:
armando-migliaccio 2014-02-18 11:43:23 -08:00
parent 2964b8483a
commit 1ba129e6a3
113 changed files with 596 additions and 697 deletions

View File

@ -67,7 +67,7 @@ def upgrade(active_plugins=None, options=None):
# Copy network and port ids over to network|port(securitybindings) table
# and set port_security_enabled to false as ip address pairs were not
# configured in NVP originally.
# configured in NVP/NSX originally.
op.execute("INSERT INTO networksecuritybindings SELECT id as "
"network_id, False as port_security_enabled from networks")
op.execute("INSERT INTO portsecuritybindings SELECT id as port_id, "

View File

@ -1,28 +0,0 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation.
# 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.
import sys
# catch an import error if nicira is not the configured plugin
try:
from neutron.plugins import nicira
# Provide a mapping for the nicira_nvp_plugin package to ensure
# backwards compatibility for configuration.
sys.modules['neutron.plugins.nicira.nicira_nvp_plugin'] = nicira
except ImportError:
pass

View File

@ -1,41 +0,0 @@
nvp-plugin
-----------------------------------------------------------------------------
Overview and pre-requisites
This is a Neutron plugin that can talk to a set of NVP controllers and
implements the core Neutron v2 api. In order to use it you must have
Nicira NVP running and configured. You must also have Neutron installed
and configured.
NVP Plugin configuration
1) Database configuration
The NVP plugin leverages the Neutron database. The following connection
parameters should be specified:
- connection: Database connection string
- max_retries: Maximum number of connection attempts (default 10)
- retry_interval: Gap between connection attempts (default 2 seconds)
2) NVP (general)
- max_lp_per_bridged_ls: Maximum number of ports of a logical switch on a
bridged transport zone (default 5000)
- concurrent_connections: Number of connects to each controller node
(default 10)
- nvp_gen_timout: Number of seconds a generation id should be valid for
(default -1 meaning do not time out)
3) NVP cluster
By default the Neutron NVP plugin can talk to multiple controllers in a
single cluster.
The following parameters can be configured:
- default_tz_uuid: This is uuid of the default NVP Transport zone that
will be used for creating tunneled isolated "Neutron" networks. It
needs to be created in NVP before starting Neutron with the nvp plugin.
- nvp_controllers: describes the list of controllers
More details can be found in etc/neutron/plugins/nicira/nvp.ini
Neutron Configuration
Modify your Neutron configuration for using the NVP Plugin:
core_plugin = neutron.plugins.nicira.NeutronPlugin.NvpPluginV2

View File

@ -0,0 +1,24 @@
# 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
# 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.
import sys
from neutron.plugins.vmware.plugins import base
from neutron.plugins.vmware.plugins import service
# Kept for backward compatibility
sys.modules['neutron.plugins.nicira.NeutronPlugin'] = base
sys.modules['neutron.plugins.nicira.NeutronServicePlugin'] = service

View File

@ -1,16 +0,0 @@
# 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
# 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.

View File

@ -1,16 +0,0 @@
# 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
# 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.

View File

@ -0,0 +1,3 @@
import os
NSX_EXT_PATH = os.path.join(os.path.dirname(__file__), 'extensions')

View File

@ -20,7 +20,7 @@ import six
import time
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.api_client import ctrl_conn_to_str
from neutron.plugins.vmware.api_client import ctrl_conn_to_str
LOG = logging.getLogger(__name__)

View File

@ -18,11 +18,11 @@
import httplib
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.api_client import base
from neutron.plugins.nicira.api_client import eventlet_client
from neutron.plugins.nicira.api_client import eventlet_request
from neutron.plugins.nicira.api_client import exception
from neutron.plugins.nicira.api_client import version
from neutron.plugins.vmware.api_client import base
from neutron.plugins.vmware.api_client import eventlet_client
from neutron.plugins.vmware.api_client import eventlet_request
from neutron.plugins.vmware.api_client import exception
from neutron.plugins.vmware.api_client import version
LOG = logging.getLogger(__name__)

View File

@ -19,8 +19,8 @@ import eventlet
import time
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.api_client import base
from neutron.plugins.nicira.api_client import eventlet_request
from neutron.plugins.vmware.api_client import base
from neutron.plugins.vmware.api_client import eventlet_request
eventlet.monkey_patch()
LOG = logging.getLogger(__name__)

View File

@ -20,7 +20,7 @@ import json
import urllib
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.api_client import request
from neutron.plugins.vmware.api_client import request
LOG = logging.getLogger(__name__)
USER_AGENT = "Neutron eventlet client/2.0"

View File

@ -27,7 +27,7 @@ import six.moves.urllib.parse as urlparse
from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.api_client import ctrl_conn_to_str
from neutron.plugins.vmware.api_client import ctrl_conn_to_str
LOG = logging.getLogger(__name__)

View File

@ -22,9 +22,9 @@ import sys
from oslo.config import cfg
from neutron.common import config
from neutron.plugins.nicira.common import config as nsx_config # noqa
from neutron.plugins.nicira.common import nsx_utils
from neutron.plugins.nicira import nvplib
from neutron.plugins.vmware.common import config as nsx_config # noqa
from neutron.plugins.vmware.common import nsx_utils
from neutron.plugins.vmware import nvplib
config.setup_logging(cfg.CONF)

View File

@ -16,12 +16,12 @@
# under the License.
from neutron.openstack.common import log
from neutron.plugins.nicira.api_client import client
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 secgroup as secgrouplib
from neutron.plugins.nicira.nsxlib import switch as switchlib
from neutron.plugins.vmware.api_client import client
from neutron.plugins.vmware.dbexts import db as nsx_db
from neutron.plugins.vmware import nsx_cluster
from neutron.plugins.vmware.nsxlib import router as routerlib
from neutron.plugins.vmware.nsxlib import secgroup as secgrouplib
from neutron.plugins.vmware.nsxlib import switch as switchlib
LOG = log.getLogger(__name__)

View File

@ -14,7 +14,7 @@
# under the License.
from neutron.openstack.common import log
from neutron.plugins.nicira.common import nsx_utils
from neutron.plugins.vmware.common import nsx_utils
LOG = log.getLogger(__name__)
# Protocol number look up for supported protocols

View File

@ -25,12 +25,12 @@ from neutron.openstack.common import jsonutils
from neutron.openstack.common import log
from neutron.openstack.common import loopingcall
from neutron.openstack.common import timeutils
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.nicira.common import nsx_utils
from neutron.plugins.nicira.nsxlib import router as routerlib
from neutron.plugins.nicira.nsxlib import switch as switchlib
from neutron.plugins.nicira import nvplib
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.common import nsx_utils
from neutron.plugins.vmware.nsxlib import router as routerlib
from neutron.plugins.vmware.nsxlib import switch as switchlib
from neutron.plugins.vmware import nvplib
# Maximum page size for a single request
# NOTE(salv-orlando): This might become a version-dependent map should the

View File

@ -19,8 +19,8 @@ from sqlalchemy.orm import exc
import neutron.db.api as db
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.vmware.dbexts import models
from neutron.plugins.vmware.dbexts import networkgw_db
LOG = logging.getLogger(__name__)

View File

@ -14,8 +14,8 @@
# under the License.
#
from neutron.plugins.nicira.dbexts import nsxrouter
from neutron.plugins.nicira.extensions import distributedrouter as dist_rtr
from neutron.plugins.vmware.dbexts import nsxrouter
from neutron.plugins.vmware.extensions import distributedrouter as dist_rtr
class DistributedRouter_mixin(nsxrouter.NsxRouterMixin):

View File

@ -23,7 +23,7 @@ from sqlalchemy import String
from neutron.db import models_v2
from neutron.openstack.common.db import exception as d_exc
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.common import exceptions as p_exc
from neutron.plugins.vmware.common import exceptions as p_exc
LOG = logging.getLogger(__name__)

View File

@ -22,7 +22,7 @@ from neutron.db import db_base_plugin_v2
from neutron.db import model_base
from neutron.db import models_v2
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.extensions import maclearning as mac
from neutron.plugins.vmware.extensions import maclearning as mac
LOG = logging.getLogger(__name__)

View File

@ -84,7 +84,7 @@ class NeutronNsxSecurityGroupMapping(model_base.BASEV2):
class NeutronNsxPortMapping(model_base.BASEV2):
"""Represents the mapping between neutron and nvp port uuids."""
"""Represents the mapping between neutron and nsx port uuids."""
__tablename__ = 'neutron_nsx_port_mappings'
neutron_id = Column(String(36),

View File

@ -26,7 +26,7 @@ from neutron.db import model_base
from neutron.db import models_v2
from neutron.openstack.common import log as logging
from neutron.openstack.common import uuidutils
from neutron.plugins.nicira.extensions import networkgw
from neutron.plugins.vmware.extensions import networkgw
LOG = logging.getLogger(__name__)

View File

@ -16,7 +16,7 @@
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 models
from neutron.plugins.vmware.dbexts import models
LOG = logging.getLogger(__name__)

View File

@ -23,7 +23,7 @@ from neutron.db import model_base
from neutron.db import models_v2
from neutron.openstack.common import log
from neutron.openstack.common import uuidutils
from neutron.plugins.nicira.extensions import qos
from neutron.plugins.vmware.extensions import qos
LOG = log.getLogger(__name__)
@ -71,7 +71,7 @@ class NetworkQueueMapping(model_base.BASEV2):
cascade='delete', lazy='joined'))
class NVPQoSDbMixin(qos.QueuePluginBase):
class QoSDbMixin(qos.QueuePluginBase):
"""Mixin class to add queues."""
def create_qos_queue(self, context, qos_queue):

View File

@ -13,8 +13,8 @@
# under the License.
#
from neutron.plugins.nicira.dbexts import distributedrouter as dist_rtr
from neutron.plugins.nicira.extensions import servicerouter
from neutron.plugins.vmware.dbexts import distributedrouter as dist_rtr
from neutron.plugins.vmware.extensions import servicerouter
class ServiceRouter_mixin(dist_rtr.DistributedRouter_mixin):

View File

@ -17,9 +17,9 @@
from sqlalchemy.orm import exc
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.nicira.dbexts import vcns_models
from neutron.plugins.nicira.vshield.common import (
from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.dbexts import vcns_models
from neutron.plugins.vmware.vshield.common import (
exceptions as vcns_exc)
LOG = logging.getLogger(__name__)

View File

@ -18,8 +18,8 @@
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.common import constants as const
from neutron.common import topics
from neutron.plugins.nicira.dhcp_meta import nsx as nsx_svc
from neutron.plugins.nicira.dhcp_meta import rpc as nsx_rpc
from neutron.plugins.vmware.dhcp_meta import nsx as nsx_svc
from neutron.plugins.vmware.dhcp_meta import rpc as nsx_rpc
class DhcpAgentNotifyAPI(dhcp_rpc_agent_api.DhcpAgentNotifyAPI):

View File

@ -20,12 +20,12 @@ from oslo.config import cfg
from neutron.common import exceptions as n_exc
from neutron.openstack.common.db import exception as db_exc
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.common import exceptions as p_exc
from neutron.plugins.nicira.dbexts import lsn_db
from neutron.plugins.nicira.dhcp_meta import constants as const
from neutron.plugins.nicira.nsxlib import lsn as lsn_api
from neutron.plugins.nicira.nsxlib import switch as switch_api
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as p_exc
from neutron.plugins.vmware.dbexts import lsn_db
from neutron.plugins.vmware.dhcp_meta import constants as const
from neutron.plugins.vmware.nsxlib import lsn as lsn_api
from neutron.plugins.vmware.nsxlib import switch as switch_api
LOG = logging.getLogger(__name__)

View File

@ -19,9 +19,9 @@ from neutron.common import constants as const
from neutron.common import exceptions as n_exc
from neutron.extensions import external_net
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.common import exceptions as p_exc
from neutron.plugins.nicira.dhcp_meta import nsx
from neutron.plugins.nicira.dhcp_meta import rpc
from neutron.plugins.vmware.common import exceptions as p_exc
from neutron.plugins.vmware.dhcp_meta import nsx
from neutron.plugins.vmware.dhcp_meta import rpc
LOG = logging.getLogger(__name__)

View File

@ -24,9 +24,9 @@ from neutron.db import db_base_plugin_v2
from neutron.db import l3_db
from neutron.extensions import external_net
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.common import exceptions as p_exc
from neutron.plugins.nicira.dhcp_meta import constants as d_const
from neutron.plugins.nicira.nsxlib import lsn as lsn_api
from neutron.plugins.vmware.common import exceptions as p_exc
from neutron.plugins.vmware.dhcp_meta import constants as d_const
from neutron.plugins.vmware.nsxlib import lsn as lsn_api
LOG = logging.getLogger(__name__)
@ -95,7 +95,7 @@ class DhcpAgentNotifyAPI(object):
network_id = port['network_id']
subnet_id = port["fixed_ips"][0]['subnet_id']
filters = {'network_id': [network_id]}
# Because NVP does not support updating a single host entry we
# Because NSX does not support updating a single host entry we
# got to build the whole list from scratch and update in bulk
ports = self.plugin.get_ports(context, filters)
if not ports:

View File

@ -31,9 +31,9 @@ from neutron.db import dhcp_rpc_base
from neutron.db import l3_db
from neutron.db import models_v2
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.common import config
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import config
from neutron.plugins.vmware.common import exceptions as nsx_exc
LOG = logging.getLogger(__name__)
@ -43,7 +43,7 @@ METADATA_GATEWAY_IP = '169.254.169.253'
METADATA_DHCP_ROUTE = '169.254.169.254/32'
class NVPRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin):
class NSXRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin):
RPC_API_VERSION = '1.1'

View File

@ -23,14 +23,14 @@ from neutron.common import topics
from neutron.openstack.common import importutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.plugins.nicira.common import config
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.nicira.dhcp_meta import combined
from neutron.plugins.nicira.dhcp_meta import lsnmanager
from neutron.plugins.nicira.dhcp_meta import migration
from neutron.plugins.nicira.dhcp_meta import nsx as nsx_svc
from neutron.plugins.nicira.dhcp_meta import rpc as nsx_rpc
from neutron.plugins.nicira.extensions import lsn
from neutron.plugins.vmware.common import config
from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.dhcp_meta import combined
from neutron.plugins.vmware.dhcp_meta import lsnmanager
from neutron.plugins.vmware.dhcp_meta import migration
from neutron.plugins.vmware.dhcp_meta import nsx as nsx_svc
from neutron.plugins.vmware.dhcp_meta import rpc as nsx_rpc
from neutron.plugins.vmware.extensions import lsn
LOG = logging.getLogger(__name__)
@ -70,7 +70,7 @@ class DhcpMetadataAccess(object):
def _setup_rpc_dhcp_metadata(self, notifier=None):
self.topic = topics.PLUGIN
self.conn = rpc.create_connection(new=True)
self.dispatcher = nsx_rpc.NVPRpcCallbacks().create_rpc_dispatcher()
self.dispatcher = nsx_rpc.NSXRpcCallbacks().create_rpc_dispatcher()
self.conn.create_consumer(self.topic, self.dispatcher, fanout=False)
self.agent_notifiers[const.AGENT_TYPE_DHCP] = (
notifier or dhcp_rpc_agent_api.DhcpAgentNotifyAPI())

View File

@ -18,7 +18,7 @@
# TODO(armando-migliaccio): This is deprecated in Icehouse, and
# to be removed in Juno.
from neutron.plugins.nicira.extensions import networkgw
from neutron.plugins.vmware.extensions import networkgw
class Nvp_networkgw(networkgw.Networkgw):

View File

@ -16,7 +16,7 @@
# TODO(armando-migliaccio): This is deprecated in Icehouse, and
# to be removed in Juno.
from neutron.plugins.nicira.extensions import qos
from neutron.plugins.vmware.extensions import qos
class Nvp_qos(qos.Qos):

View File

@ -16,7 +16,7 @@
from oslo.config import cfg
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.common import exceptions
from neutron.plugins.vmware.common import exceptions
LOG = logging.getLogger(__name__)
DEFAULT_PORT = 443

View File

@ -17,11 +17,11 @@
import json
from neutron.openstack.common import log
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.nsxlib import switch
from neutron.plugins.nicira.nvplib import _build_uri_path
from neutron.plugins.nicira.nvplib import do_request
from neutron.plugins.nicira.nvplib import get_all_query_pages
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.nsxlib import switch
from neutron.plugins.vmware.nvplib import _build_uri_path
from neutron.plugins.vmware.nvplib import do_request
from neutron.plugins.vmware.nvplib import get_all_query_pages
HTTP_GET = "GET"
HTTP_POST = "POST"

View File

@ -19,11 +19,11 @@ import json
from neutron.common import exceptions as exception
from neutron.openstack.common import log
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.nvplib import _build_uri_path
from neutron.plugins.nicira.nvplib import do_request
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.nvplib import _build_uri_path
from neutron.plugins.vmware.nvplib import do_request
HTTP_GET = "GET"
HTTP_POST = "POST"

View File

@ -18,10 +18,10 @@ from neutron.common import exceptions as exception
from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.nvplib import _build_uri_path
from neutron.plugins.nicira.nvplib import do_request
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.nvplib import _build_uri_path
from neutron.plugins.vmware.nvplib import do_request
HTTP_POST = "POST"
HTTP_DELETE = "DELETE"
@ -40,8 +40,8 @@ def create_lqueue(cluster, queue_data):
'dscp': 'dscp'
}
queue_obj = dict(
(nvp_name, queue_data.get(api_name))
for api_name, nvp_name in params.iteritems()
(nsx_name, queue_data.get(api_name))
for api_name, nsx_name in params.iteritems()
if attr.is_attr_set(queue_data.get(api_name))
)
if 'display_name' in queue_obj:

View File

@ -17,15 +17,15 @@ from neutron.common import exceptions as exception
from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.nsxlib.switch import get_port
from neutron.plugins.nicira.nsxlib.versioning import DEFAULT_VERSION
from neutron.plugins.nicira.nsxlib.versioning import versioned
from neutron.plugins.nicira.nvplib import _build_uri_path
from neutron.plugins.nicira.nvplib import do_request
from neutron.plugins.nicira.nvplib import get_all_query_pages
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.nsxlib.switch import get_port
from neutron.plugins.vmware.nsxlib.versioning import DEFAULT_VERSION
from neutron.plugins.vmware.nsxlib.versioning import versioned
from neutron.plugins.vmware.nvplib import _build_uri_path
from neutron.plugins.vmware.nvplib import do_request
from neutron.plugins.vmware.nvplib import get_all_query_pages
HTTP_GET = "GET"
HTTP_POST = "POST"

View File

@ -18,11 +18,11 @@ import json
from neutron.common import constants
from neutron.common import exceptions
from neutron.openstack.common import log
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.nvplib import _build_uri_path
from neutron.plugins.nicira.nvplib import do_request
from neutron.plugins.nicira.nvplib import format_exception
from neutron.plugins.nicira.nvplib import get_all_query_pages
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.nvplib import _build_uri_path
from neutron.plugins.vmware.nvplib import do_request
from neutron.plugins.vmware.nvplib import format_exception
from neutron.plugins.vmware.nvplib import get_all_query_pages
HTTP_GET = "GET"
HTTP_POST = "POST"

View File

@ -19,12 +19,12 @@ import json
from neutron.common import constants
from neutron.common import exceptions as exception
from neutron.openstack.common import log
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.nvplib import _build_uri_path
from neutron.plugins.nicira.nvplib import do_request
from neutron.plugins.nicira.nvplib import get_all_query_pages
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.nvplib import _build_uri_path
from neutron.plugins.vmware.nvplib import do_request
from neutron.plugins.vmware.nvplib import get_all_query_pages
HTTP_GET = "GET"
HTTP_POST = "POST"

View File

@ -15,7 +15,7 @@
import inspect
from neutron.plugins.nicira.api_client import exception
from neutron.plugins.vmware.api_client import exception
DEFAULT_VERSION = -1
@ -28,7 +28,7 @@ def versioned(func_table):
def dispatch_versioned_function(cluster, *args, **kwargs):
# Call the wrapper function, in case we need to
# run validation checks regarding versions. It
# should return the NVP version
# should return the NSX version
v = (wrapped_func(cluster, *args, **kwargs) or
cluster.api_client.get_version())
func = get_function_by_version(func_table, func_name, v)

View File

@ -18,8 +18,8 @@ import json
from neutron.common import exceptions as exception
from neutron.openstack.common import log
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc
LOG = log.getLogger(__name__)
@ -28,7 +28,7 @@ HTTP_GET = "GET"
HTTP_POST = "POST"
HTTP_DELETE = "DELETE"
HTTP_PUT = "PUT"
# Prefix to be used for all NVP API calls
# Prefix to be used for all NSX API calls
URI_PREFIX = "/ws.v1"
LSWITCH_RESOURCE = "lswitch"
@ -81,7 +81,7 @@ def get_single_query_page(path, cluster, page_cursor=None,
if page_cursor:
params.append("_page_cursor=%s" % page_cursor)
params.append("_page_length=%s" % page_length)
# NOTE(salv-orlando): On the NVP backend the 'Quantum' tag is still
# NOTE(salv-orlando): On the NSX backend the 'Quantum' tag is still
# used for marking Neutron entities in order to preserve compatibility
if neutron_only:
params.append("tag_scope=quantum")

View File

@ -15,8 +15,8 @@
# under the License.
#
from neutron.plugins.nicira import NeutronPlugin
from neutron.plugins.nicira import NeutronServicePlugin
from neutron.plugins.vmware.plugins import base
from neutron.plugins.vmware.plugins import service
NsxPlugin = NeutronPlugin.NvpPluginV2
NsxServicePlugin = NeutronServicePlugin.NvpAdvancedPlugin
NsxPlugin = base.NsxPluginV2
NsxServicePlugin = service.NsxAdvancedPlugin

View File

@ -30,24 +30,23 @@ from neutron.extensions import routedserviceinsertion as rsi
from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging
from neutron.plugins.common import constants as service_constants
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.common import config # noqa
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.dbexts import servicerouter as sr_db
from neutron.plugins.nicira.dbexts import vcns_db
from neutron.plugins.nicira.dbexts import vcns_models
from neutron.plugins.nicira.extensions import servicerouter as sr
from neutron.plugins.nicira import NeutronPlugin
from neutron.plugins.nicira.nsxlib import router as routerlib
from neutron.plugins.nicira.nsxlib import switch as switchlib
from neutron.plugins.nicira.vshield.common import (
constants as vcns_const)
from neutron.plugins.nicira.vshield.common.constants import RouterStatus
from neutron.plugins.nicira.vshield.common import exceptions
from neutron.plugins.nicira.vshield.tasks.constants import TaskState
from neutron.plugins.nicira.vshield.tasks.constants import TaskStatus
from neutron.plugins.nicira.vshield import vcns_driver
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import config # noqa
from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.dbexts import servicerouter as sr_db
from neutron.plugins.vmware.dbexts import vcns_db
from neutron.plugins.vmware.dbexts import vcns_models
from neutron.plugins.vmware.extensions import servicerouter as sr
from neutron.plugins.vmware.nsxlib import router as routerlib
from neutron.plugins.vmware.nsxlib import switch as switchlib
from neutron.plugins.vmware.plugins import base
from neutron.plugins.vmware.vshield.common import constants as vcns_const
from neutron.plugins.vmware.vshield.common.constants import RouterStatus
from neutron.plugins.vmware.vshield.common import exceptions
from neutron.plugins.vmware.vshield.tasks.constants import TaskState
from neutron.plugins.vmware.vshield.tasks.constants import TaskStatus
from neutron.plugins.vmware.vshield import vcns_driver
from sqlalchemy.orm import exc as sa_exc
LOG = logging.getLogger(__name__)
@ -76,15 +75,15 @@ ROUTER_STATUS_LEVEL = {
}
class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
NeutronPlugin.NvpPluginV2,
class NsxAdvancedPlugin(sr_db.ServiceRouter_mixin,
base.NsxPluginV2,
rsi_db.RoutedServiceInsertionDbMixin,
firewall_db.Firewall_db_mixin,
loadbalancer_db.LoadBalancerPluginDb
):
supported_extension_aliases = (
NeutronPlugin.NvpPluginV2.supported_extension_aliases + [
base.NsxPluginV2.supported_extension_aliases + [
"service-router",
"routed-service-insertion",
"fwaas",
@ -92,7 +91,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
])
def __init__(self):
super(NvpAdvancedPlugin, self).__init__()
super(NsxAdvancedPlugin, self).__init__()
self._super_create_ext_gw_port = (
self._port_drivers['create'][l3_db.DEVICE_OWNER_ROUTER_GW])
@ -116,7 +115,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
self._set_create_lswitch_proxy()
def _set_create_lswitch_proxy(self):
NeutronPlugin.switchlib.create_lswitch = self._proxy_create_lswitch
base.switchlib.create_lswitch = self._proxy_create_lswitch
def _proxy_create_lswitch(self, *args, **kwargs):
name, tz_config, tags = (
@ -309,7 +308,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def _update_router_gw_info(self, context, router_id, info):
if not self._is_advanced_service_router(context, router_id):
super(NvpAdvancedPlugin, self)._update_router_gw_info(
super(NsxAdvancedPlugin, self)._update_router_gw_info(
context, router_id, info)
return
@ -320,7 +319,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
orgaddr, orgmask, orgnexthop = self._get_external_attachment_info(
context, router)
super(NeutronPlugin.NvpPluginV2, self)._update_router_gw_info(
super(base.NsxPluginV2, self)._update_router_gw_info(
context, router_id, info, router=router)
new_ext_net_id = router.gw_port_id and router.gw_port.network_id
@ -361,20 +360,20 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def _add_subnet_snat_rule(self, context, router, subnet):
# NOP for service router
if not self._is_advanced_service_router(router=router):
super(NvpAdvancedPlugin, self)._add_subnet_snat_rule(
super(NsxAdvancedPlugin, self)._add_subnet_snat_rule(
context, router, subnet)
def _delete_subnet_snat_rule(self, context, router, subnet):
# NOP for service router
if not self._is_advanced_service_router(router=router):
super(NvpAdvancedPlugin, self)._delete_subnet_snat_rule(
super(NsxAdvancedPlugin, self)._delete_subnet_snat_rule(
context, router, subnet)
def _remove_floatingip_address(self, context, fip_db):
# NOP for service router
router_id = fip_db.router_id
if not self._is_advanced_service_router(context, router_id):
super(NvpAdvancedPlugin, self)._remove_floatingip_address(
super(NsxAdvancedPlugin, self)._remove_floatingip_address(
context, fip_db)
def _create_advanced_service_router(self, context, neutron_router_id,
@ -433,7 +432,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
neutron_port_id, pname, admin_status_enabled,
[vcns_const.INTEGRATION_LR_IPADDRESS])
except api_exc.NsxApiException:
msg = (_("Unable to create port on NVP logical router %s") % name)
msg = (_("Unable to create port on NSX logical router %s") % name)
LOG.exception(msg)
switchlib.delete_port(
self.cluster, lswitch['uuid'], ls_port['uuid'])
@ -451,7 +450,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
raise e
def _create_lrouter(self, context, router, nexthop):
lrouter = super(NvpAdvancedPlugin, self)._create_lrouter(
lrouter = super(NsxAdvancedPlugin, self)._create_lrouter(
context, router, vcns_const.INTEGRATION_EDGE_IPADDRESS)
router_type = self._find_router_type(router)
@ -498,7 +497,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def _delete_lrouter(self, context, router_id, nsx_router_id):
binding = vcns_db.get_vcns_router_binding(context.session, router_id)
if not binding:
super(NvpAdvancedPlugin, self)._delete_lrouter(
super(NsxAdvancedPlugin, self)._delete_lrouter(
context, router_id, nsx_router_id)
else:
vcns_db.update_vcns_router_binding(
@ -512,7 +511,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
try:
self.vcns_driver.delete_lswitch(lswitch_id)
except exceptions.ResourceNotFound:
LOG.warning(_("Did not found lswitch %s in NVP"), lswitch_id)
LOG.warning(_("Did not found lswitch %s in NSX"), lswitch_id)
# delete edge
jobdata = {
@ -528,10 +527,10 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def _update_lrouter(self, context, router_id, name, nexthop, routes=None):
if not self._is_advanced_service_router(context, router_id):
return super(NvpAdvancedPlugin, self)._update_lrouter(
return super(NsxAdvancedPlugin, self)._update_lrouter(
context, router_id, name, nexthop, routes=routes)
previous_routes = super(NvpAdvancedPlugin, self)._update_lrouter(
previous_routes = super(NsxAdvancedPlugin, self)._update_lrouter(
context, router_id, name,
vcns_const.INTEGRATION_EDGE_IPADDRESS, routes=routes)
@ -551,7 +550,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
min_num_rules_expected=0):
# NOP for advanced service router
if not self._is_advanced_service_router(context, router_id):
super(NvpAdvancedPlugin, self)._retrieve_and_delete_nat_rules(
super(NsxAdvancedPlugin, self)._retrieve_and_delete_nat_rules(
context, floating_ip_address, internal_ip, router_id,
min_num_rules_expected=min_num_rules_expected)
@ -560,24 +559,24 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
router_id = self._get_fip_assoc_data(context, fip, floatingip_db)[2]
if (router_id and
not self._is_advanced_service_router(context, router_id)):
super(NvpAdvancedPlugin, self)._update_fip_assoc(
super(NsxAdvancedPlugin, self)._update_fip_assoc(
context, fip, floatingip_db, external_port)
else:
super(NeutronPlugin.NvpPluginV2, self)._update_fip_assoc(
super(base.NsxPluginV2, self)._update_fip_assoc(
context, fip, floatingip_db, external_port)
def _get_nvp_lrouter_status(self, id):
def _get_nsx_lrouter_status(self, id):
try:
lrouter = routerlib.get_lrouter(self.cluster, id)
lr_status = lrouter["_relations"]["LogicalRouterStatus"]
if lr_status["fabric_status"]:
nvp_status = RouterStatus.ROUTER_STATUS_ACTIVE
nsx_status = RouterStatus.ROUTER_STATUS_ACTIVE
else:
nvp_status = RouterStatus.ROUTER_STATUS_DOWN
nsx_status = RouterStatus.ROUTER_STATUS_DOWN
except q_exc.NotFound:
nvp_status = RouterStatus.ROUTER_STATUS_ERROR
nsx_status = RouterStatus.ROUTER_STATUS_ERROR
return nvp_status
return nsx_status
def _get_vse_status(self, context, id):
binding = vcns_db.get_vcns_router_binding(context.session, id)
@ -590,25 +589,25 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
else:
return edge_db_status_level
def _get_all_nvp_lrouters_statuses(self, tenant_id, fields):
# get nvp lrouters status
nvp_lrouters = routerlib.get_lrouters(self.cluster,
def _get_all_nsx_lrouters_statuses(self, tenant_id, fields):
# get nsx lrouters status
nsx_lrouters = routerlib.get_lrouters(self.cluster,
tenant_id,
fields)
nvp_status = {}
for nvp_lrouter in nvp_lrouters:
if (nvp_lrouter["_relations"]["LogicalRouterStatus"]
nsx_status = {}
for nsx_lrouter in nsx_lrouters:
if (nsx_lrouter["_relations"]["LogicalRouterStatus"]
["fabric_status"]):
nvp_status[nvp_lrouter['uuid']] = (
nsx_status[nsx_lrouter['uuid']] = (
RouterStatus.ROUTER_STATUS_ACTIVE
)
else:
nvp_status[nvp_lrouter['uuid']] = (
nsx_status[nsx_lrouter['uuid']] = (
RouterStatus.ROUTER_STATUS_DOWN
)
return nvp_status
return nsx_status
def _get_all_vse_statuses(self, context):
bindings = self._model_query(
@ -645,10 +644,10 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def get_router(self, context, id, fields=None):
if fields and 'status' not in fields:
return super(NvpAdvancedPlugin, self).get_router(
return super(NsxAdvancedPlugin, self).get_router(
context, id, fields=fields)
router = super(NvpAdvancedPlugin, self).get_router(context, id)
router = super(NsxAdvancedPlugin, self).get_router(context, id)
router_type = self._find_router_type(router)
if router_type == ROUTER_TYPE_ADVANCED:
@ -659,7 +658,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
return self._fields(router, fields)
def get_routers(self, context, filters=None, fields=None, **kwargs):
routers = super(NvpAdvancedPlugin, self).get_routers(
routers = super(NsxAdvancedPlugin, self).get_routers(
context, filters=filters, **kwargs)
if fields and 'status' not in fields:
@ -687,7 +686,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
return [self._fields(router, fields) for router in routers]
def add_router_interface(self, context, router_id, interface_info):
info = super(NvpAdvancedPlugin, self).add_router_interface(
info = super(NsxAdvancedPlugin, self).add_router_interface(
context, router_id, interface_info)
if self._is_advanced_service_router(context, router_id):
router = self._get_router(context, router_id)
@ -699,7 +698,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
return info
def remove_router_interface(self, context, router_id, interface_info):
info = super(NvpAdvancedPlugin, self).remove_router_interface(
info = super(NsxAdvancedPlugin, self).remove_router_interface(
context, router_id, interface_info)
if self._is_advanced_service_router(context, router_id):
router = self._get_router(context, router_id)
@ -711,7 +710,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
return info
def create_floatingip(self, context, floatingip):