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
# 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, "
-# 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
+++ /dev/null
-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
-
+# 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
+++ /dev/null
-# 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.
+++ /dev/null
-# 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.
+import os
+
+NSX_EXT_PATH = os.path.join(os.path.dirname(__file__), 'extensions')
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__)
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__)
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__)
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"
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__)
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)
# 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__)
# 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
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
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__)
# 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):
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__)
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__)
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),
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__)
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__)
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__)
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):
# 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):
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__)
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):
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__)
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__)
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__)
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:
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__)
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'
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__)
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())
# 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):
# 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):
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
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"
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"
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"
'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:
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"
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"
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"
import inspect
-from neutron.plugins.nicira.api_client import exception
+from neutron.plugins.vmware.api_client import exception
DEFAULT_VERSION = -1
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)
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__)
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"
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")
# 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
# under the License.
import logging
-import os
import uuid
from oslo.config import cfg
from neutron.openstack.common import excutils
from neutron.openstack.common import lockutils
from neutron.plugins.common import constants as plugin_const
-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 nsx_utils
-from neutron.plugins.nicira.common import securitygroups as sg_utils
-from neutron.plugins.nicira.common import sync
-from neutron.plugins.nicira.dbexts import db as nsx_db
-from neutron.plugins.nicira.dbexts import distributedrouter as dist_rtr
-from neutron.plugins.nicira.dbexts import maclearning as mac_db
-from neutron.plugins.nicira.dbexts import networkgw_db
-from neutron.plugins.nicira.dbexts import qos_db
-from neutron.plugins.nicira import dhcpmeta_modes
-from neutron.plugins.nicira.extensions import maclearning as mac_ext
-from neutron.plugins.nicira.extensions import networkgw
-from neutron.plugins.nicira.extensions import qos
-from neutron.plugins.nicira.nsxlib import l2gateway as l2gwlib
-from neutron.plugins.nicira.nsxlib import queue as queuelib
-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 import vmware
+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 nsx_utils
+from neutron.plugins.vmware.common import securitygroups as sg_utils
+from neutron.plugins.vmware.common import sync
+from neutron.plugins.vmware.dbexts import db as nsx_db
+from neutron.plugins.vmware.dbexts import distributedrouter as dist_rtr
+from neutron.plugins.vmware.dbexts import maclearning as mac_db
+from neutron.plugins.vmware.dbexts import networkgw_db
+from neutron.plugins.vmware.dbexts import qos_db
+from neutron.plugins.vmware import dhcpmeta_modes
+from neutron.plugins.vmware.extensions import maclearning as mac_ext
+from neutron.plugins.vmware.extensions import networkgw
+from neutron.plugins.vmware.extensions import qos
+from neutron.plugins.vmware.nsxlib import l2gateway as l2gwlib
+from neutron.plugins.vmware.nsxlib import queue as queuelib
+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 = logging.getLogger("NeutronPlugin")
-NVP_NOSNAT_RULES_ORDER = 10
-NVP_FLOATINGIP_NAT_RULES_ORDER = 224
-NVP_EXTGW_NAT_RULES_ORDER = 255
-NVP_EXT_PATH = os.path.join(os.path.dirname(__file__), 'extensions')
-NVP_DEFAULT_NEXTHOP = '1.1.1.1'
+NSX_NOSNAT_RULES_ORDER = 10
+NSX_FLOATINGIP_NAT_RULES_ORDER = 224
+NSX_EXTGW_NAT_RULES_ORDER = 255
+NSX_DEFAULT_NEXTHOP = '1.1.1.1'
-# Provider network extension - allowed network types for the NVP Plugin
+# Provider network extension - allowed network types for the NSX Plugin
class NetworkTypes:
- """Allowed provider network types for the NVP Plugin."""
+ """Allowed provider network types for the NSX Plugin."""
L3_EXT = 'l3_ext'
STT = 'stt'
GRE = 'gre'
BRIDGE = 'bridge'
-class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin,
+class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
agentschedulers_db.DhcpAgentSchedulerDbMixin,
db_base_plugin_v2.NeutronDbPluginV2,
dhcpmeta_modes.DhcpMetadataAccess,
networkgw_db.NetworkGatewayMixin,
portbindings_db.PortBindingMixin,
portsecurity_db.PortSecurityDbMixin,
- qos_db.NVPQoSDbMixin,
+ qos_db.QoSDbMixin,
securitygroups_db.SecurityGroupDbMixin):
- """L2 Virtual network plugin.
-
- NvpPluginV2 is a Neutron plugin that provides L2 Virtual Network
- functionality using NVP.
- """
supported_extension_aliases = ["allowed-address-pairs",
"binding",
super(NvpPluginV2, self).__init__()
# TODO(salv-orlando): Replace These dicts with
# collections.defaultdict for better handling of default values
- # Routines for managing logical ports in NVP
+ # Routines for managing logical ports in NSX
self.port_special_owners = [l3_db.DEVICE_OWNER_ROUTER_GW,
l3_db.DEVICE_OWNER_ROUTER_INTF]
self._port_drivers = {
'create': {l3_db.DEVICE_OWNER_ROUTER_GW:
- self._nvp_create_ext_gw_port,
+ self._nsx_create_ext_gw_port,
l3_db.DEVICE_OWNER_FLOATINGIP:
- self._nvp_create_fip_port,
+ self._nsx_create_fip_port,
l3_db.DEVICE_OWNER_ROUTER_INTF:
- self._nvp_create_router_port,
+ self._nsx_create_router_port,
networkgw_db.DEVICE_OWNER_NET_GW_INTF:
- self._nvp_create_l2_gw_port,
- 'default': self._nvp_create_port},
+ self._nsx_create_l2_gw_port,
+ 'default': self._nsx_create_port},
'delete': {l3_db.DEVICE_OWNER_ROUTER_GW:
- self._nvp_delete_ext_gw_port,
+ self._nsx_delete_ext_gw_port,
l3_db.DEVICE_OWNER_ROUTER_INTF:
- self._nvp_delete_router_port,
+ self._nsx_delete_router_port,
l3_db.DEVICE_OWNER_FLOATINGIP:
- self._nvp_delete_fip_port,
+ self._nsx_delete_fip_port,
networkgw_db.DEVICE_OWNER_NET_GW_INTF:
- self._nvp_delete_port,
- 'default': self._nvp_delete_port}
+ self._nsx_delete_port,
+ 'default': self._nsx_delete_port}
}
- neutron_extensions.append_api_extensions_path([NVP_EXT_PATH])
- self.nvp_opts = cfg.CONF.NSX
- self.nvp_sync_opts = cfg.CONF.NSX_SYNC
+ neutron_extensions.append_api_extensions_path([vmware.NSX_EXT_PATH])
+ self.nsx_opts = cfg.CONF.NSX
+ self.nsx_sync_opts = cfg.CONF.NSX_SYNC
self.cluster = nsx_utils.create_nsx_cluster(
cfg.CONF,
- self.nvp_opts.concurrent_connections,
- self.nvp_opts.nsx_gen_timeout)
+ self.nsx_opts.concurrent_connections,
+ self.nsx_opts.nsx_gen_timeout)
self.base_binding_dict = {
pbin.VIF_TYPE: pbin.VIF_TYPE_OVS,
# Create a synchronizer instance for backend sync
self._synchronizer = sync.NvpSynchronizer(
self, self.cluster,
- self.nvp_sync_opts.state_sync_interval,
- self.nvp_sync_opts.min_sync_req_delay,
- self.nvp_sync_opts.min_chunk_size,
- self.nvp_sync_opts.max_random_sync_delay)
+ self.nsx_sync_opts.state_sync_interval,
+ self.nsx_sync_opts.min_sync_req_delay,
+ self.nsx_sync_opts.min_chunk_size,
+ self.nsx_sync_opts.max_random_sync_delay)
def _ensure_default_network_gateway(self):
if self._is_default_net_gw_in_sync:
def_network_gw = self._get_network_gateway(ctx,
def_l2_gw_uuid)
except networkgw_db.GatewayNotFound:
- # Create in DB only - don't go on NVP
+ # Create in DB only - don't go to backend
def_gw_data = {'id': def_l2_gw_uuid,
'name': 'default L2 gateway service',
'devices': []}
gw_res_name = networkgw.RESOURCE_NAME.replace('-', '_')
def_network_gw = super(
- NvpPluginV2, self).create_network_gateway(
+ NsxPluginV2, self).create_network_gateway(
ctx, {gw_res_name: def_gw_data})
# In any case set is as default
self._set_default_network_gateway(ctx, def_network_gw['id'])
port_data.get('id', 'fake'), port_data.get('name', 'fake'),
port_data.get('admin_state_up', True), ip_addresses,
port_data.get('mac_address'))
- LOG.debug(_("Created NVP router port:%s"), lrouter_port['uuid'])
+ LOG.debug(_("Created NSX router port:%s"), lrouter_port['uuid'])
except api_exc.NsxApiException:
LOG.exception(_("Unable to create port on NSX logical router %s"),
nsx_router_id)
return lrouter_port
def _update_router_gw_info(self, context, router_id, info):
- # NOTE(salvatore-orlando): We need to worry about rollback of NVP
+ # NOTE(salvatore-orlando): We need to worry about rollback of NSX
# configuration in case of failures in the process
# Ref. LP bug 1102301
router = self._get_router(context, router_id)
# Check whether SNAT rule update should be triggered
- # NVP also supports multiple external networks so there is also
+ # NSX also supports multiple external networks so there is also
# the possibility that NAT rules should be replaced
current_ext_net_id = router.gw_port_id and router.gw_port.network_id
new_ext_net_id = info and info.get('network_id')
add_snat_rules = (enable_snat and
(new_ext_net_id != current_ext_net_id or
not router.enable_snat))
- router = super(NvpPluginV2, self)._update_router_gw_info(
+ router = super(NsxPluginV2, self)._update_router_gw_info(
context, router_id, info, router=router)
# Add/Remove SNAT rules as needed
# Create an elevated context for dealing with metadata access
self.cluster, nsx_router_id,
ip_addresses[0].split('/')[0],
ip_addresses[0].split('/')[0],
- order=NVP_EXTGW_NAT_RULES_ORDER - cidr_prefix,
+ order=NSX_EXTGW_NAT_RULES_ORDER - cidr_prefix,
match_criteria={'source_ip_addresses': cidr})
def _update_router_port_attachment(self, cluster, context,
attachment,
attachment_type,
attachment_vlan)
- LOG.debug(_("Attached %(att)s to NVP router port %(port)s"),
+ LOG.debug(_("Attached %(att)s to NSX router port %(port)s"),
{'att': attachment, 'port': nsx_router_port_id})
except api_exc.NsxApiException:
- # Must remove NVP logical port
+ # Must remove NSX logical port
routerlib.delete_router_lport(cluster, nsx_router_id,
nsx_router_port_id)
- LOG.exception(_("Unable to plug attachment in NVP logical "
+ LOG.exception(_("Unable to plug attachment in NSX logical "
"router port %(r_port_id)s, associated with "
"Neutron %(q_port_id)s"),
{'r_port_id': nsx_router_port_id,
ip.subnet_id).cidr)
return cidrs
- def _nvp_find_lswitch_for_port(self, context, port_data):
+ def _nsx_find_lswitch_for_port(self, context, port_data):
network = self._get_network(context, port_data['network_id'])
network_bindings = nsx_db.get_network_bindings(
context.session, port_data['network_id'])
- max_ports = self.nvp_opts.max_lp_per_overlay_ls
+ max_ports = self.nsx_opts.max_lp_per_overlay_ls
allow_extra_lswitches = False
for network_binding in network_bindings:
if network_binding.binding_type in (NetworkTypes.FLAT,
NetworkTypes.VLAN):
- max_ports = self.nvp_opts.max_lp_per_bridged_ls
+ max_ports = self.nsx_opts.max_lp_per_bridged_ls
allow_extra_lswitches = True
break
try:
LOG.exception(err_desc)
raise nsx_exc.NsxPluginException(err_msg=err_desc)
- def _nvp_create_port_helper(self, session, ls_uuid, port_data,
+ def _nsx_create_port_helper(self, session, ls_uuid, port_data,
do_port_security=True):
# Convert Neutron security groups identifiers into NSX security
# profiles identifiers
def _handle_create_port_exception(self, context, port_id,
ls_uuid, lp_uuid):
with excutils.save_and_reraise_exception():
- # rollback nvp logical port only if it was successfully
- # created on NVP. Should this command fail the original
+ # rollback nsx logical port only if it was successfully
+ # created on NSX. Should this command fail the original
# exception will be raised.
if lp_uuid:
# Remove orphaned port from NSX
switchlib.delete_port(self.cluster, ls_uuid, lp_uuid)
- # rollback the neutron-nvp port mapping
+ # rollback the neutron-nsx port mapping
nsx_db.delete_neutron_nsx_port_mapping(context.session,
port_id)
msg = (_("An exception occurred while creating the "
- "quantum port %s on the NVP plaform") % port_id)
+ "quantum port %s on the NSX plaform") % port_id)
LOG.exception(msg)
- def _nvp_create_port(self, context, port_data):
- """Driver for creating a logical switch port on NVP platform."""
- # FIXME(salvatore-orlando): On the NVP platform we do not really have
+ def _nsx_create_port(self, context, port_data):
+ """Driver for creating a logical switch port on NSX platform."""
+ # FIXME(salvatore-orlando): On the NSX platform we do not really have
# external networks. So if as user tries and create a "regular" VIF
# port on an external network we are unable to actually create.
# However, in order to not break unit tests, we need to still create
# the DB object and return success
if self._network_is_external(context, port_data['network_id']):
- LOG.error(_("NVP plugin does not support regular VIF ports on "
+ LOG.error(_("NSX plugin does not support regular VIF ports on "
"external networks. Port %s will be down."),
port_data['network_id'])
# No need to actually update the DB state - the default is down
lport = None
selected_lswitch = None
try:
- selected_lswitch = self._nvp_find_lswitch_for_port(context,
+ selected_lswitch = self._nsx_find_lswitch_for_port(context,
port_data)
- lport = self._nvp_create_port_helper(context.session,
+ lport = self._nsx_create_port_helper(context.session,
selected_lswitch['uuid'],
port_data,
True)
switchlib.plug_vif_interface(
self.cluster, selected_lswitch['uuid'],
lport['uuid'], "VifAttachment", port_data['id'])
- LOG.debug(_("_nvp_create_port completed for port %(name)s "
+ LOG.debug(_("_nsx_create_port completed for port %(name)s "
"on network %(network_id)s. The new port id is "
"%(id)s."), port_data)
except (api_exc.NsxApiException, q_exc.NeutronException):
except q_exc.NotFound:
LOG.debug(_("NSX Port %s already gone"), lport['uuid'])
- def _nvp_delete_port(self, context, port_data):
- # FIXME(salvatore-orlando): On the NVP platform we do not really have
+ def _nsx_delete_port(self, context, port_data):
+ # FIXME(salvatore-orlando): On the NSX platform we do not really have
# external networks. So deleting regular ports from external networks
# does not make sense. However we cannot raise as this would break
# unit tests.
if self._network_is_external(context, port_data['network_id']):
- LOG.error(_("NVP plugin does not support regular VIF ports on "
+ LOG.error(_("NSX plugin does not support regular VIF ports on "
"external networks. Port %s will be down."),
port_data['network_id'])
return
nsx_switch_id, nsx_port_id = nsx_utils.get_nsx_switch_and_port_id(
context.session, self.cluster, port_data['id'])
if not nsx_port_id:
- LOG.debug(_("Port '%s' was already deleted on NVP platform"), id)
+ LOG.debug(_("Port '%s' was already deleted on NSX platform"), id)
return
# TODO(bgh): if this is a bridged network and the lswitch we just got
# back will have zero ports after the delete we should garbage collect
# the lswitch.
try:
switchlib.delete_port(self.cluster, nsx_switch_id, nsx_port_id)
- LOG.debug(_("_nvp_delete_port completed for port %(port_id)s "
+ LOG.debug(_("_nsx_delete_port completed for port %(port_id)s "
"on network %(net_id)s"),
{'port_id': port_data['id'],
'net_id': port_data['network_id']})
except q_exc.NotFound:
- LOG.warning(_("Port %s not found in NVP"), port_data['id'])
+ LOG.warning(_("Port %s not found in NSX"), port_data['id'])
- def _nvp_delete_router_port(self, context, port_data):
+ def _nsx_delete_router_port(self, context, port_data):
# Delete logical router port
nsx_router_id = nsx_utils.get_nsx_router_id(
context.session, self.cluster, port_data['device_id'])
nsx_switch_id, nsx_port_id = nsx_utils.get_nsx_switch_and_port_id(
context.session, self.cluster, port_data['id'])
if not nsx_port_id:
- LOG.warn(_("Neutron port %(port_id)s not found on NVP backend. "
+ LOG.warn(_("Neutron port %(port_id)s not found on NSX backend. "
"Terminating delete operation. A dangling router port "
"might have been left on router %(router_id)s"),
{'port_id': port_data['id'],
nsx_port_id)
# Delete logical switch port
- self._nvp_delete_port(context, port_data)
+ self._nsx_delete_port(context, port_data)
- def _nvp_create_router_port(self, context, port_data):
+ def _nsx_create_router_port(self, context, port_data):
"""Driver for creating a switch port to be connected to a router."""
# No router ports on external networks!
if self._network_is_external(context, port_data['network_id']):
ls_port = None
selected_lswitch = None
try:
- selected_lswitch = self._nvp_find_lswitch_for_port(
+ selected_lswitch = self._nsx_find_lswitch_for_port(
context, port_data)
# Do not apply port security here!
- ls_port = self._nvp_create_port_helper(
+ ls_port = self._nsx_create_port_helper(
context.session, selected_lswitch['uuid'],
port_data, False)
# Assuming subnet being attached is on first fixed ip
nsx_db.add_neutron_nsx_port_mapping(
context.session, port_data['id'],
selected_lswitch['uuid'], ls_port['uuid'])
- LOG.debug(_("_nvp_create_router_port completed for port "
+ LOG.debug(_("_nsx_create_router_port completed for port "
"%(name)s on network %(network_id)s. The new "
"port id is %(id)s."),
port_data)
% nsx_router_id))
return lr_port
- @lockutils.synchronized('nicira', 'neutron-')
- def _nvp_create_ext_gw_port(self, context, port_data):
- """Driver for creating an external gateway port on NVP platform."""
- # TODO(salvatore-orlando): Handle NVP resource
+ @lockutils.synchronized('vmware', 'neutron-')
+ def _nsx_create_ext_gw_port(self, context, port_data):
+ """Driver for creating an external gateway port on NSX platform."""
+ # TODO(salvatore-orlando): Handle NSX resource
# rollback when something goes not quite as expected
lr_port = self._find_router_gw_port(context, port_data)
ip_addresses = self._build_ip_address_list(context,
port_data['fixed_ips'])
- # This operation actually always updates a NVP logical port
+ # This operation actually always updates a NSX logical port
# instead of creating one. This is because the gateway port
- # is created at the same time as the NVP logical router, otherwise
- # the fabric status of the NVP router will be down.
+ # is created at the same time as the NSX logical router, otherwise
+ # the fabric status of the NSX router will be down.
# admin_status should always be up for the gateway port
# regardless of what the user specifies in neutron
nsx_router_id = nsx_utils.get_nsx_router_id(
physical_network,
ext_network[pnet.SEGMENTATION_ID])
- LOG.debug(_("_nvp_create_ext_gw_port completed on external network "
+ LOG.debug(_("_nsx_create_ext_gw_port completed on external network "
"%(ext_net_id)s, attached to router:%(router_id)s. "
- "NVP port id is %(nvp_port_id)s"),
+ "NSX port id is %(nsx_port_id)s"),
{'ext_net_id': port_data['network_id'],
'router_id': nsx_router_id,
- 'nvp_port_id': lr_port['uuid']})
+ 'nsx_port_id': lr_port['uuid']})
- @lockutils.synchronized('nicira', 'neutron-')
- def _nvp_delete_ext_gw_port(self, context, port_data):
+ @lockutils.synchronized('vmware', 'neutron-')
+ def _nsx_delete_ext_gw_port(self, context, port_data):
lr_port = self._find_router_gw_port(context, port_data)
- # TODO(salvatore-orlando): Handle NVP resource
+ # TODO(salvatore-orlando): Handle NSX resource
# rollback when something goes not quite as expected
try:
- # Delete is actually never a real delete, otherwise the NVP
+ # Delete is actually never a real delete, otherwise the NSX
# logical router will stop working
router_id = port_data['device_id']
nsx_router_id = nsx_utils.get_nsx_router_id(
except api_exc.ResourceNotFound:
raise nsx_exc.NsxPluginException(
err_msg=_("Logical router resource %s not found "
- "on NVP platform") % router_id)
+ "on NSX platform") % router_id)
except api_exc.NsxApiException:
raise nsx_exc.NsxPluginException(
err_msg=_("Unable to update logical router"
- " on NVP Platform"))
- LOG.debug(_("_nvp_delete_ext_gw_port completed on external network "
+ "on NSX Platform"))
+ LOG.debug(_("_nsx_delete_ext_gw_port completed on external network "
"%(ext_net_id)s, attached to NSX router:%(router_id)s"),
{'ext_net_id': port_data['network_id'],
'router_id': nsx_router_id})
- def _nvp_create_l2_gw_port(self, context, port_data):
+ def _nsx_create_l2_gw_port(self, context, port_data):
"""Create a switch port, and attach it to a L2 gateway attachment."""
- # FIXME(salvatore-orlando): On the NVP platform we do not really have
+ # FIXME(salvatore-orlando): On the NSX platform we do not really have
# external networks. So if as user tries and create a "regular" VIF
# port on an external network we are unable to actually create.
# However, in order to not break unit tests, we need to still create
# the DB object and return success
if self._network_is_external(context, port_data['network_id']):
- LOG.error(_("NVP plugin does not support regular VIF ports on "
+ LOG.error(_("NSX plugin does not support regular VIF ports on "
"external networks. Port %s will be down."),
port_data['network_id'])
# No need to actually update the DB state - the default is down
return port_data
lport = None
try:
- selected_lswitch = self._nvp_find_lswitch_for_port(
+ selected_lswitch = self._nsx_find_lswitch_for_port(
context, port_data)
- lport = self._nvp_create_port_helper(
+ lport = self._nsx_create_port_helper(
context.session,
selected_lswitch['uuid'],
port_data,
switchlib.delete_port(self.cluster,
selected_lswitch['uuid'],
lport['uuid'])
- LOG.debug(_("_nvp_create_l2_gw_port completed for port %(name)s "
+ LOG.debug(_("_nsx_create_l2_gw_port completed for port %(name)s "
"on network %(network_id)s. The new port id "
"is %(id)s."), port_data)
- def _nvp_create_fip_port(self, context, port_data):
- # As we do not create ports for floating IPs in NVP,
+ def _nsx_create_fip_port(self, context, port_data):
+ # As we do not create ports for floating IPs in NSX,
# this is a no-op driver
pass
- def _nvp_delete_fip_port(self, context, port_data):
- # As we do not create ports for floating IPs in NVP,
+ def _nsx_delete_fip_port(self, context, port_data):
+ # As we do not create ports for floating IPs in NSX,
# this is a no-op driver
pass
def _extend_fault_map(self):
"""Extends the Neutron Fault Map.
- Exceptions specific to the NVP Plugin are mapped to standard
+ Exceptions specific to the NSX Plugin are mapped to standard
HTTP Exceptions.
"""
base.FAULT_MAP.update({nsx_exc.InvalidNovaZone:
if not multiprovider:
multiprovider = nsx_db.is_multiprovider_network(context.session,
network['id'])
- # With NVP plugin 'normal' overlay networks will have no binding
+ # With NSX plugin 'normal' overlay networks will have no binding
# TODO(salvatore-orlando) make sure users can specify a distinct
# phy_uuid as 'provider network' for STT net type
if bindings:
main_ls['display_name'],
network['tenant_id'],
tags=tags)
- transport_zone_config = self._convert_to_nvp_transport_zones(
+ transport_zone_config = self._convert_to_nsx_transport_zones(
cluster, network, bindings=network_bindings)
selected_lswitch = switchlib.create_lswitch(
cluster, network.id, network.tenant_id,
"logical network %s"), network.id)
raise nsx_exc.NoMorePortsException(network=network.id)
- def _convert_to_nvp_transport_zones(self, cluster, network=None,
+ def _convert_to_nsx_transport_zones(self, cluster, network=None,
bindings=None):
- nvp_transport_zones_config = []
+ nsx_transport_zones_config = []
- # Convert fields from provider request to nvp format
+ # Convert fields from provider request to nsx format
if (network and not attr.is_attr_set(
network.get(mpnet.SEGMENTS))):
return [{"zone_uuid": cluster.default_tz_uuid,
"transport_type": cfg.CONF.NSX.default_transport_type}]
- # Convert fields from db to nvp format
+ # Convert fields from db to nsx format
if bindings:
transport_entry = {}
for binding in bindings:
else:
transport_entry['transport_type'] = binding.binding_type
transport_entry['zone_uuid'] = binding.phy_uuid
- nvp_transport_zones_config.append(transport_entry)
- return nvp_transport_zones_config
+ nsx_transport_zones_config.append(transport_entry)
+ return nsx_transport_zones_config
for transport_zone in network.get(mpnet.SEGMENTS):
for value in [pnet.NETWORK_TYPE, pnet.PHYSICAL_NETWORK,
transport_entry['zone_uuid'] = (
transport_zone[pnet.PHYSICAL_NETWORK] or
cluster.default_tz_uuid)
- nvp_transport_zones_config.append(transport_entry)
- return nvp_transport_zones_config
+ nsx_transport_zones_config.append(transport_entry)
+ return nsx_transport_zones_config
def _convert_to_transport_zones_dict(self, network):
"""Converts the provider request body to multiprovider.
# Process the provider network extension
provider_type = self._convert_to_transport_zones_dict(net_data)
self._validate_provider_create(context, net_data)
- # Replace ATTR_NOT_SPECIFIED with None before sending to NVP
+ # Replace ATTR_NOT_SPECIFIED with None before sending to NSX
for key, value in network['network'].iteritems():
if value is attr.ATTR_NOT_SPECIFIED:
net_data[key] = None
- # FIXME(arosen) implement admin_state_up = False in NVP
+ # FIXME(arosen) implement admin_state_up = False in NSX
if net_data['admin_state_up'] is False:
LOG.warning(_("Network with admin_state_up=False are not yet "
"supported by this plugin. Ignoring setting for "
"network %s"), net_data.get('name', '<unknown>'))
- transport_zone_config = self._convert_to_nvp_transport_zones(
+ transport_zone_config = self._convert_to_nsx_transport_zones(
self.cluster, net_data)
external = net_data.get(ext_net_extn.EXTERNAL)
# NOTE(salv-orlando): Pre-generating uuid for Neutron
shared=net_data.get(attr.SHARED))
with context.session.begin(subtransactions=True):
- new_net = super(NvpPluginV2, self).create_network(context,
+ new_net = super(NsxPluginV2, self).create_network(context,
network)
# Process port security extension
self._process_network_port_security_create(
def delete_network(self, context, id):
external = self._network_is_external(context, id)
- # Before deleting ports, ensure the peer of a NVP logical
+ # Before deleting ports, ensure the peer of a NSX logical
# port with a patch attachment is removed too
port_filter = {'network_id': [id],
'device_owner': ['network:router_interface']}
if not external:
lswitch_ids = nsx_utils.get_nsx_switch_ids(
context.session, self.cluster, id)
- super(NvpPluginV2, self).delete_network(context, id)
+ super(NsxPluginV2, self).delete_network(context, id)
# clean up network owned ports
for port in router_iface_ports:
try:
nsx_switch_id,
nsx_port_id)
else:
- LOG.warning(_("A nvp lport identifier was not found for "
+ LOG.warning(_("A nsx lport identifier was not found for "
"neutron port '%s'. Unable to remove "
"the peer router port for this switch port"),
port['id'])
"port '%s' has already been deleted."),
nsx_port_id)
- # Do not go to NVP for external networks
+ # Do not go to NSX for external networks
if not external:
try:
switchlib.delete_networks(self.cluster, id, lswitch_ids)
LOG.debug(_("delete_network completed for tenant: %s"),
context.tenant_id)
except q_exc.NotFound:
- LOG.warning(_("Did not found lswitch %s in NVP"), id)
+ LOG.warning(_("Did not found lswitch %s in NSX"), id)
self.handle_network_dhcp_access(context, id, action='delete_network')
def get_network(self, context, id, fields=None):
with context.session.begin(subtransactions=True):
# goto to the plugin DB and fetch the network
network = self._get_network(context, id)
- if (self.nvp_sync_opts.always_read_status or
+ if (self.nsx_sync_opts.always_read_status or
fields and 'status' in fields):
- # External networks are not backed by nvp lswitches
+ # External networks are not backed by nsx lswitches
if not network.external:
# Perform explicit state synchronization
self._synchronizer.synchronize_network(context, network)
def get_networks(self, context, filters=None, fields=None):
filters = filters or {}
with context.session.begin(subtransactions=True):
- networks = super(NvpPluginV2, self).get_networks(context, filters)
+ networks = super(NsxPluginV2, self).get_networks(context, filters)
for net in networks:
self._extend_network_dict_provider(context, net)
return [self._fields(network, fields) for network in networks]
raise NotImplementedError(_("admin_state_up=False networks "
"are not supported."))
with context.session.begin(subtransactions=True):
- net = super(NvpPluginV2, self).update_network(context, id, network)
+ net = super(NsxPluginV2, self).update_network(context, id, network)
if psec.PORTSECURITY in network['network']:
self._process_network_port_security_update(
context, network['network'], net)
port_data['status'] = constants.PORT_STATUS_DOWN
with context.session.begin(subtransactions=True):
# First we allocate port in neutron database
- neutron_db = super(NvpPluginV2, self).create_port(context, port)
+ neutron_db = super(NsxPluginV2, self).create_port(context, port)
neutron_port_id = neutron_db['id']
# Update fields obtained from neutron db (eg: MAC address)
port["port"].update(neutron_db)
elif mac_ext.MAC_LEARNING in port_data:
port_data.pop(mac_ext.MAC_LEARNING)
- LOG.debug(_("create_port completed on NVP for tenant "
+ LOG.debug(_("create_port completed on NSX for tenant "
"%(tenant_id)s: (%(id)s)"), port_data)
self._process_portbindings_create_and_update(context,
port['port'],
port_data)
- # DB Operation is complete, perform NVP operation
+ # DB Operation is complete, perform NSX operation
try:
port_data = port['port'].copy()
port_create_func = self._port_drivers['create'].get(
port_create_func(context, port_data)
except q_exc.NotFound:
LOG.warning(_("Logical switch for network %s was not "
- "found in NVP."), port_data['network_id'])
+ "found in NSX."), port_data['network_id'])
# Put port in error on quantum DB
with context.session.begin(subtransactions=True):
port = self._get_port(context, neutron_port_id)
# Port must be removed from Quantum DB
with excutils.save_and_reraise_exception():
LOG.error(_("Unable to create port or set port "
- "attachment in NVP."))
+ "attachment in NSX."))
with context.session.begin(subtransactions=True):
self._delete_port(context, neutron_port_id)
has_addr_pairs = self._check_update_has_allowed_address_pairs(port)
with context.session.begin(subtransactions=True):
- ret_port = super(NvpPluginV2, self).update_port(
+ ret_port = super(NsxPluginV2, self).update_port(
context, id, port)
# Save current mac learning state to check whether it's
# being updated or not
# that port does not have any security groups already on it.
filters = {'port_id': [id]}
security_groups = (
- super(NvpPluginV2, self)._get_port_security_group_bindings(
+ super(NsxPluginV2, self)._get_port_security_group_bindings(
context, filters)
)
if security_groups and not delete_security_groups:
ret_port.get(mac_ext.MAC_LEARNING),
ret_port.get(addr_pair.ADDRESS_PAIRS))
- # Update the port status from nvp. If we fail here hide it
+ # Update the port status from nsx. If we fail here hide it
# since the port was successfully updated but we were not
# able to retrieve the status.
ret_port['status'] = switchlib.get_port_status(
LOG.exception(_("Unable to update port id: %s."),
nsx_port_id)
- # If nvp_port_id is not in database or in nvp put in error state.
+ # If nsx_port_id is not in database or in nsx put in error state.
else:
ret_port['status'] = constants.PORT_STATUS_ERROR
# metadata_dhcp_host_route
self.handle_port_metadata_access(
context, neutron_db_port, is_delete=True)
- super(NvpPluginV2, self).delete_port(context, id)
+ super(NsxPluginV2, self).delete_port(context, id)
# Delete qos queue if possible
if queue:
self.delete_qos_queue(context, queue[0]['queue_id'], False)
def get_port(self, context, id, fields=None):
with context.session.begin(subtransactions=True):
- if (self.nvp_sync_opts.always_read_status or
+ if (self.nsx_sync_opts.always_read_status or
fields and 'status' in fields):
# Perform explicit state synchronization
db_port = self._get_port(context, id)
context, db_port)
return self._make_port_dict(db_port, fields)
else:
- return super(NvpPluginV2, self).get_port(context, id, fields)
+ return super(NsxPluginV2, self).get_port(context, id, fields)
def get_router(self, context, id, fields=None):
- if (self.nvp_sync_opts.always_read_status or
+ if (self.nsx_sync_opts.always_read_status or
fields and 'status' in fields):
db_router = self._get_router(context, id)
# Perform explicit state synchronization
context, db_router)
return self._make_router_dict(db_router, fields)
else:
- return super(NvpPluginV2, self).get_router(context, id, fields)
+ return super(NsxPluginV2, self).get_router(context, id, fields)
def _create_lrouter(self, context, router, nexthop):
tenant_id = self._get_tenant_id_for_create(context, router)
tenant_id, router['name'], nexthop,
distributed=attr.is_attr_set(distributed) and distributed)
except nsx_exc.InvalidVersion:
- msg = _("Cannot create a distributed router with the NVP "
+ msg = _("Cannot create a distributed router with the NSX "
"platform currently in execution. Please, try "
"without specifying the 'distributed' attribute.")
LOG.exception(msg)
raise q_exc.BadRequest(resource='router', msg=msg)
except api_exc.NsxApiException:
- err_msg = _("Unable to create logical router on NVP Platform")
+ err_msg = _("Unable to create logical router on NSX Platform")
LOG.exception(err_msg)
raise nsx_exc.NsxPluginException(err_msg=err_msg)
{'router_uuid': lrouter['uuid'],
'def_l3_gw_svc':
self.cluster.default_l3_gw_service_uuid})
- # Try and remove logical router from NVP
+ # Try and remove logical router from NSX
routerlib.delete_lrouter(self.cluster, lrouter['uuid'])
# Return user a 500 with an apter message
raise nsx_exc.NsxPluginException(
def create_router(self, context, router):
# NOTE(salvatore-orlando): We completely override this method in
- # order to be able to use the NVP ID as Neutron ID
+ # order to be able to use the NSX ID as Neutron ID
# TODO(salvatore-orlando): Propose upstream patch for allowing
# 3rd parties to specify IDs as we do with l2 plugin
r = router['router']
has_gw_info = False
tenant_id = self._get_tenant_id_for_create(context, r)
- # default value to set - nvp wants it (even if we don't have it)
- nexthop = NVP_DEFAULT_NEXTHOP
+ # default value to set - nsx wants it (even if we don't have it)
+ nexthop = NSX_DEFAULT_NEXTHOP
# if external gateway info are set, then configure nexthop to
# default external gateway
if 'external_gateway_info' in r and r.get('external_gateway_info'):
del r['external_gateway_info']
# The following DB read will be performed again when updating
# gateway info. This is not great, but still better than
- # creating NVP router here and updating it later
+ # creating NSX router here and updating it later
network_id = (gw_info.get('network_id', None) if gw_info
else None)
if network_id:
neutron_router_id = str(uuid.uuid4())
r['id'] = neutron_router_id
lrouter = self._create_lrouter(context, r, nexthop)
- # Update 'distributed' with value returned from NVP
+ # Update 'distributed' with value returned from NSX
# This will be useful for setting the value if the API request
# did not specify any value for the 'distributed' attribute
# Platforms older than 3.x do not support the attribute
if has_gw_info:
# NOTE(salv-orlando): This operation has been moved out of the
- # database transaction since it performs several NVP queries,
+ # database transaction since it performs several NSX queries,
# ithis ncreasing the risk of deadlocks between eventlet and
# sqlalchemy operations.
# Set external gateway and remove router in case of failure
gw_info = r['external_gateway_info']
# The following DB read will be performed again when updating
# gateway info. This is not great, but still better than
- # creating NVP router here and updating it later
+ # creating NSX router here and updating it later
network_id = (gw_info.get('network_id', None) if gw_info
else None)
if network_id:
context, router_id, r.get('name'),
nexthop, routes=r.get('routes'))
# NOTE(salv-orlando): The exception handling below is not correct, but
- # unfortunately nvplib raises a neutron notfound exception when an
+ # unfortunately nsxlib raises a neutron notfound exception when an
# object is not found in the underlying backend
except q_exc.NotFound:
# Put the router in ERROR status
router_db['status'] = constants.NET_STATUS_ERROR
raise nsx_exc.NsxPluginException(
err_msg=_("Logical router %s not found "
- "on NVP Platform") % router_id)
+ "on NSX Platform") % router_id)
except api_exc.NsxApiException:
raise nsx_exc.NsxPluginException(
- err_msg=_("Unable to update logical router on NVP Platform"))
+ err_msg=_("Unable to update logical router on NSX Platform"))
except nsx_exc.InvalidVersion:
- msg = _("Request cannot contain 'routes' with the NVP "
+ msg = _("Request cannot contain 'routes' with the NSX "
"platform currently in execution. Please, try "
"without specifying the static routes.")
LOG.exception(msg)
raise q_exc.BadRequest(resource='router', msg=msg)
try:
- return super(NvpPluginV2, self).update_router(context,
+ return super(NsxPluginV2, self).update_router(context,
router_id, router)
except (extraroute.InvalidRoutes,
extraroute.RouterInterfaceInUseByRoute,
extraroute.RoutesExhausted):
with excutils.save_and_reraise_exception():
- # revert changes made to NVP
+ # revert changes made to NSX
self._update_lrouter_routes(
context, router_id, previous_routes)
# NOTE(salv-orlando): These checks will be repeated anyway when
# calling the superclass. This is wasteful, but is the simplest
# way of ensuring a consistent removal of the router both in
- # the neutron Database and in the NVP backend.
+ # the neutron Database and in the NSX backend.
# TODO(salv-orlando): split pre-delete checks and actual
# deletion in superclass.
except q_exc.NotFound:
# This is not a fatal error, but needs to be logged
LOG.warning(_("Logical router '%s' not found "
- "on NVP Platform"), router_id)
+ "on NSX Platform"), router_id)
except api_exc.NsxApiException:
raise nsx_exc.NsxPluginException(
err_msg=(_("Unable to delete logical router '%s' "
- "on NVP Platform") % nsx_router_id))
+ "on NSX Platform") % nsx_router_id))
# Remove the NSX mapping first in order to ensure a mapping to
# a non-existent NSX router is not left in the DB in case of
# failure while removing the router from the neutron DB
"%(d_exc)s"), {'router_id': router_id,
'd_exc': str(d_exc)})
# Perform the actual delete on the Neutron DB
- super(NvpPluginV2, self).delete_router(context, router_id)
+ super(NsxPluginV2, self).delete_router(context, router_id)
def _add_subnet_snat_rule(self, context, router, subnet):
gw_port = router.gw_port
context.session, self.cluster, router['id'])
routerlib.create_lrouter_snat_rule(
self.cluster, nsx_router_id, snat_ip, snat_ip,
- order=NVP_EXTGW_NAT_RULES_ORDER - cidr_prefix,
+ order=NSX_EXTGW_NAT_RULES_ORDER - cidr_prefix,
match_criteria={'source_ip_addresses': subnet['cidr']})
def _delete_subnet_snat_rule(self, context, router, subnet):
def add_router_interface(self, context, router_id, interface_info):
# When adding interface by port_id we need to create the
- # peer port on the nvp logical router in this routine
+ # peer port on the nsx logical router in this routine
port_id = interface_info.get('port_id')
- router_iface_info = super(NvpPluginV2, self).add_router_interface(
+ router_iface_info = super(NsxPluginV2, self).add_router_interface(
context, router_id, interface_info)
# router_iface_info will always have a subnet_id attribute
subnet_id = router_iface_info['subnet_id']
self._add_subnet_snat_rule(context, router, subnet)
routerlib.create_lrouter_nosnat_rule(
self.cluster, nsx_router_id,
- order=NVP_NOSNAT_RULES_ORDER,
+ order=NSX_NOSNAT_RULES_ORDER,
match_criteria={'destination_ip_addresses': subnet['cidr']})
- # Ensure the NVP logical router has a connection to a 'metadata access'
+ # Ensure the NSX logical router has a connection to a 'metadata access'
# network (with a proxy listening on its DHCP port), by creating it
# if needed.
self.handle_router_metadata_access(
subnet_id=subnet_id)
# Finally remove the data from the Neutron DB
# This will also destroy the port on the logical switch
- info = super(NvpPluginV2, self).remove_router_interface(
+ info = super(NsxPluginV2, self).remove_router_interface(
context, router_id, interface_info)
# Ensure the connection to the 'metadata access network'
except api_exc.ResourceNotFound:
raise nsx_exc.NsxPluginException(
err_msg=(_("Logical router resource %s not found "
- "on NVP platform") % router_id))
+ "on NSX platform") % router_id))
except api_exc.NsxApiException:
raise nsx_exc.NsxPluginException(
err_msg=(_("Unable to update logical router"
- "on NVP Platform")))
+ "on NSX Platform")))
return info
def _retrieve_and_delete_nat_rules(self, context, floating_ip_address,
except api_exc.NsxApiException:
LOG.exception(_("An error occurred while removing NAT rules "
- "on the NVP platform for floating ip:%s"),
+ "on the NSX platform for floating ip:%s"),
floating_ip_address)
raise
except nsx_exc.NatRuleMismatch:
# Do not surface to the user
LOG.warning(_("An incorrect number of matching NAT rules "
- "was found on the NVP platform"))
+ "was found on the NSX platform"))
def _remove_floatingip_address(self, context, fip_db):
# Remove floating IP address from logical router port
context, floating_ip, internal_ip, nsx_router_id)
# Fetch logical port of router's external gateway
# Fetch logical port of router's external gateway
- nvp_floating_ips = self._build_ip_address_list(
+ nsx_floating_ips = self._build_ip_address_list(
context.elevated(), external_port['fixed_ips'])
floating_ip = floatingip_db['floating_ip_address']
# Retrieve and delete existing NAT rules, if any
context, floating_ip, old_internal_ip, nsx_old_router_id)
routerlib.update_lrouter_port_ips(
self.cluster, nsx_old_router_id, nsx_gw_port_id,
- ips_to_add=[], ips_to_remove=nvp_floating_ips)
+ ips_to_add=[], ips_to_remove=nsx_floating_ips)
if router_id:
nsx_gw_port_id = routerlib.find_router_gw_port(
# Setup DNAT rules for the floating IP
routerlib.create_lrouter_dnat_rule(
self.cluster, nsx_router_id, internal_ip,
- order=NVP_FLOATINGIP_NAT_RULES_ORDER,
+ order=NSX_FLOATINGIP_NAT_RULES_ORDER,
match_criteria={'destination_ip_addresses':
floating_ip})
# Setup SNAT rules for the floating IP
subnet_ids=subnet_ids)[0]
routerlib.create_lrouter_snat_rule(
self.cluster, nsx_router_id, floating_ip, floating_ip,
- order=NVP_NOSNAT_RULES_ORDER - 1,
+ order=NSX_NOSNAT_RULES_ORDER - 1,
match_criteria={'source_ip_addresses':
internal_subnet_cidr,
'destination_ip_addresses':
# using floating is the floating ip itself.
routerlib.create_lrouter_snat_rule(
self.cluster, nsx_router_id, floating_ip, floating_ip,
- order=NVP_FLOATINGIP_NAT_RULES_ORDER,
+ order=NSX_FLOATINGIP_NAT_RULES_ORDER,
match_criteria={'source_ip_addresses': internal_ip})
# Add Floating IP address to router_port
routerlib.update_lrouter_port_ips(
self.cluster, nsx_router_id, nsx_gw_port_id,
- ips_to_add=nvp_floating_ips, ips_to_remove=[])
+ ips_to_add=nsx_floating_ips, ips_to_remove=[])
except api_exc.NsxApiException:
LOG.exception(_("An error occurred while creating NAT "
- "rules on the NVP platform for floating "
+ "rules on the NSX platform for floating "
"ip:%(floating_ip)s mapped to "
"internal ip:%(internal_ip)s"),
{'floating_ip': floating_ip,
min_num_rules_expected=1)
# Remove floating IP address from logical router port
self._remove_floatingip_address(context, fip_db)
- return super(NvpPluginV2, self).delete_floatingip(context, id)
+ return super(NsxPluginV2, self).delete_floatingip(context, id)
def disassociate_floatingips(self, context, port_id):
try:
LOG.debug(_("The port '%s' is not associated with floating IPs"),
port_id)
except q_exc.NotFound:
- LOG.warning(_("Nat rules not found in nvp for port: %s"), id)
+ LOG.warning(_("Nat rules not found in nsx for port: %s"), id)
- super(NvpPluginV2, self).disassociate_floatingips(context, port_id)
+ super(NsxPluginV2, self).disassociate_floatingips(context, port_id)
def create_network_gateway(self, context, network_gateway):
"""Create a layer-2 network gateway.
- Create the gateway service on NVP platform and corresponding data
+ Create the gateway service on NSX platform and corresponding data
structures in Neutron datase.
"""
# Ensure the default gateway in the config file is in sync with the db
self._ensure_default_network_gateway()
- # Need to re-do authZ checks here in order to avoid creation on NVP
+ # Need to re-do authZ checks here in order to avoid creation on NSX
gw_data = network_gateway[networkgw.RESOURCE_NAME.replace('-', '_')]
tenant_id = self._get_tenant_id_for_create(context, gw_data)
devices = gw_data['devices']
LOG.exception(err_msg)
raise nsx_exc.NsxPluginException(err_msg=err_msg)
gw_data['id'] = nsx_uuid
- return super(NvpPluginV2, self).create_network_gateway(context,
+ return super(NsxPluginV2, self).create_network_gateway(context,
network_gateway)
def delete_network_gateway(self, context, gateway_id):
"""Remove a layer-2 network gateway.
- Remove the gateway service from NVP platform and corresponding data
+ Remove the gateway service from NSX platform and corresponding data
structures in Neutron datase.
"""
# Ensure the default gateway in the config file is in sync with the db
self._ensure_default_network_gateway()
with context.session.begin(subtransactions=True):
try:
- super(NvpPluginV2, self).delete_network_gateway(
+ super(NsxPluginV2, self).delete_network_gateway(
context, gateway_id)
l2gwlib.delete_l2_gw_service(self.cluster, gateway_id)
except api_exc.ResourceNotFound:
# Do not cause a 500 to be returned to the user if
- # the corresponding NVP resource does not exist
+ # the corresponding NSX resource does not exist
LOG.exception(_("Unable to remove gateway service from "
- "NVP plaform - the resource was not found"))
+ "NSX plaform - the resource was not found"))
def get_network_gateway(self, context, id, fields=None):
# Ensure the default gateway in the config file is in sync with the db
self._ensure_default_network_gateway()
- return super(NvpPluginV2, self).get_network_gateway(context,
+ return super(NsxPluginV2, self).get_network_gateway(context,
id, fields)
def get_network_gateways(self, context, filters=None, fields=None):
# Ensure the default gateway in the config file is in sync with the db
self._ensure_default_network_gateway()
# Ensure the tenant_id attribute is populated on returned gateways
- net_gateways = super(NvpPluginV2,
+ net_gateways = super(NsxPluginV2,
self).get_network_gateways(context,
filters,
fields)
except api_exc.NsxApiException:
# Consider backend failures as non-fatal, but still warn
# because this might indicate something dodgy is going on
- LOG.warn(_("Unable to update name on NVP backend "
+ LOG.warn(_("Unable to update name on NSX backend "
"for network gateway: %s"), id)
- return super(NvpPluginV2, self).update_network_gateway(
+ return super(NsxPluginV2, self).update_network_gateway(
context, id, network_gateway)
def connect_network(self, context, network_gateway_id,
# Ensure the default gateway in the config file is in sync with the db
self._ensure_default_network_gateway()
try:
- return super(NvpPluginV2, self).connect_network(
+ return super(NsxPluginV2, self).connect_network(
context, network_gateway_id, network_mapping_info)
except api_exc.Conflict:
raise nsx_exc.L2GatewayAlreadyInUse(gateway=network_gateway_id)
network_mapping_info):
# Ensure the default gateway in the config file is in sync with the db
self._ensure_default_network_gateway()
- return super(NvpPluginV2, self).disconnect_network(
+ return super(NsxPluginV2, self).disconnect_network(
context, network_gateway_id, network_mapping_info)
def create_security_group(self, context, security_group, default_sg=False):
self.cluster, neutron_id, tenant_id, s)
with context.session.begin(subtransactions=True):
s['id'] = neutron_id
- sec_group = super(NvpPluginV2, self).create_security_group(
+ sec_group = super(NsxPluginV2, self).create_security_group(
context, security_group, default_sg)
context.session.flush()
# Add mapping between neutron and nsx identifiers
:param security_group_id: security group rule to remove.
"""
with context.session.begin(subtransactions=True):
- security_group = super(NvpPluginV2, self).get_security_group(
+ security_group = super(NsxPluginV2, self).get_security_group(
context, security_group_id)
if not security_group:
raise ext_sg.SecurityGroupNotFound(id=security_group_id)
raise ext_sg.SecurityGroupCannotRemoveDefault()
filters = {'security_group_id': [security_group['id']]}
- if super(NvpPluginV2, self)._get_port_security_group_bindings(
+ if super(NsxPluginV2, self)._get_port_security_group_bindings(
context, filters):
raise ext_sg.SecurityGroupInUse(id=security_group['id'])
nsx_sec_profile_id = nsx_utils.get_nsx_security_group_id(
raise nsx_exc.NsxPluginException(
_("Unable to remove security group %s from backend"),
security_group['id'])
- return super(NvpPluginV2, self).delete_security_group(
+ return super(NsxPluginV2, self).delete_security_group(
context, security_group_id)
def _validate_security_group_rules(self, context, rules):
"protocol: %s") % r['protocol'])
raise q_exc.BadRequest(resource='security_group_rule',
msg=msg)
- return super(NvpPluginV2, self)._validate_security_group_rules(context,
+ return super(NsxPluginV2, self)._validate_security_group_rules(context,
rules)
def create_security_group_rule(self, context, security_group_rule):
tenant_id = self._get_tenant_id_for_create(context, s)
# TODO(arosen) is there anyway we could avoid having the update of
- # the security group rules in nvp outside of this transaction?
+ # the security group rules in nsx outside of this transaction?
with context.session.begin(subtransactions=True):
self._ensure_default_security_group(context, tenant_id)
security_group_id = self._validate_security_group_rules(
context, security_group_rule)
# Check to make sure security group exists
- security_group = super(NvpPluginV2, self).get_security_group(
+ security_group = super(NsxPluginV2, self).get_security_group(
context, security_group_id)
if not security_group:
nsx_sec_profile_id,
combined_rules)
return super(
- NvpPluginV2, self).create_security_group_rule_bulk_native(
+ NsxPluginV2, self).create_security_group_rule_bulk_native(
context, security_group_rule)
def delete_security_group_rule(self, context, sgrid):
with context.session.begin(subtransactions=True):
# determine security profile id
security_group_rule = (
- super(NvpPluginV2, self).get_security_group_rule(
+ super(NsxPluginV2, self).get_security_group_rule(
context, sgrid))
if not security_group_rule:
raise ext_sg.SecurityGroupRuleNotFound(id=sgrid)
context.session, self.cluster, sgid)
secgrouplib.update_security_group_rules(
self.cluster, nsx_sec_profile_id, current_rules_nsx)
- return super(NvpPluginV2, self).delete_security_group_rule(context,
+ return super(NsxPluginV2, self).delete_security_group_rule(context,
sgrid)
def create_qos_queue(self, context, qos_queue, check_policy=True):
q = qos_queue.get('qos_queue')
self._validate_qos_queue(context, q)
q['id'] = queuelib.create_lqueue(self.cluster, q)
- return super(NvpPluginV2, self).create_qos_queue(context, qos_queue)
+ return super(NsxPluginV2, self).create_qos_queue(context, qos_queue)
def delete_qos_queue(self, context, queue_id, raise_in_use=True):
filters = {'queue_id': [queue_id]}
else:
return
queuelib.delete_lqueue(self.cluster, queue_id)
- return super(NvpPluginV2, self).delete_qos_queue(context, queue_id)
+ return super(NsxPluginV2, self).delete_qos_queue(context, queue_id)
+
+
+# for backward compatibility
+NvpPluginV2 = NsxPluginV2
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__)
}
-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",
])
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])
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 = (
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
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
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,
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'])
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)
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(
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 = {
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)
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)
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)
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(
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:
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:
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)
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)
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):
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):
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
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)
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'],
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(
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)
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
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)
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
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
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')
]
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')
]
"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,
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
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']:
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):
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,
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'):
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)
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']:
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,
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,
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'):
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']
).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)
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)
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)
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,
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
if kwargs.get("tags"):
tags.extend(kwargs["tags"])
return switch_name, tz_config, tags
+
+
+# For backward compatibility
+NvpAdvancedPlugin = NsxAdvancedPlugin
import sys
-from neutron.plugins.nicira.shell import commands as cmd
+from neutron.plugins.vmware.shell import commands as cmd
from neutronclient import shell
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
# Copyright 2013 VMware, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# 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')
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved.
#
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
# Copyright 2013 VMware, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
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__)
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__)
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
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
# Copyright 2013 VMware, Inc.
# All Rights Reserved
#
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
# Copyright 2013 VMware, Inc.
# All Rights Reserved
#
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
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__)
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__)
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):
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
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)
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__)
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
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
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
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
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
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
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
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
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
# 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
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
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
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
#
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
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
# 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
from neutron.common import constants
from neutron.common.test_lib import test_config
-from neutron.plugins.nicira.common import sync
-from neutron.plugins.nicira.dhcp_meta import rpc
+from neutron.plugins.vmware.common import sync
+from neutron.plugins.vmware.dhcp_meta import rpc
from neutron.tests.unit.openvswitch import test_agent_scheduler as test_base
from neutron.tests.unit.vmware.apiclient import fake
from neutron.tests.unit.vmware import get_fake_conf
from neutron.common import exceptions as n_exc
from neutron import context
from neutron.db import api as db
-from neutron.plugins.nicira.api_client.exception import NsxApiException
-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
-from neutron.plugins.nicira.dhcp_meta import lsnmanager as lsn_man
-from neutron.plugins.nicira.dhcp_meta import migration as mig_man
-from neutron.plugins.nicira.dhcp_meta import nsx
-from neutron.plugins.nicira.dhcp_meta import rpc
+from neutron.plugins.vmware.api_client.exception import NsxApiException
+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
+from neutron.plugins.vmware.dhcp_meta import lsnmanager as lsn_man
+from neutron.plugins.vmware.dhcp_meta import migration as mig_man
+from neutron.plugins.vmware.dhcp_meta import nsx
+from neutron.plugins.vmware.dhcp_meta import rpc
from neutron.tests import base
from neutron.common import config as q_config
from neutron.manager import NeutronManager
from neutron.openstack.common import uuidutils
-from neutron.plugins.nicira.api_client import client
-from neutron.plugins.nicira.api_client import version
-from neutron.plugins.nicira.common import config # noqa
-from neutron.plugins.nicira.common import exceptions
-from neutron.plugins.nicira.common import sync
-from neutron.plugins.nicira import nsx_cluster
-from neutron.plugins.nicira.nsxlib import lsn as lsnlib
+from neutron.plugins.vmware.api_client import client
+from neutron.plugins.vmware.api_client import version
+from neutron.plugins.vmware.common import config # noqa
+from neutron.plugins.vmware.common import exceptions
+from neutron.plugins.vmware.common import sync
+from neutron.plugins.vmware import nsx_cluster
+from neutron.plugins.vmware.nsxlib import lsn as lsnlib
from neutron.tests import base
from neutron.tests.unit.vmware import get_fake_conf
from neutron.tests.unit.vmware import PLUGIN_NAME
from neutron.openstack.common.db import exception as db_exc
from neutron.openstack.common import log
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 sync
-from neutron.plugins.nicira.dbexts import db as nsx_db
-from neutron.plugins.nicira.extensions import distributedrouter as dist_router
-from neutron.plugins.nicira import NeutronPlugin
-from neutron.plugins.nicira import nsxlib
+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 sync
+from neutron.plugins.vmware.dbexts import db as nsx_db
+from neutron.plugins.vmware.extensions import distributedrouter as dist_router
+from neutron.plugins.vmware import nsxlib
+from neutron.plugins.vmware.plugins.base import NetworkTypes
from neutron.tests.unit import _test_extension_portbindings as test_bindings
import neutron.tests.unit.test_db_plugin as test_plugin
import neutron.tests.unit.test_extension_ext_gw_mode as test_ext_gw_mode
def _create_l3_ext_network(self, vlan_id=None):
name = 'l3_ext_net'
- net_type = NeutronPlugin.NetworkTypes.L3_EXT
+ net_type = NetworkTypes.L3_EXT
providernet_args = {pnet.NETWORK_TYPE: net_type,
pnet.PHYSICAL_NETWORK: 'l3_gw_uuid'}
if vlan_id:
def _test_create_l3_ext_network(self, vlan_id=None):
name = 'l3_ext_net'
- net_type = NeutronPlugin.NetworkTypes.L3_EXT
+ net_type = NetworkTypes.L3_EXT
expected = [('subnets', []), ('name', name), ('admin_state_up', True),
('status', 'ACTIVE'), ('shared', False),
(external_net.EXTERNAL, True),
from neutron import context
from neutron.openstack.common import jsonutils as json
from neutron.openstack.common import log
-from neutron.plugins.nicira.api_client import client
-from neutron.plugins.nicira.api_client import exception as api_exc
-from neutron.plugins.nicira.api_client import version
-from neutron.plugins.nicira.common import sync
-from neutron.plugins.nicira import nsx_cluster as cluster
-from neutron.plugins.nicira import nvplib as nsx_utils
+from neutron.plugins.vmware.api_client import client
+from neutron.plugins.vmware.api_client import exception as api_exc
+from neutron.plugins.vmware.api_client import version
+from neutron.plugins.vmware.common import sync
+from neutron.plugins.vmware import nsx_cluster as cluster
+from neutron.plugins.vmware import nvplib as nsx_utils
from neutron.plugins.vmware import plugin
from neutron.tests import base
from neutron.tests.unit import test_api_v2
from neutron.db import api as db_api
from neutron.openstack.common import uuidutils
-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.common import utils
-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.common import utils
+from neutron.plugins.vmware import nvplib
from neutron.tests import base
from neutron.tests.unit.vmware import nsx_method
from neutron.tests.unit.vmware.nsxlib import base as nsx_base
-# Copyright 2013 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.
# 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 copy
import json
from neutron.openstack.common import uuidutils
-from neutron.plugins.nicira.vshield.common import exceptions
+from neutron.plugins.vmware.vshield.common import exceptions
class FakeVcns(object):
from neutron.extensions import l3
from neutron.manager import NeutronManager
from neutron.openstack.common import uuidutils
-from neutron.plugins.nicira.common import utils
-from neutron.plugins.nicira import NeutronServicePlugin as nsp
+from neutron.plugins.vmware.common import utils
+from neutron.plugins.vmware.plugins import service as nsp
from neutron.tests import base
from neutron.tests.unit import test_l3_plugin
from neutron.tests.unit.vmware import NSXEXT_PATH
from neutron import context
from neutron.db.firewall import firewall_db
from neutron.openstack.common import uuidutils
-from neutron.plugins.nicira.vshield.common import exceptions as vcns_exc
-from neutron.plugins.nicira.vshield import vcns_driver
+from neutron.plugins.vmware.vshield.common import exceptions as vcns_exc
+from neutron.plugins.vmware.vshield import vcns_driver
from neutron.tests.unit.db.firewall import test_db_firewall
from neutron.tests.unit.vmware import get_fake_conf
from neutron.tests.unit.vmware import VCNS_NAME
from neutron.common import config as n_config
from neutron import context
from neutron.openstack.common import uuidutils
-from neutron.plugins.nicira.dbexts import vcns_db
-from neutron.plugins.nicira.vshield.common import exceptions as vcns_exc
-from neutron.plugins.nicira.vshield import vcns_driver
+from neutron.plugins.vmware.dbexts import vcns_db
+from neutron.plugins.vmware.vshield.common import exceptions as vcns_exc
+from neutron.plugins.vmware.vshield import vcns_driver
from neutron.tests.unit.db.loadbalancer import test_db_loadbalancer
from neutron.tests.unit.vmware import get_fake_conf
from neutron.tests.unit.vmware import VCNS_NAME
import mock
from neutron.common import config as n_config
-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.tasks.constants import TaskState
-from neutron.plugins.nicira.vshield.tasks.constants import TaskStatus
-from neutron.plugins.nicira.vshield.tasks import tasks as ts
-from neutron.plugins.nicira.vshield import vcns_driver
+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.tasks.constants import TaskState
+from neutron.plugins.vmware.vshield.tasks.constants import TaskStatus
+from neutron.plugins.vmware.vshield.tasks import tasks as ts
+from neutron.plugins.vmware.vshield import vcns_driver
from neutron.tests import base
from neutron.tests.unit.vmware import get_fake_conf
from neutron.tests.unit.vmware import VCNS_NAME
[entry_points]
console_scripts =
- neutron-check-nsx-config = neutron.plugins.nicira.check_nsx_config:main
- neutron-check-nvp-config = neutron.plugins.nicira.check_nsx_config:main
+ neutron-check-nsx-config = neutron.plugins.vmware.check_nsx_config:main
+ neutron-check-nvp-config = neutron.plugins.vmware.check_nsx_config:main
neutron-db-manage = neutron.db.migration.cli:main
neutron-debug = neutron.debug.shell:main
neutron-dhcp-agent = neutron.agent.dhcp_agent:main
neutron-nec-agent = neutron.plugins.nec.agent.nec_neutron_agent:main
neutron-netns-cleanup = neutron.agent.netns_cleanup_util:main
neutron-ns-metadata-proxy = neutron.agent.metadata.namespace_proxy:main
- neutron-nsx-manage = neutron.plugins.nicira.shell:main
+ neutron-nsx-manage = neutron.plugins.vmware.shell:main
neutron-openvswitch-agent = neutron.plugins.openvswitch.agent.ovs_neutron_agent:main
neutron-ovs-cleanup = neutron.agent.ovs_cleanup_util:main
neutron-restproxy-agent = neutron.plugins.bigswitch.agent.restproxy_agent:main
neutron-server = neutron.server:main
neutron-rootwrap = oslo.rootwrap.cmd:main
neutron-usage-audit = neutron.cmd.usage_audit:main
- quantum-check-nvp-config = neutron.plugins.nicira.check_nsx_config:main
+ quantum-check-nvp-config = neutron.plugins.vmware.check_nsx_config:main
quantum-db-manage = neutron.db.migration.cli:main
neutron-vpn-agent = neutron.services.vpn.agent:main
quantum-debug = neutron.debug.shell:main