errors occured when create vpnservice with flavor_id:Flavors plugin not Found

Bug #1773282 reported by Liu Xie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Hunt Xu

Bug Description

when i create a vpnservice with flavor_id ,there was one error:Flavors plugin not Found.
Then i found that "Loading plugin:flavors" after "Loading plugin:vpnaas" from the server.log.
So i modified [_get_provider_for_flavor] in the neutron_vpnaas/services/vpn/plugin.py,like this:

  def _get_provider_for_flavor(self, context, flavor_id):
        if flavor_id:
            self._flavors_plugin = directory.get_plugin(constants.FLAVORS)
            if not self._flavors_plugin:
                raise vpn_flavors.FlavorsPluginNotLoaded()
it wokrs!

Tags: vpnaas
Revision history for this message
Boden R (boden) wrote :

Can you please provide additional details such as the release of openstack you are running with, steps on how to reproduce, relevant log snippets, etc.? This will help us better triage the issue to determine its root cause.

Changed in neutron:
status: New → Incomplete
Revision history for this message
Liu Xie (liushy) wrote :

Further details:
1.The release of openstack is PIKE
2. I created a vpnservice with flavor_id,like this:
    POST http://172.25.80.119:9696/v2.0/vpn/vpnservices
    {
      "vpnservice":{
        "name":"vpn-flavor",
        "router_id":"163749ee-81f7-4ad8-8751-5d67c24ddf23",
        "flavor_id":"7d9d8b5f-209a-4d30-b0ab-3bd1eb5a3944"
        }
    }
    but one error occuered from the response:
    {
     "NeutronError": {
      "message": "Flavors plugin not found",
      "type": "FlavorsPluginNotLoaded",
      "detail": ""
      }
    }
3.Then I found that "Loading plugin:flavors" after "Loading plugin:vpnaas" from the server.log:
2018-05-31 14:39:35.785 31417 INFO neutron.manager [req-36fbea6f-35cf-4dc0-9b1f-a5e7947e9317 - - - - -] Loading Plugin: vpnaas

2018-05-31 14:39:35.873 31417 INFO neutron_vpnaas.services.vpn.plugin [req-36fbea6f-35cf-4dc0-9b1f-a5e7947e9317 - - - - -] VPN plugin using service drivers: ['h3c'], default: h3c

2018-05-31 14:39:35.874 31417 INFO neutron.manager [req-36fbea6f-35cf-4dc0-9b1f-a5e7947e9317 - - - - -] Loading Plugin: qos

2018-05-31 14:39:35.877 31417 INFO neutron.manager [req-36fbea6f-35cf-4dc0-9b1f-a5e7947e9317 - - - - -] Loading Plugin: flavors

I checked the codes,and found "find the flavor plugin only once" in [class VPNPluginRpcDbMixin]:
  def _init(self):
    ......
    # Try to find the flavor plugin only once
    self._flavors_plugin = directory.get_plugin(constants.FLAVORS)

4.I modified [_get_provider_for_flavor] in the neutron_vpnaas/services/vpn/plugin.py,like this:

  def _get_provider_for_flavor(self, context, flavor_id):
        if flavor_id:
            self._flavors_plugin = directory.get_plugin(constants.FLAVORS)
            if not self._flavors_plugin:
                raise vpn_flavors.FlavorsPluginNotLoaded()
it works!

Boden R (boden)
Changed in neutron:
status: Incomplete → New
Revision history for this message
Boden R (boden) wrote :

What's the value of service_provider in your conf [1]?

[1] https://docs.openstack.org/neutron-vpnaas/latest/configuration/neutron_vpnaas.html

tags: added: vpnaas
Revision history for this message
Liu Xie (liushy) wrote :

@Boden
The value of service_provider is:

    [service_providers]
    service_provider = VPN:H3C:networking_h3c.vpn.h3c_vpnplugin_driver.H3CVpnPluginDriver:default

That driver is developed by us.We configure it as the default driver of VPN.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-vpnaas (master)

Fix proposed to branch: master
Review: https://review.openstack.org/576368

Changed in neutron:
assignee: nobody → Hunt Xu (huntxu)
status: New → In Progress
Revision history for this message
Hunt Xu (huntxu) wrote :

I can confirm this. It is caused by that the vpn plugin gets loaded (and initialised) before the flavor service plugin.

@liushy, would you please test the proposed change?

Cao Xuan Hoang (hoangcx)
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
Liu Xie (liushy) wrote :

@huntxu ,i modified the vpnservice's plugin through your advices,and it worked well!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-vpnaas (master)

Reviewed: https://review.openstack.org/576368
Committed: https://git.openstack.org/cgit/openstack/neutron-vpnaas/commit/?id=363fc4070df1af54a3c1a0c7b974fe032155dab6
Submitter: Zuul
Branch: master

commit 363fc4070df1af54a3c1a0c7b974fe032155dab6
Author: Hunt Xu <email address hidden>
Date: Tue Jun 19 13:31:34 2018 +0800

    Fix flavors plugin not found error

    Upon the initialization of the vpnaas plugin, it gets the flavors plugin
    only once. This is not working well because if the vpnaas plugin gets
    loaded before the flavors service plugin, it will fail to find the
    flavors service plugin.

    Closes-Bug: #1773282

    Change-Id: Ib4e11c8eef7831513f0fae2a45120ec396cfe3f5

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-vpnaas 13.0.0.0b3

This issue was fixed in the openstack/neutron-vpnaas 13.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.