[neutron][opencontrail]Trunk ports doesn't have standard attributes
Environment: Openstack Victoria, OpenContrail (TungstenFabric) R2011. Problem: Trunk ports doesn't have standard attributes such as description, timestamp. I have an environment where core plugin is OpenContrail. OpenContrail has tf-neutron-plugin for proper work with neutron. There is TrunkPlugin, that proxies all trunk-related request to the OpenContrail backend. Here is the link for this plugin. https://gerrit.tungsten.io/r/gitweb?p=tungstenfabric/tf-neutron-plugin.git;a... According to the openstack documentation: Resources that inherit from the HasStandardAttributes DB class can automatically have the extensions written for standard attributes (e.g. timestamps, revision number, etc) extend their resources by defining the ‘api_collections’ on their model. These are used by extensions for standard attr resources to generate the extended resources map. As I understood, it works only for plugins, which using Openstack database. For example, openstack native trunk plugin has models.py file where we can see this inheritance. https://github.com/openstack/neutron/blob/master/neutron/services/trunk/mode... In case of OpenContrail+OpenStack Trunk plugin only redirect requests. What can I do to make Contrail Trunk plugin works in the same way? I'll appreciate any help. Thanks in advance.
Hello Gleb: The OC plugin is using the Neutron API to execute operations on the server. The "get_trunk" method calls "_get_resource" [1]. I've tested the Neutron API and this is what you get from the API: [2]. All standard attributes are returned. Maybe this could be related to the "fields" parameter you are passing in the method [3]. Check if you are filtering the API call and only retrieving a certain subset of fields. Regards. [1] https://gerrit.tungsten.io/r/gitweb?p=tungstenfabric/tf-neutron-plugin.git;a... [2]https://paste.opendev.org/show/bh1QD8VqLz4OKMKYBXUa/ [3] https://gerrit.tungsten.io/r/gitweb?p=tungstenfabric/tf-neutron-plugin.git;a... On Fri, May 6, 2022 at 4:35 PM Gleb Zimin <gzimin@mirantis.com> wrote:
Environment: Openstack Victoria, OpenContrail (TungstenFabric) R2011. Problem: Trunk ports doesn't have standard attributes such as description, timestamp. I have an environment where core plugin is OpenContrail. OpenContrail has tf-neutron-plugin for proper work with neutron. There is TrunkPlugin, that proxies all trunk-related request to the OpenContrail backend. Here is the link for this plugin. https://gerrit.tungsten.io/r/gitweb?p=tungstenfabric/tf-neutron-plugin.git;a... According to the openstack documentation: Resources that inherit from the HasStandardAttributes DB class can automatically have the extensions written for standard attributes (e.g. timestamps, revision number, etc) extend their resources by defining the ‘api_collections’ on their model. These are used by extensions for standard attr resources to generate the extended resources map. As I understood, it works only for plugins, which using Openstack database. For example, openstack native trunk plugin has models.py file where we can see this inheritance. https://github.com/openstack/neutron/blob/master/neutron/services/trunk/mode... In case of OpenContrail+OpenStack Trunk plugin only redirect requests. What can I do to make Contrail Trunk plugin works in the same way? I'll appreciate any help. Thanks in advance.
Hi Gleb, The standard attributes are populated by StandardAttrDescriptionMixin [1]. At a quick glance, the OpenContrail core plugin (both NeutronPluginContrailCoreV3 or NeutronPluginContrailCoreV2) inherits NeutronPluginContrailCoreBase [2] which inherits NeutronPluginBaseV2 rather than NeutronDbPluginV2. Thus, what StandardAttrDescriptionMixin does is not available in your case. For best case, inheriting StandardAttrDescriptionMixin in the core plugin addresses your issue, but I am not sure.
From the initial implementation of Contrail plugin, Contrail plugin inherits NeutronPluginBaseV2 instead of NeutronDbPluginV2. Most logics behind the neutron API are implemented by NeutronDbPluginV2 and perhaps the OpenStack documentation assumes how NeutronDbPluginV2 behaves. However, Contrail plugin did not choose this way and implemented all behaviors behind the neutron API by its plugin, so Contrail plugin needs to implement almost all logics in NeutronDbPluginV2 by itself. I wonder if the issue you hit comes from this situation. I don't know why this way was chosen but this is the real situation.
Hope it may help you a bit. [1] https://opendev.org/openstack/neutron/src/branch/master/neutron/db/standarda... [2] https://gerrit.tungsten.io/r/gitweb?p=tungstenfabric/tf-neutron-plugin.git;a... Thanks, Akihiro Motoki (amotoki) On Fri, May 6, 2022 at 11:34 PM Gleb Zimin <gzimin@mirantis.com> wrote:
Environment: Openstack Victoria, OpenContrail (TungstenFabric) R2011. Problem: Trunk ports doesn't have standard attributes such as description, timestamp. I have an environment where core plugin is OpenContrail. OpenContrail has tf-neutron-plugin for proper work with neutron. There is TrunkPlugin, that proxies all trunk-related request to the OpenContrail backend. Here is the link for this plugin. https://gerrit.tungsten.io/r/gitweb?p=tungstenfabric/tf-neutron-plugin.git;a... According to the openstack documentation: Resources that inherit from the HasStandardAttributes DB class can automatically have the extensions written for standard attributes (e.g. timestamps, revision number, etc) extend their resources by defining the ‘api_collections’ on their model. These are used by extensions for standard attr resources to generate the extended resources map. As I understood, it works only for plugins, which using Openstack database. For example, openstack native trunk plugin has models.py file where we can see this inheritance. https://github.com/openstack/neutron/blob/master/neutron/services/trunk/mode... In case of OpenContrail+OpenStack Trunk plugin only redirect requests. What can I do to make Contrail Trunk plugin works in the same way? I'll appreciate any help. Thanks in advance.
Hi Akihiro, thanks for reply. The thing is that description and other standard attributes don't work only with trunks. I can add descriptions, tags to neutron "core" objects such as networks, subnets, ports etc. Inheriting class StandardAttrDescriptionMixin didn't help, unfortunately. On Wed, May 11, 2022 at 4:16 PM Akihiro Motoki <amotoki@gmail.com> wrote:
Hi Gleb,
The standard attributes are populated by StandardAttrDescriptionMixin [1]. At a quick glance, the OpenContrail core plugin (both NeutronPluginContrailCoreV3 or NeutronPluginContrailCoreV2) inherits NeutronPluginContrailCoreBase [2] which inherits NeutronPluginBaseV2 rather than NeutronDbPluginV2. Thus, what StandardAttrDescriptionMixin does is not available in your case. For best case, inheriting StandardAttrDescriptionMixin in the core plugin addresses your issue, but I am not sure.
From the initial implementation of Contrail plugin, Contrail plugin inherits NeutronPluginBaseV2 instead of NeutronDbPluginV2. Most logics behind the neutron API are implemented by NeutronDbPluginV2 and perhaps the OpenStack documentation assumes how NeutronDbPluginV2 behaves. However, Contrail plugin did not choose this way and implemented all behaviors behind the neutron API by its plugin, so Contrail plugin needs to implement almost all logics in NeutronDbPluginV2 by itself. I wonder if the issue you hit comes from this situation. I don't know why this way was chosen but this is the real situation.
Hope it may help you a bit.
[1] https://opendev.org/openstack/neutron/src/branch/master/neutron/db/standarda... [2] https://gerrit.tungsten.io/r/gitweb?p=tungstenfabric/tf-neutron-plugin.git;a...
Thanks, Akihiro Motoki (amotoki)
On Fri, May 6, 2022 at 11:34 PM Gleb Zimin <gzimin@mirantis.com> wrote:
Environment: Openstack Victoria, OpenContrail (TungstenFabric) R2011. Problem: Trunk ports doesn't have standard attributes such as
I have an environment where core plugin is OpenContrail. OpenContrail has tf-neutron-plugin for proper work with neutron. There is TrunkPlugin,
According to the openstack documentation: Resources that inherit from
description, timestamp. that proxies all trunk-related request to the OpenContrail backend. Here is the link for this plugin. https://gerrit.tungsten.io/r/gitweb?p=tungstenfabric/tf-neutron-plugin.git;a... the HasStandardAttributes DB class can automatically have the extensions written for standard attributes (e.g. timestamps, revision number, etc) extend their resources by defining the ‘api_collections’ on their model. These are used by extensions for standard attr resources to generate the extended resources map.
As I understood, it works only for plugins, which using Openstack database. For example, openstack native trunk plugin has models.py file where we can see this inheritance. https://github.com/openstack/neutron/blob/master/neutron/services/trunk/mode... In case of OpenContrail+OpenStack Trunk plugin only redirect requests. What can I do to make Contrail Trunk plugin works in the same way? I'll appreciate any help. Thanks in advance.
participants (3)
-
Akihiro Motoki
-
Gleb Zimin
-
Rodolfo Alonso Hernandez