← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1832985] Re: Update of segmentation id for network don't works

 

Reviewed:  https://review.opendev.org/665623
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3367e2081bfd57030a3a3427eec630aa2f483d25
Submitter: Zuul
Branch:    master

commit 3367e2081bfd57030a3a3427eec630aa2f483d25
Author: Slawek Kaplonski <skaplons@xxxxxxxxxx>
Date:   Fri Jun 14 10:40:03 2019 +0200

    Fix update of network's segmentation id for network with ports
    
    Filter neutron_lib.objects.utils.NotIn, designed to work with OVO objects
    was used in db query and because of that ports belong to network wasn't
    filtered by vif_type thus if there were any ports in network, it was not
    possible to change its segmentation id.
    
    Change-Id: I6ad2047c310e111bffe0942af12af1f642963b18
    Closes-Bug: #1832985


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1832985

Title:
  Update of segmentation id for network don't works

Status in neutron:
  Fix Released

Bug description:
  Update of segmentation ID for vlan networks was introduced by RFE:
  https://bugs.launchpad.net/neutron/+bug/1806052

  When I'm trying to update segmentation_id of network now, I got
  internal server error return.

  Steps to reproduce:

  1. Create vlan network like:

  [00:35:45] vagrant@devstack-centos-ovs:/opt/stack/tempest$ neutron net-show test-vlan
  neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
  +---------------------------+--------------------------------------+
  | Field                     | Value                                |
  +---------------------------+--------------------------------------+
  | admin_state_up            | True                                 |
  | availability_zone_hints   |                                      |
  | availability_zones        | nova                                 |
  | created_at                | 2019-06-13T22:17:10Z                 |
  | description               | test network                         |
  | id                        | 34032aa4-f596-4a3e-8d00-7a2e03b0867a |
  | ipv4_address_scope        |                                      |
  | ipv6_address_scope        |                                      |
  | mtu                       | 1500                                 |
  | name                      | test-vlan                            |
  | port_security_enabled     | True                                 |
  | project_id                | 889441eb7f234c9890ee8406045fdb87     |
  | provider:network_type     | vlan                                 |
  | provider:physical_network | public                               |
  | provider:segmentation_id  | 1000                                 |
  | qos_policy_id             |                                      |
  | revision_number           | 2                                    |
  | router:external           | False                                |
  | shared                    | False                                |
  | status                    | ACTIVE                               |
  | subnets                   | b00f977a-6f13-4906-b126-c173652f1973 |
  | tags                      |                                      |
  | tenant_id                 | 889441eb7f234c9890ee8406045fdb87     |
  | updated_at                | 2019-06-13T22:22:40Z                 |
  +---------------------------+--------------------------------------+

  2. Try to update segmentation_id like:

  [00:38:50] vagrant@devstack-centos-ovs:/opt/stack/tempest$ neutron net-update test-vlan --provider:segmentation_id 2000
  neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
  Request Failed: internal server error while processing your request.
  Neutron server returns request_ids: ['req-2b8ebe5e-791a-497b-a5ec-24a3d6071f7d']

  
  3. In neutron server logs I see error like:

  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation [None req-2b8ebe5e-791a-497b-a5ec-24a3d6071f7d demo admin] PUT failed.: AttributeError: 'Context' object has no attribute 'current'
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation Traceback (most recent call last):
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/pecan/core.py", line 683, in __call__
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     self.invoke_controller(controller, args, kwargs, state)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/pecan/core.py", line 574, in invoke_controller
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     result = controller(*args, **kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/neutron_lib/db/api.py", line 139, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     setattr(e, '_RETRY_EXCEEDED', True)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     self.force_reraise()
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     six.reraise(self.type_, self.value, self.tb)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/neutron_lib/db/api.py", line 135, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return f(*args, **kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_db/api.py", line 154, in wrapper
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     ectxt.value = e.inner_exc
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     self.force_reraise()
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     six.reraise(self.type_, self.value, self.tb)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_db/api.py", line 142, in wrapper
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return f(*args, **kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/neutron_lib/db/api.py", line 183, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     LOG.debug("Retry wrapper got retriable exception: %s", e)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     self.force_reraise()
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     six.reraise(self.type_, self.value, self.tb)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/neutron_lib/db/api.py", line 179, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return f(*dup_args, **dup_kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/opt/stack/neutron/neutron/pecan_wsgi/controllers/utils.py", line 76, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return f(*args, **kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/opt/stack/neutron/neutron/pecan_wsgi/controllers/resource.py", line 70, in put
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return {self.resource: self.plugin_updater(*updater_args)}
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/opt/stack/neutron/neutron/common/utils.py", line 681, in inner
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return f(self, context, *args, **kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/neutron_lib/db/api.py", line 233, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return method(*args, **kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/neutron_lib/db/api.py", line 139, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     setattr(e, '_RETRY_EXCEEDED', True)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     self.force_reraise()
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     six.reraise(self.type_, self.value, self.tb)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/neutron_lib/db/api.py", line 135, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return f(*args, **kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_db/api.py", line 154, in wrapper
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     ectxt.value = e.inner_exc
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     self.force_reraise()
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     six.reraise(self.type_, self.value, self.tb)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_db/api.py", line 142, in wrapper
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return f(*args, **kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/neutron_lib/db/api.py", line 183, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     LOG.debug("Retry wrapper got retriable exception: %s", e)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     self.force_reraise()
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     six.reraise(self.type_, self.value, self.tb)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python2.7/site-packages/neutron_lib/db/api.py", line 179, in wrapped
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     return f(*dup_args, **dup_kwargs)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 1082, in update_network
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     context, original_network, net_data)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 887, in _update_provider_network_attributes
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     self._update_segmentation_id(context, network, net_data)
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 850, in _update_segmentation_id
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     context, agent, segments[0]))
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation   File "/opt/stack/neutron/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py", line 137, in get_vif_type
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation     if (context.current.get(portbindings.VNIC_TYPE) ==
  cze 14 00:39:15 devstack-centos-ovs neutron-server[23663]: ERROR neutron.pecan_wsgi.hooks.translation AttributeError: 'Context' object has no attribute 'current'

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1832985/+subscriptions


References