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):
fip = super(NvpAdvancedPlugin, self).create_floatingip(
fip = super(NsxAdvancedPlugin, self).create_floatingip(
context, floatingip)
router_id = fip.get('router_id')
if router_id and self._is_advanced_service_router(context, router_id):
@ -723,7 +722,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
return fip
def update_floatingip(self, context, id, floatingip):
fip = super(NvpAdvancedPlugin, self).update_floatingip(
fip = super(NsxAdvancedPlugin, self).update_floatingip(
context, id, floatingip)
router_id = fip.get('router_id')
if router_id and self._is_advanced_service_router(context, router_id):
@ -739,7 +738,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
router_id = None
if fip_db.fixed_port_id:
router_id = fip_db.router_id
super(NvpAdvancedPlugin, self).delete_floatingip(context, id)
super(NsxAdvancedPlugin, self).delete_floatingip(context, id)
if router_id and self._is_advanced_service_router(context, router_id):
router = self._get_router(context, router_id)
# TODO(fank): do rollback on error, or have a dedicated thread
@ -754,7 +753,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
router_id = fip_db.router_id
except sa_exc.NoResultFound:
router_id = None
super(NvpAdvancedPlugin, self).disassociate_floatingips(context,
super(NsxAdvancedPlugin, self).disassociate_floatingips(context,
port_id)
if router_id and self._is_advanced_service_router(context, router_id):
router = self._get_router(context, router_id)
@ -885,7 +884,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
raise nsx_exc.ServiceOverQuota(
overs='firewall', err_msg=msg)
fw = super(NvpAdvancedPlugin, self).create_firewall(context, firewall)
fw = super(NsxAdvancedPlugin, self).create_firewall(context, firewall)
#Add router service insertion binding with firewall object
res = {
'id': fw['id'],
@ -910,7 +909,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
context,
self.get_firewall(context, id)['firewall_policy_id'])
firewall['firewall']['status'] = service_constants.PENDING_UPDATE
fw = super(NvpAdvancedPlugin, self).update_firewall(
fw = super(NsxAdvancedPlugin, self).update_firewall(
context, id, firewall)
fw[rsi.ROUTER_ID] = service_router_binding['router_id']
rule_list_new = self._make_firewall_rule_list_by_policy_id(
@ -934,7 +933,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
service_router_binding = self._get_resource_router_id_binding(
context, firewall_db.Firewall, resource_id=id)
self._vcns_delete_firewall(context, service_router_binding.router_id)
super(NvpAdvancedPlugin, self).delete_firewall(context, id)
super(NsxAdvancedPlugin, self).delete_firewall(context, id)
self._delete_resource_router_id_binding(
context, id, firewall_db.Firewall)
@ -967,7 +966,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
LOG.debug(_("update_firewall_rule() called"))
self._ensure_update_or_delete_firewall_rule(context, id)
fwr_pre = self.get_firewall_rule(context, id)
fwr = super(NvpAdvancedPlugin, self).update_firewall_rule(
fwr = super(NsxAdvancedPlugin, self).update_firewall_rule(
context, id, firewall_rule)
if fwr_pre == fwr:
return fwr
@ -994,7 +993,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
self._ensure_firewall_policy_update_allowed(context, id)
firewall_rules_pre = self._make_firewall_rule_list_by_policy_id(
context, id)
fwp = super(NvpAdvancedPlugin, self).update_firewall_policy(
fwp = super(NsxAdvancedPlugin, self).update_firewall_policy(
context, id, firewall_policy)
firewall_rules = self._make_firewall_rule_list_by_policy_id(
context, id)
@ -1019,9 +1018,9 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def insert_rule(self, context, id, rule_info):
LOG.debug(_("insert_rule() called"))
self._ensure_firewall_policy_update_allowed(context, id)
fwp = super(NvpAdvancedPlugin, self).insert_rule(
fwp = super(NsxAdvancedPlugin, self).insert_rule(
context, id, rule_info)
fwr = super(NvpAdvancedPlugin, self).get_firewall_rule(
fwr = super(NsxAdvancedPlugin, self).get_firewall_rule(
context, rule_info['firewall_rule_id'])
# check if this policy is associated with firewall
@ -1048,9 +1047,9 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def remove_rule(self, context, id, rule_info):
LOG.debug(_("remove_rule() called"))
self._ensure_firewall_policy_update_allowed(context, id)
fwp = super(NvpAdvancedPlugin, self).remove_rule(
fwp = super(NsxAdvancedPlugin, self).remove_rule(
context, id, rule_info)
fwr = super(NvpAdvancedPlugin, self).get_firewall_rule(
fwr = super(NsxAdvancedPlugin, self).get_firewall_rule(
context, rule_info['firewall_rule_id'])
# check if this policy is associated with firewall
@ -1157,7 +1156,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
context, monitor_ide, edge_id)
#Create the pool on the edge
members = [
super(NvpAdvancedPlugin, self).get_member(
super(NsxAdvancedPlugin, self).get_member(
context, member_id)
for member_id in pool.get('members')
]
@ -1177,7 +1176,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
members = kwargs.get('members')
if not members:
members = [
super(NvpAdvancedPlugin, self).get_member(
super(NsxAdvancedPlugin, self).get_member(
context, member_id)
for member_id in pool.get('members')
]
@ -1205,7 +1204,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
"network") % network_id)
raise nsx_exc.NsxPluginException(err_msg=msg)
v = super(NvpAdvancedPlugin, self).create_vip(context, vip)
v = super(NsxAdvancedPlugin, self).create_vip(context, vip)
#Get edge_id for the resource
router_binding = vcns_db.get_vcns_router_binding(
context.session,
@ -1228,7 +1227,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
LOG.exception(_("Failed to create vip!"))
self._delete_resource_router_id_binding(
context, v['id'], loadbalancer_db.Vip)
super(NvpAdvancedPlugin, self).delete_vip(context, v['id'])
super(NsxAdvancedPlugin, self).delete_vip(context, v['id'])
self._resource_set_status(context, loadbalancer_db.Vip,
v['id'], service_constants.ACTIVE, v)
v[rsi.ROUTER_ID] = router_id
@ -1239,7 +1238,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
edge_id = self._get_edge_id_by_vip_id(context, id)
old_vip = self.get_vip(context, id)
vip['vip']['status'] = service_constants.PENDING_UPDATE
v = super(NvpAdvancedPlugin, self).update_vip(context, id, vip)
v = super(NsxAdvancedPlugin, self).update_vip(context, id, vip)
v[rsi.ROUTER_ID] = self._get_resource_router_id_binding(
context, loadbalancer_db.Vip, resource_id=id)['router_id']
if old_vip['pool_id'] != v['pool_id']:
@ -1297,7 +1296,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
router = self._get_router(context, router_binding.router_id)
self._delete_resource_router_id_binding(
context, id, loadbalancer_db.Vip)
super(NvpAdvancedPlugin, self).delete_vip(context, id)
super(NsxAdvancedPlugin, self).delete_vip(context, id)
self._update_interface(context, router, sync=True)
def get_vip(self, context, id, fields=None):
@ -1326,7 +1325,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def update_pool(self, context, id, pool):
pool['pool']['status'] = service_constants.PENDING_UPDATE
p = super(NvpAdvancedPlugin, self).update_pool(context, id, pool)
p = super(NsxAdvancedPlugin, self).update_pool(context, id, pool)
#Check whether the pool is already associated with the vip
if not p.get('vip_id'):
self._resource_set_status(context, loadbalancer_db.Pool,
@ -1344,7 +1343,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
return p
def create_member(self, context, member):
m = super(NvpAdvancedPlugin, self).create_member(context, member)
m = super(NsxAdvancedPlugin, self).create_member(context, member)
pool_id = m.get('pool_id')
pool = self.get_pool(context, pool_id)
if not pool.get('vip_id'):
@ -1359,7 +1358,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
except Exception:
with excutils.save_and_reraise_exception():
LOG.exception(_("Failed to update pool with the member"))
super(NvpAdvancedPlugin, self).delete_member(context, m['id'])
super(NsxAdvancedPlugin, self).delete_member(context, m['id'])
self._resource_set_status(context, loadbalancer_db.Pool,
pool_id, service_constants.ACTIVE)
@ -1370,7 +1369,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def update_member(self, context, id, member):
member['member']['status'] = service_constants.PENDING_UPDATE
old_member = self.get_member(context, id)
m = super(NvpAdvancedPlugin, self).update_member(
m = super(NsxAdvancedPlugin, self).update_member(
context, id, member)
if m['pool_id'] != old_member['pool_id']:
@ -1386,7 +1385,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
with excutils.save_and_reraise_exception():
LOG.exception(_("Failed to update old pool "
"with the member"))
super(NvpAdvancedPlugin, self).delete_member(
super(NsxAdvancedPlugin, self).delete_member(
context, m['id'])
self._resource_set_status(
context, loadbalancer_db.Pool,
@ -1406,7 +1405,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
except Exception:
with excutils.save_and_reraise_exception():
LOG.exception(_("Failed to update pool with the member"))
super(NvpAdvancedPlugin, self).delete_member(
super(NsxAdvancedPlugin, self).delete_member(
context, m['id'])
self._resource_set_status(context, loadbalancer_db.Pool,
@ -1417,7 +1416,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
def delete_member(self, context, id):
m = self.get_member(context, id)
super(NvpAdvancedPlugin, self).delete_member(context, id)
super(NsxAdvancedPlugin, self).delete_member(context, id)
pool_id = m['pool_id']
pool = self.get_pool(context, pool_id)
if not pool.get('vip_id'):
@ -1433,9 +1432,9 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
pool_id, service_constants.ACTIVE)
def update_health_monitor(self, context, id, health_monitor):
old_hm = super(NvpAdvancedPlugin, self).get_health_monitor(
old_hm = super(NsxAdvancedPlugin, self).get_health_monitor(
context, id)
hm = super(NvpAdvancedPlugin, self).update_health_monitor(
hm = super(NsxAdvancedPlugin, self).update_health_monitor(
context, id, health_monitor)
for hm_pool in hm.get('pools'):
pool_id = hm_pool['pool_id']
@ -1459,7 +1458,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
).filter_by(monitor_id=id)
for assoc in qry:
pool_id = assoc['pool_id']
super(NvpAdvancedPlugin,
super(NsxAdvancedPlugin,
self).delete_pool_health_monitor(context,
id,
pool_id)
@ -1486,12 +1485,12 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
with excutils.save_and_reraise_exception():
LOG.exception(_("Failed to delete monitor "
"with id: %s!"), id)
super(NvpAdvancedPlugin,
super(NsxAdvancedPlugin,
self).delete_health_monitor(context, id)
self._delete_resource_router_id_binding(
context, id, loadbalancer_db.HealthMonitor)
super(NvpAdvancedPlugin, self).delete_health_monitor(context, id)
super(NsxAdvancedPlugin, self).delete_health_monitor(context, id)
self._delete_resource_router_id_binding(
context, id, loadbalancer_db.HealthMonitor)
@ -1507,14 +1506,14 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
raise nsx_exc.NsxPluginException(err_msg=msg)
#Check whether the pool is already associated with the vip
if not pool.get('vip_id'):
res = super(NvpAdvancedPlugin,
res = super(NsxAdvancedPlugin,
self).create_pool_health_monitor(context,
health_monitor,
pool_id)
return res
#Get the edge_id
edge_id = self._get_edge_id_by_vip_id(context, pool['vip_id'])
res = super(NvpAdvancedPlugin,
res = super(NsxAdvancedPlugin,
self).create_pool_health_monitor(context,
health_monitor,
pool_id)
@ -1534,7 +1533,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
self._resource_set_status(
context, loadbalancer_db.Pool,
pool_id, service_constants.ERROR)
super(NvpAdvancedPlugin, self).delete_pool_health_monitor(
super(NsxAdvancedPlugin, self).delete_pool_health_monitor(
context, monitor_id, pool_id)
self._resource_set_status(
context, loadbalancer_db.Pool,
@ -1546,7 +1545,7 @@ class NvpAdvancedPlugin(sr_db.ServiceRouter_mixin,
return res
def delete_pool_health_monitor(self, context, id, pool_id):
super(NvpAdvancedPlugin, self).delete_pool_health_monitor(
super(NsxAdvancedPlugin, self).delete_pool_health_monitor(
context, id, pool_id)
pool = self.get_pool(context, pool_id)
#Check whether the pool is already associated with the vip
@ -1680,3 +1679,7 @@ def _process_base_create_lswitch_args(*args, **kwargs):
if kwargs.get("tags"):
tags.extend(kwargs["tags"])
return switch_name, tz_config, tags
# For backward compatibility
NvpAdvancedPlugin = NsxAdvancedPlugin

View File

@ -16,7 +16,7 @@
import sys
from neutron.plugins.nicira.shell import commands as cmd
from neutron.plugins.vmware.shell import commands as cmd
from neutronclient import shell

View File

@ -1,5 +1,3 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 VMware, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
@ -13,15 +11,13 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# @author: linb, VMware
import base64
import eventlet
from neutron.openstack.common import jsonutils
from neutron.plugins.nicira.vshield.common import exceptions
from neutron.plugins.vmware.vshield.common import exceptions
httplib2 = eventlet.import_patched('httplib2')

View File

@ -1,5 +1,3 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved.
#

View File

@ -1,5 +1,3 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 VMware, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may

View File

@ -20,14 +20,14 @@
from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.vshield.common import (
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.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.tasks import tasks
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.tasks import tasks
LOG = logging.getLogger(__name__)

View File

@ -20,8 +20,8 @@ from neutron.db import db_base_plugin_v2
from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging
from neutron.plugins.common import constants
from neutron.plugins.nicira.dbexts import vcns_db
from neutron.plugins.nicira.vshield.common import (
from neutron.plugins.vmware.dbexts import vcns_db
from neutron.plugins.vmware.vshield.common import (
exceptions as vcns_exc)
LOG = logging.getLogger(__name__)

View File

@ -18,10 +18,10 @@
from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.dbexts import vcns_db
from neutron.plugins.nicira.vshield.common import (
from neutron.plugins.vmware.dbexts import vcns_db
from neutron.plugins.vmware.vshield.common import (
constants as vcns_const)
from neutron.plugins.nicira.vshield.common import (
from neutron.plugins.vmware.vshield.common import (
exceptions as vcns_exc)
from neutron.services.loadbalancer import constants as lb_constants

View File

@ -1,5 +1,3 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 VMware, Inc.
# All Rights Reserved
#

View File

@ -1,5 +1,3 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 VMware, Inc.
# All Rights Reserved
#
@ -24,8 +22,8 @@ from eventlet import greenthread
from neutron.common import exceptions
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.plugins.nicira.vshield.tasks.constants import TaskState
from neutron.plugins.nicira.vshield.tasks.constants import TaskStatus
from neutron.plugins.vmware.vshield.tasks.constants import TaskState
from neutron.plugins.vmware.vshield.tasks.constants import TaskStatus
DEFAULT_INTERVAL = 1000

View File

@ -18,7 +18,7 @@
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.vshield.common import VcnsApiClient
from neutron.plugins.vmware.vshield.common import VcnsApiClient
LOG = logging.getLogger(__name__)

View File

@ -19,12 +19,12 @@
from oslo.config import cfg
from neutron.openstack.common import log as logging
from neutron.plugins.nicira.common import config as nicira_cfg # noqa
from neutron.plugins.nicira.vshield import edge_appliance_driver
from neutron.plugins.nicira.vshield import edge_firewall_driver
from neutron.plugins.nicira.vshield import edge_loadbalancer_driver
from neutron.plugins.nicira.vshield.tasks import tasks
from neutron.plugins.nicira.vshield import vcns
from neutron.plugins.vmware.common import config # noqa
from neutron.plugins.vmware.vshield import edge_appliance_driver
from neutron.plugins.vmware.vshield import edge_firewall_driver
from neutron.plugins.vmware.vshield import edge_loadbalancer_driver
from neutron.plugins.vmware.vshield.tasks import tasks
from neutron.plugins.vmware.vshield import vcns
LOG = logging.getLogger(__name__)

View File

@ -649,7 +649,7 @@ class L3NatTestCaseBase(L3NatTestCaseMixin):
self.assertIn('tenant_id', payload)
stid = s['subnet']['tenant_id']
# tolerate subnet tenant deliberately to '' in the
# nicira metadata access case
# nsx metadata access case
self.assertIn(payload['tenant_id'], [stid, ''])
def test_router_add_interface_subnet_with_bad_tenant_returns_404(self):

View File

@ -16,14 +16,14 @@
import os
from neutron.plugins.nicira.api_client import client as nsx_client
from neutron.plugins.nicira.api_client import eventlet_client
from neutron.plugins.nicira import extensions
from neutron.plugins.nicira import nvplib
from neutron.plugins.nicira.vshield.common import VcnsApiClient as vcnsapi
from neutron.plugins.nicira.vshield import vcns
import neutron.plugins.nicira.vshield.vcns_driver as vcnsdriver
from neutron.plugins.vmware.api_client import client as nsx_client
from neutron.plugins.vmware.api_client import eventlet_client
from neutron.plugins.vmware import extensions
from neutron.plugins.vmware import nvplib
import neutron.plugins.vmware.plugin as neutron_plugin
from neutron.plugins.vmware.vshield.common import VcnsApiClient as vcnsapi
from neutron.plugins.vmware.vshield import vcns
import neutron.plugins.vmware.vshield.vcns_driver as vcnsdriver
plugin = neutron_plugin.NsxPlugin
@ -52,4 +52,4 @@ def get_fake_conf(filename):
def nsx_method(method_name, module_name='nvplib'):
return '%s.%s.%s' % ('neutron.plugins.nicira', module_name, method_name)
return '%s.%s.%s' % ('neutron.plugins.vmware', module_name, method_name)

View File

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

View File

@ -16,7 +16,7 @@
import httplib
from neutron.plugins.nicira.api_client import ctrl_conn_to_str
from neutron.plugins.vmware.api_client import ctrl_conn_to_str
from neutron.tests import base

View File

@ -22,8 +22,8 @@ from eventlet.green import urllib2
from mock import Mock
from mock import patch
from neutron.plugins.nicira.api_client import eventlet_client as client
from neutron.plugins.nicira.api_client import eventlet_request as request
from neutron.plugins.vmware.api_client import eventlet_client as client
from neutron.plugins.vmware.api_client import eventlet_request as request
from neutron.tests import base
from neutron.tests.unit.vmware import CLIENT_NAME

View File

@ -17,8 +17,8 @@ from sqlalchemy import orm
from neutron import context
from neutron.db import api as db
from neutron.plugins.nicira.common import exceptions as p_exc
from neutron.plugins.nicira.dbexts import lsn_db
from neutron.plugins.vmware.common import exceptions as p_exc
from neutron.plugins.vmware.dbexts import lsn_db
from neutron.tests import base

View File

@ -17,8 +17,8 @@ from neutron import context
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 db as nsx_db
from neutron.plugins.nicira.dbexts import models
from neutron.plugins.vmware.dbexts import db as nsx_db
from neutron.plugins.vmware.dbexts import models
from neutron.tests import base

View File

@ -22,8 +22,8 @@ from neutron.api.v2 import attributes
from neutron.common.test_lib import test_config
from neutron import context
from neutron.extensions import agent
from neutron.plugins.nicira.api_client.version import Version
from neutron.plugins.nicira.common import sync
from neutron.plugins.vmware.api_client.version import Version
from neutron.plugins.vmware.common import sync
from neutron.tests.unit import test_db_plugin
from neutron.tests.unit.vmware.apiclient import fake
from neutron.tests.unit.vmware import get_fake_conf

View File

@ -28,10 +28,10 @@ from neutron.db import api as db_api
from neutron.db import db_base_plugin_v2
from neutron import manager
from neutron.openstack.common import uuidutils
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.dbexts import networkgw_db
from neutron.plugins.nicira.extensions import networkgw
from neutron.plugins.nicira import nsxlib
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.dbexts import networkgw_db
from neutron.plugins.vmware.extensions import networkgw
from neutron.plugins.vmware import nsxlib
from neutron import quota
from neutron.tests import base
from neutron.tests.unit import test_api_v2

View File

@ -16,7 +16,7 @@
import mock
from neutron.common import test_lib
from neutron.plugins.nicira.common import sync
from neutron.plugins.vmware.common import sync
from neutron.tests.unit import test_extension_portsecurity as psec
from neutron.tests.unit.vmware.apiclient import fake
from neutron.tests.unit.vmware import get_fake_conf

View File

@ -20,9 +20,9 @@ from oslo.config import cfg
import webob.exc
from neutron import context
from neutron.plugins.nicira.dbexts import qos_db
from neutron.plugins.nicira.extensions import qos as ext_qos
from neutron.plugins.nicira import nsxlib
from neutron.plugins.vmware.dbexts import qos_db
from neutron.plugins.vmware.extensions import qos as ext_qos
from neutron.plugins.vmware import nsxlib
from neutron.tests.unit import test_extensions
from neutron.tests.unit.vmware import NSXEXT_PATH
from neutron.tests.unit.vmware.test_nsx_plugin import NsxPluginV2TestCase

View File

@ -16,11 +16,11 @@
import mock
from neutron.plugins.nicira.api_client import client
from neutron.plugins.nicira.api_client import exception
from neutron.plugins.nicira.api_client import version
from neutron.plugins.nicira.common import config # noqa
from neutron.plugins.nicira import nsx_cluster as cluster
from neutron.plugins.vmware.api_client import client
from neutron.plugins.vmware.api_client import exception
from neutron.plugins.vmware.api_client import version
from neutron.plugins.vmware.common import config # noqa
from neutron.plugins.vmware import nsx_cluster as cluster
from neutron.tests import base
from neutron.tests.unit import test_api_v2
from neutron.tests.unit.vmware.apiclient import fake

View File

@ -14,9 +14,9 @@
# limitations under the License.
#
from neutron.plugins.nicira.api_client import exception
from neutron.plugins.nicira.nsxlib import l2gateway as l2gwlib
from neutron.plugins.nicira.nsxlib import switch as switchlib
from neutron.plugins.vmware.api_client import exception
from neutron.plugins.vmware.nsxlib import l2gateway as l2gwlib
from neutron.plugins.vmware.nsxlib import switch as switchlib
from neutron.tests.unit import test_api_v2
from neutron.tests.unit.vmware.nsxlib import base

View File

@ -17,10 +17,10 @@ import json
import mock
from neutron.common import exceptions
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 import lsn as lsnlib
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 import lsn as lsnlib
from neutron.tests import base

View File

@ -17,8 +17,8 @@
import mock
from neutron.common import exceptions
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.nsxlib import queue as queuelib
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.nsxlib import queue as queuelib
from neutron.tests.unit.vmware.nsxlib import base

View File

@ -18,12 +18,12 @@ import mock
from neutron.common import exceptions
from neutron.openstack.common import uuidutils
from neutron.plugins.nicira.api_client import exception as api_exc
from neutron.plugins.nicira.api_client.version import Version
from neutron.plugins.nicira.common import exceptions as nsx_exc
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.nsxlib import router as routerlib
from neutron.plugins.nicira.nsxlib import switch as switchlib
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.api_client.version import Version
from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.nsxlib import router as routerlib
from neutron.plugins.vmware.nsxlib import switch as switchlib
from neutron.tests.unit import test_api_v2
from neutron.tests.unit.vmware.nsxlib import base

View File

@ -15,8 +15,8 @@
#
from neutron.common import exceptions
from neutron.plugins.nicira.nsxlib import secgroup as secgrouplib
from neutron.plugins.nicira import nvplib as nsx_utils
from neutron.plugins.vmware.nsxlib import secgroup as secgrouplib
from neutron.plugins.vmware import nvplib as nsx_utils
from neutron.tests.unit import test_api_v2
from neutron.tests.unit.vmware.nsxlib import base

View File

@ -19,8 +19,8 @@ import mock
from neutron.common import constants
from neutron.common import exceptions
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.nsxlib import switch as switchlib
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.nsxlib import switch as switchlib
from neutron.tests.unit import test_api_v2
from neutron.tests.unit.vmware.nsxlib import base

View File

@ -14,10 +14,10 @@
# limitations under the License.
#
from neutron.plugins.nicira.api_client import exception
from neutron.plugins.nicira.api_client.version import Version
from neutron.plugins.nicira.nsxlib import router as routerlib
from neutron.plugins.nicira.nsxlib import versioning
from neutron.plugins.vmware.api_client import exception
from neutron.plugins.vmware.api_client.version import Version
from neutron.plugins.vmware.nsxlib import router as routerlib
from neutron.plugins.vmware.nsxlib import versioning
from neutron.tests import base

Some files were not shown because too many files have changed in this diff Show More