nicira: error occurs when net-gateway-connect with different segmentation-type

Bug #1270724 reported by Ryo Miki
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
VMwareAPI-Team
New
High
Unassigned
neutron
Fix Released
Medium
Armando Migliaccio
Havana
Fix Released
Medium
Armando Migliaccio

Bug Description

1. create net-gateway and gateway-connection. segmentation-type is vlan and
   segmentation_id is 0.

neutron net-gateway-create --device id=c4369a1c-3fb2-4f45-8ac7-17d15b20508e,interface_name=eth0 NetworkgatewayName
neutron net-gateway-connect NetworkgatewayName L2-1 --segmentation-type vlan
openstack@devstack:~/devstack$ neutron net-gateway-show NetworkgatewayName
+-----------+--------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------+--------------------------------------------------------------------------------------------------------+
| default | False |
| devices | {"interface_name": "eth0", "id": "c4369a1c-3fb2-4f45-8ac7-17d15b20508e"} |
| id | ab76582b-ea57-4184-82ce-68ad013aed5e |
| name | NetworkgatewayName |
| ports | {"port_id": "2e8d5d83-d2a2-4570-815a-fe61d2257568", "segmentation_type": "vlan", "segmentation_id": 0} |
| tenant_id | ec2918c3e7514158987c8f04c64d7521 |
+-----------+--------------------------------------------------------------------------------------------------------+

2. add network to gateway by net-gateway-connect. segmentation-type is flat.

openstack@devstack:~/devstack$ neutron net-gateway-connect NetworkgatewayName L2-2 --segmentation-type flat
Request Failed: internal server error while processing your request.

I think Neutron should not return 500.

=====

[Neutron server's log]

It seems conflict of segmentation-id because 0 is already used by vlan.

2014-01-27 11:57:23.805 ERROR NeutronPlugin [-] Unable to create port or set port attachment in NVP.
2014-01-27 11:57:23.819 ERROR neutron.api.v2.resource [req-dbf0b9a0-0ef0-41b1-99e7-88532b07d90e admin 36a8929801cb48d4a02fcad90a93a090] connect_network failed
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource Traceback (most recent call last):
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 84, in resource
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource result = method(request=request, **args)
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 191, in _handle_action
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource return getattr(self._plugin, name)(*arg_list, **kwargs)
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/NeutronPlugin.py", line 1980, in connect_network
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource context, network_gateway_id, network_mapping_info)
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/dbexts/nicira_networkgw_db.py", line 316, in connect_network
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource network_mapping_info.get('segmentation_id')}})
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/NeutronPlugin.py", line 1189, in create_port
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource self._delete_port(context, neutron_port_id)
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource self.gen.next()
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/NeutronPlugin.py", line 1173, in create_port
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource port_create_func(context, port_data)
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/NeutronPlugin.py", line 711, in _nvp_create_l2_gw_port
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource lport['uuid'])
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource self.gen.next()
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/NeutronPlugin.py", line 705, in _nvp_create_l2_gw_port
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource int(port_data.get('gw:segmentation_id') or 0))
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/nvplib.py", line 1013, in plug_l2_gw_service
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource return _plug_interface(cluster, lswitch_id, lport_id, att_obj)
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/nvplib.py", line 1003, in _plug_interface
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource cluster=cluster)
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/nvplib.py", line 1058, in do_request
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource res = cluster.api_client.request(*args)
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/NvpApiClient.py", line 150, in request
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource self.error_codes[status](self, response)
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/nicira/NvpApiClient.py", line 181, in fourZeroNine
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource raise Conflict()
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource Conflict: Request conflicts with configuration on a different entity.
2014-01-27 11:57:23.819 TRACE neutron.api.v2.resource
2014-01-27 11:57:23.852 INFO neutron.wsgi [req-dbf0b9a0-0ef0-41b1-99e7-88532b07d90e admin 36a8929801cb48d4a02fcad90a93a090] 172.23.51.99 - - [27/Jan/2014 11:57:23] "PUT /v2.0/network-gateways/6ece86bd-b4c9-4bfb-b198-e84c979a84b7/connect_network.json HTTP/1.1" 500 230 0.285504

[net-gatway-connect with vlan which segmentatin-id 0 causes 409]

devstack@devstack:~$ neutron net-gateway-connect --segmentation-type=vlan NetgatewayName L2-2
409-{u'NeutronError': {u'message': u"The specified mapping '{u'network_id': u'ea8d911b-c5ba-4daf-ae27-32415c0689a1', u'segmentation_id': 0, u'segmentation_type': u'vlan'}' is already in use on network gateway '6ece86bd-b4c9-4bfb-b198-e84c979a84b7'.", u'type': u'GatewayConnectionInUse', u'detail': u''}}

Changed in neutron:
assignee: nobody → Armando Migliaccio (armando-migliaccio)
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

If you attempt to do two gateway by net-gateway-connect in sequence you should get a 409 rather than a 500. Is that what you were trying to do? Or did you get a 500 error on the a single gateway by net-gateway-connect using the flat segmentation type?

Changed in neutron:
status: New → Confirmed
status: Confirmed → Incomplete
Revision history for this message
Ryo Miki (miki-ryo-e) wrote :

Thank you for comments.

> If you attempt to do two gateway by net-gateway-connect in sequence you
> should get a 409 rather than a 500. Is that what you were trying to do?

I just tested that vlan and flat gateway connections can be exist in same
gateway. I think it should be 409, too.

> Or did you get a 500 error on the a single gateway by net-gateway-connect
> using the flat segmentation type?

No, I could net-gateway-connect with flat segmentation type when other
connections doesn't exist at the gateway.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Okay, just to be sure I understood you correctly: are you saying that you tested that vlan and flat gateway connections cannot coexist and that a 409 should be returned instead of the 500? If so, I'll go ahead and confirm/fix the bug.

Thanks,
Aramando

Revision history for this message
Ryo Miki (miki-ryo-e) wrote :

Exactly. If you need more information, please tell me.

Regards.

Changed in neutron:
status: Incomplete → Confirmed
Revision history for this message
Ryo Miki (miki-ryo-e) wrote :

add Neutron server's log.

description: updated
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/69482
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=7ee1344c474b73dd2236d2c79df8dcf49cdb7bef
Submitter: Jenkins
Branch: master

commit 7ee1344c474b73dd2236d2c79df8dcf49cdb7bef
Author: armando-migliaccio <email address hidden>
Date: Mon Jan 27 14:05:12 2014 -0800

    Fix error while connecting to busy NSX L2 Gateway

    Ensure that a Conflict error is properly handled.

    Change-Id: Ib468ee953aef0fc54ea88064f88637ed46bc6352
    Closes-bug: 1270724

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/73697

Revision history for this message
Edgar Magana (emagana) wrote : Re: [openstack-dev] [neutron] Fixes for the alembic migration (sqlite + postgress) aren't being reviewed

Good Answer! :-)

On 2/20/14 12:02 PM, "Armando M." <email address hidden> wrote:

>Thomas,
>
>I feel your frustration, however before complaining please do follow
>the actual chain of events.
>
>Patch [1]: I asked a question which I never received an answer to.
>Patch [2]: I did put a -1, but I have nothing against this patch per
>se. This was only been recently abandoned and my -1 lied primarily to
>give patch [1] the opportunity to be resumed.
>
>No action on a negative review means automatic expiration, if you lose
>interest in something you care about whose fault is that?
>
>A.
>
>[1] = https://review.openstack.org/#/c/52757
>[2] = https://review.openstack.org/#/c/68611
>
>On 19 February 2014 06:28, Thomas Goirand <email address hidden> wrote:
>> Hi,
>>
>> I've seen this one:
>> https://review.openstack.org/#/c/68611/
>>
>> which is suppose to fix something for Postgress. This is funny, because
>> I was doing the exact same patch for fixing it for SQLite. Though this
>> was before the last summit in HK.
>>
>> Since then, I just gave up on having my Debian specific patch [1] being
>> upstreamed. No review, despite my insistence. Mark, on the HK summit,
>> told me that it was pending discussion about what would be the policy
>> for SQLite.
>>
>> Guys, this is disappointing. That's the 2nd time the same patch is being
>> blocked, with no explanations.
>>
>> Could 2 core reviewers have a *serious* look at this patch, and explain
>> why it's not ok for it to be approved? If nobody says why, then could
>> this be approved, so we can move on?
>>
>> Cheers,
>>
>> Thomas Goirand (zigo)
>>
>> [1]
>>
>>http://anonscm.debian.org/gitweb/?p=openstack/neutron.git;a=blob;f=debian
>>/patches/fix-alembic-migration-with-sqlite3.patch;h=9108b45aaaf683e49b153
>>38bacd813e50e9f563d;hb=b44e96d9e1d750e35513d63877eb05f167a175d8
>>
>> _______________________________________________
>> OpenStack-dev mailing list
>> <email address hidden>
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>_______________________________________________
>OpenStack-dev mailing list
><email address hidden>
>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/havana)

Reviewed: https://review.openstack.org/73697
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=2b4cdcd4ff311c06d019fc28d9a90e50b8cc8070
Submitter: Jenkins
Branch: stable/havana

commit 2b4cdcd4ff311c06d019fc28d9a90e50b8cc8070
Author: armando-migliaccio <email address hidden>
Date: Mon Jan 27 14:05:12 2014 -0800

    Fix error while connecting to busy NSX L2 Gateway

    Ensure that a Conflict error is properly handled.

    Change-Id: Ib468ee953aef0fc54ea88064f88637ed46bc6352
    Closes-bug: 1270724
    (cherry picked from commit 7ee1344c474b73dd2236d2c79df8dcf49cdb7bef)

tags: added: in-stable-havana
Tracy Jones (tjones-i)
Changed in openstack-vmwareapi-team:
importance: Undecided → High
Changed in neutron:
importance: Undecided → Medium
milestone: none → icehouse-3
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-3 → 2014.1
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.