NSX-TVD QoS drivers support

Modify the QoS drivers of NSX-V and NSX-V3 to support TVD core plugin

Change-Id: I20eb61a01f6a0238871440d9d91e18f55b4bd20e
This commit is contained in:
Adit Sarfaty 2017-12-17 15:30:43 +02:00
parent 792a6a0103
commit 41806e8f41
2 changed files with 16 additions and 3 deletions

View File

@ -20,6 +20,7 @@ from neutron_lib.services.qos import base
from neutron_lib.services.qos import constants as qos_consts
from oslo_log import log as logging
from vmware_nsx.extensions import projectpluginmap
LOG = logging.getLogger(__name__)
DRIVER = None
@ -54,6 +55,10 @@ class NSXvQosDriver(base.DriverBase):
def __init__(self, core_plugin, **kwargs):
super(NSXvQosDriver, self).__init__(**kwargs)
self.core_plugin = core_plugin
if self.core_plugin.is_tvd_plugin():
# get the plugin that match this driver
self.core_plugin = self.core_plugin.get_plugin_by_type(
projectpluginmap.NsxPlugins.NSX_V)
self.requires_rpc_notifications = False
def is_vif_type_compatible(self, vif_type):

View File

@ -26,6 +26,7 @@ from neutron_lib.services.qos import constants as qos_consts
from vmware_nsx._i18n import _
from vmware_nsx.common import exceptions as nsx_exc
from vmware_nsx.db import db as nsx_db
from vmware_nsx.extensions import projectpluginmap
LOG = logging.getLogger(__name__)
@ -39,14 +40,21 @@ class QosNotificationsHandler(object):
def __init__(self):
super(QosNotificationsHandler, self).__init__()
self._core_plugin = None
@property
def _core_plugin(self):
return directory.get_plugin()
def core_plugin(self):
if not self._core_plugin:
self._core_plugin = directory.get_plugin()
if self._core_plugin.is_tvd_plugin():
# get the plugin that match this driver
self._core_plugin = self._core_plugin.get_plugin_by_type(
projectpluginmap.NsxPlugins.NSX_T)
return self._core_plugin
@property
def _nsxlib_qos(self):
return self._core_plugin.nsxlib.qos_switching_profile
return self.core_plugin.nsxlib.qos_switching_profile
def _get_tags(self, context, policy):
policy_dict = {'id': policy.id, 'tenant_id': policy.tenant_id}