From 36db6b746a68c02d1ffcdd8e1bcf29686b4f4b18 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 25 Sep 2020 17:21:07 +0100 Subject: [PATCH] neutron: Remove references to dead 'qos-queue' extension We had assumed that this was used by the out-of-tree XenAPI driver, but it turns out to have been used by the VMWare NSX QoS extension [1]. This extension itself is now EOL and the code was removed from the vmware-nsx package over two years ago [2][3]. There are no remaining references to this former extension: $ cd vmware-nsx $ ag qos-queue $ git log -S qos-queue --oneline | head -1 26135f34a retire the NSX MH plugin We can safely remove this. A release note is included even though this is a vendor-specific feature that should really never have been merged. [1] https://github.com/openstack/neutron/blob/fe61e29f/doc/source/admin/archives/adv-features.rst#vmware-nsx-qos-extension [2] https://opendev.org/x/vmware-nsx/src/commit/b5f59ece9130016f8949ac1b6c7a242d0048795f/vmware_nsx/extensions/qos_queue.py [3] https://opendev.org/x/vmware-nsx/commit/26135f34acca66ce994e0dd4280e2e968ed10ce3 Change-Id: I90171131d671d1b9ef2f93cc13174ebb00e96033 Signed-off-by: Stephen Finucane --- nova/network/constants.py | 1 - nova/network/neutron.py | 14 ------------ nova/tests/unit/network/test_neutron.py | 22 ++----------------- ...vmware-nsx-extension-208d72da23e7ae49.yaml | 7 ++++++ 4 files changed, 9 insertions(+), 35 deletions(-) create mode 100644 releasenotes/notes/remove-qos-queue-vmware-nsx-extension-208d72da23e7ae49.yaml diff --git a/nova/network/constants.py b/nova/network/constants.py index eff49022c16a..d98e217f95d1 100644 --- a/nova/network/constants.py +++ b/nova/network/constants.py @@ -40,7 +40,6 @@ RESOURCE_REQUEST_GROUPS = 'port-resource-request-groups' # Third-party extensions VNIC_INDEX = 'vnic-index' # this is provided by the vmware_nsx project -QOS_QUEUE = 'qos-queue' # TODO(stephenfin): what defines this? Xen? # Search fields diff --git a/nova/network/neutron.py b/nova/network/neutron.py index 73b2376950c8..c5e1c8e74698 100644 --- a/nova/network/neutron.py +++ b/nova/network/neutron.py @@ -1385,16 +1385,6 @@ class API: constants.RESOURCE_REQUEST_GROUPS, context, client, ) - # TODO(stephenfin): This is optionally used by the XenAPI virt driver, but - # I can't find what defines it and suspect it's dead code. Consider - # removing the functionality - def has_qos_queue_extension(self, context=None, client=None): - """Check if the 'qos-queue' extension is enabled. - - This extension is provided by a XenServer neutron plugin...we think. - """ - return self._has_extension(constants.QOS_QUEUE, context, client) - def has_vnic_index_extension(self, context=None, client=None): """Check if the 'vnic-index' extension is enabled. @@ -1644,10 +1634,6 @@ class API: if neutron is None: neutron = get_client(context) - if self.has_qos_queue_extension(client=neutron): - flavor = instance.get_flavor() - rxtx_factor = flavor.get('rxtx_factor') - port_req_body['port']['rxtx_factor'] = rxtx_factor port_req_body['port'][constants.BINDING_HOST_ID] = bind_host_id self._populate_neutron_binding_profile(instance, pci_request_id, diff --git a/nova/tests/unit/network/test_neutron.py b/nova/tests/unit/network/test_neutron.py index b717e509dff8..4b4a2e1f7759 100644 --- a/nova/tests/unit/network/test_neutron.py +++ b/nova/tests/unit/network/test_neutron.py @@ -1173,31 +1173,13 @@ class TestAPI(TestAPIBase): def test_refresh_neutron_extensions_cache(self): mocked_client = mock.create_autospec(client.Client) mocked_client.list_extensions.return_value = { - 'extensions': [{'alias': constants.QOS_QUEUE}]} + 'extensions': [{'alias': constants.DNS_INTEGRATION}]} self.api._refresh_neutron_extensions_cache(mocked_client) self.assertEqual( - {constants.QOS_QUEUE: {'alias': constants.QOS_QUEUE}}, + {constants.DNS_INTEGRATION: {'alias': constants.DNS_INTEGRATION}}, self.api.extensions) mocked_client.list_extensions.assert_called_once_with() - @mock.patch.object(neutronapi, 'get_client') - def test_populate_neutron_extension_values_rxtx_factor( - self, mock_get_client): - mocked_client = mock.create_autospec(client.Client) - mock_get_client.return_value = mocked_client - mocked_client.list_extensions.return_value = { - 'extensions': [{'alias': constants.QOS_QUEUE}]} - flavor = objects.Flavor.get_by_name(self.context, 'm1.small') - flavor['rxtx_factor'] = 1 - instance = objects.Instance(system_metadata={}) - instance.flavor = flavor - port_req_body = {'port': {}} - self.api._populate_neutron_extension_values(self.context, instance, - None, port_req_body) - self.assertEqual(1, port_req_body['port']['rxtx_factor']) - mock_get_client.assert_called_once_with(self.context) - mocked_client.list_extensions.assert_called_once_with() - def test_allocate_for_instance_1(self): # Allocate one port in one network env. self._test_allocate_for_instance_with_virtual_interface(1) diff --git a/releasenotes/notes/remove-qos-queue-vmware-nsx-extension-208d72da23e7ae49.yaml b/releasenotes/notes/remove-qos-queue-vmware-nsx-extension-208d72da23e7ae49.yaml new file mode 100644 index 000000000000..9c5fb49af869 --- /dev/null +++ b/releasenotes/notes/remove-qos-queue-vmware-nsx-extension-208d72da23e7ae49.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + Support for the ``qos-queue`` extension provided by the vmware-nsx neutron + plugin for the VMWare NSX Manager has been removed. This extension was + removed from the vmware-nsx project when support for NSX-MH was removed in + 15.0.0.