diff --git a/devstack/lib/vmware_nsx_tvd b/devstack/lib/vmware_nsx_tvd index ac5bf48004..40c41fe3cb 100644 --- a/devstack/lib/vmware_nsx_tvd +++ b/devstack/lib/vmware_nsx_tvd @@ -161,6 +161,7 @@ function neutron_plugin_configure_service { nsxv_configure_service iniset /$Q_PLUGIN_CONF_FILE nsx_tvd nsx_v_extension_drivers vmware_nsxv_dns iniset /$Q_PLUGIN_CONF_FILE nsx_tvd nsx_v3_extension_drivers vmware_nsxv3_dns + iniset /$Q_PLUGIN_CONF_FILE nsx_tvd dvs_extension_drivers vmware_dvs_dns iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_availability_zones $NSX_DEFAULT_AZ } diff --git a/vmware_nsx/common/config.py b/vmware_nsx/common/config.py index de8ea70fb1..108ceece29 100644 --- a/vmware_nsx/common/config.py +++ b/vmware_nsx/common/config.py @@ -824,6 +824,11 @@ nsx_tvd_opts = [ help=_("An ordered list of NSX-T extension driver " "entrypoints to be loaded from the " "vmware_nsx.extension_drivers namespace.")), + cfg.ListOpt('dvs_extension_drivers', + default=[], + help=_("An ordered list of DVS extension driver " + "entrypoints to be loaded from the " + "vmware_nsx.extension_drivers namespace.")), ] # Register the configuration options diff --git a/vmware_nsx/plugins/dvs/plugin.py b/vmware_nsx/plugins/dvs/plugin.py index d9ad2c88f7..7d4eccdfd5 100644 --- a/vmware_nsx/plugins/dvs/plugin.py +++ b/vmware_nsx/plugins/dvs/plugin.py @@ -20,6 +20,7 @@ from neutron_lib.api.definitions import port as port_def from neutron_lib.api.definitions import port_security as psec from neutron_lib.exceptions import allowedaddresspairs as addr_exc from neutron_lib.exceptions import port_security as psec_exc +from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils @@ -63,6 +64,7 @@ from vmware_nsx.dvs import dvs from vmware_nsx.dvs import dvs_utils from vmware_nsx.extensions import projectpluginmap from vmware_nsx.plugins.common import plugin as nsx_plugin_common +from vmware_nsx.plugins.nsx import utils as tvd_utils LOG = logging.getLogger(__name__) @@ -103,9 +105,15 @@ class NsxDvsV2(addr_pair_db.AllowedAddressPairsMixin, security_group=securitygroup_model.SecurityGroup, security_group_rule=securitygroup_model.SecurityGroupRule) def __init__(self): + self._is_sub_plugin = tvd_utils.is_tvd_core_plugin() dvs_utils.dvs_register_exceptions() - self._extension_manager = nsx_managers.ExtensionManager() super(NsxDvsV2, self).__init__() + if self._is_sub_plugin: + extension_drivers = cfg.CONF.nsx_tvd.dvs_extension_drivers + else: + extension_drivers = cfg.CONF.nsx_extension_drivers + self._extension_manager = nsx_managers.ExtensionManager( + extension_drivers=extension_drivers) LOG.debug('Driver support: DVS: %s' % dvs_utils.dvs_is_enabled()) self._extension_manager.initialize() self.supported_extension_aliases.extend(