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:
parent
792a6a0103
commit
41806e8f41
@ -20,6 +20,7 @@ from neutron_lib.services.qos import base
|
|||||||
from neutron_lib.services.qos import constants as qos_consts
|
from neutron_lib.services.qos import constants as qos_consts
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
from vmware_nsx.extensions import projectpluginmap
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
DRIVER = None
|
DRIVER = None
|
||||||
@ -54,6 +55,10 @@ class NSXvQosDriver(base.DriverBase):
|
|||||||
def __init__(self, core_plugin, **kwargs):
|
def __init__(self, core_plugin, **kwargs):
|
||||||
super(NSXvQosDriver, self).__init__(**kwargs)
|
super(NSXvQosDriver, self).__init__(**kwargs)
|
||||||
self.core_plugin = core_plugin
|
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
|
self.requires_rpc_notifications = False
|
||||||
|
|
||||||
def is_vif_type_compatible(self, vif_type):
|
def is_vif_type_compatible(self, vif_type):
|
||||||
|
@ -26,6 +26,7 @@ from neutron_lib.services.qos import constants as qos_consts
|
|||||||
from vmware_nsx._i18n import _
|
from vmware_nsx._i18n import _
|
||||||
from vmware_nsx.common import exceptions as nsx_exc
|
from vmware_nsx.common import exceptions as nsx_exc
|
||||||
from vmware_nsx.db import db as nsx_db
|
from vmware_nsx.db import db as nsx_db
|
||||||
|
from vmware_nsx.extensions import projectpluginmap
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -39,14 +40,21 @@ class QosNotificationsHandler(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(QosNotificationsHandler, self).__init__()
|
super(QosNotificationsHandler, self).__init__()
|
||||||
|
self._core_plugin = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _core_plugin(self):
|
def core_plugin(self):
|
||||||
return directory.get_plugin()
|
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
|
@property
|
||||||
def _nsxlib_qos(self):
|
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):
|
def _get_tags(self, context, policy):
|
||||||
policy_dict = {'id': policy.id, 'tenant_id': policy.tenant_id}
|
policy_dict = {'id': policy.id, 'tenant_id': policy.tenant_id}
|
||||||
|
Loading…
Reference in New Issue
Block a user