GBP Ext-Seg: L3Policy cannot be updated to a new Ext-Seg

Bug #1486740 reported by puppet-py
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Group Based Policy
Incomplete
Undecided
Ivar Lazzaro

Bug Description

Updating external-segment attribute of the L3Policy fails(post-commit)
Steps:
1. Create L3Policy with reference to an external-segment
2. Create a new Ext-Seg
3. Update the L3Policy to the new Ext-Seg(from Step 2)

[root@f3-controller ~(keystone_admin)]# gbp l3policy-show L3P2
+----------------------+---------------------------------------------------------+
| Field | Value |
+----------------------+---------------------------------------------------------+
| description | |
| external_segments | {"d1bc7d4b-664d-434c-9fc1-4b09edf3dcbe": ["1.102.1.7"]} |
| id | d8d3527b-4246-45e3-bc4d-ba223893180d |
| ip_pool | 40.40.0.0/16 |
| ip_version | 4 |
| l2_policies | |
| name | L3P2 |
| routers | d71456e8-224c-4d73-9f34-407322a2b266 |
| shared | False |
| subnet_prefix_length | 24 |
| tenant_id | 4c4227827cce441481b041657d1a1595 |
+----------------------+---------------------------------------------------------+
[root@f3-controller ~(keystone_admin)]#
[root@f3-controller ~(keystone_admin)]# gbp external-segment-list
+--------------------------------------+---------+-------------+----------------+-----------------+--------------------------+--------+
| id | name | description | cidr | external_routes | port_address_translation | shared |
+--------------------------------------+---------+-------------+----------------+-----------------+--------------------------+--------+
| d1bc7d4b-664d-434c-9fc1-4b09edf3dcbe | MgmtOut | | 1.102.1.254/24 | | False | False |
| f618fed2-6da5-49f5-bea6-e8306237fa88 | DataOut | | 1.102.2.254/24 | | False | False |
+--------------------------------------+---------+-------------+----------------+-----------------+--------------------------+--------+
[root@f3-controller ~(keystone_admin)]#
[root@f3-controller ~(keystone_admin)]# gbp l3policy-update L3P2 --external-segment f618fed2-6da5-49f5-bea6-e8306237fa88=
Internal Server Error (HTTP 500) (Request-ID: req-869807ce-f127-4a1f-a3f1-a1b7307d9615)
[root@f3-controller ~(keystone_admin)]#
[root@f3-controller ~(keystone_admin)]# gbp l3policy-show L3P2
+----------------------+------------------------------------------------+
| Field | Value |
+----------------------+------------------------------------------------+
| description | |
| external_segments | {"f618fed2-6da5-49f5-bea6-e8306237fa88": [""]} |
| id | d8d3527b-4246-45e3-bc4d-ba223893180d |
| ip_pool | 40.40.0.0/16 |
| ip_version | 4 |
| l2_policies | |
| name | L3P2 |
| routers | 3c3f1e37-2b69-4926-8815-10a0e958386e |
| shared | False |
| subnet_prefix_length | 24 |
| tenant_id | 4c4227827cce441481b041657d1a1595 |
+----------------------+------------------------------------------------+
[root@f3-controller ~(keystone_admin)]#
2015-08-19 13:41:20.742 18183 DEBUG gbpservice.neutron.db.grouppolicy.group_policy_mapping_db [req-869807ce-f127-4a1f-a3f1-a1b7307d9615 None] gbpservice.neutron.services.grouppolicy.plugin.GroupPolicyPlugin method get_external_segments called with arguments (<neutron.context.Context object at 0x6012950>, {'id': set([u'f618fed2-6da5-49f5-bea6-e8306237fa88'])}, None, None, None, None, False) {} wrapper /usr/lib/python2.7/site-packages/neutron/common/log.py:33
2015-08-19 13:41:20.758 18183 DEBUG gbpservice.neutron.db.grouppolicy.group_policy_mapping_db [req-869807ce-f127-4a1f-a3f1-a1b7307d9615 None] gbpservice.neutron.services.grouppolicy.plugin.GroupPolicyPlugin method get_external_segments called with arguments (<neutron.context.Context object at 0x6012950>, {'id': [u'f618fed2-6da5-49f5-bea6-e8306237fa88']}, None, None, None, None, False) {} wrapper /usr/lib/python2.7/site-packages/neutron/common/log.py:33
2015-08-19 13:41:20.858 18183 ERROR gbpservice.neutron.services.grouppolicy.policy_driver_manager [req-869807ce-f127-4a1f-a3f1-a1b7307d9615 None] Policy driver 'apic' failed in update_l3_policy_postcommit
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager Traceback (most recent call last):
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/policy_driver_manager.py", line 119, in _call_on_drivers
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager getattr(driver.obj, method_name)(context)
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/cisco/apic/apic_mapping.py", line 641, in update_l3_policy_postcommit
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager self._create_and_plug_router_to_es(context, new_segment_dict)
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/cisco/apic/apic_mapping.py", line 1717, in _create_and_plug_router_to_es
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager context._plugin_context, router_id, interface_info)
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/resource_mapping.py", line 1824, in _add_router_gw_interface
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager {'router': {'external_gateway_info': gw_info}})
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/neutron/db/extraroute_db.py", line 75, in update_router
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager context, id, router)
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 1122, in update_router
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager id, router)
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 188, in update_router
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager context, id, gw_info)
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 263, in _check_router_needs_rescheduling
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager raise n_exc.BadRequest(resource='router', msg=msg)
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager BadRequest: Bad router request: No eligible l3 agent associated with external network c4f25d88-909f-4122-b820-51820ebc1b60 found
2015-08-19 13:41:20.858 18183 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager
2015-08-19 13:41:20.860 18183 ERROR neutron.api.v2.resource [req-869807ce-f127-4a1f-a3f1-a1b7307d9615 None] update failed
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 87, in resource
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource result = method(request=request, **args)
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 538, in update
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource obj = obj_updater(request.context, id, **kwargs)
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/common/log.py", line 34, in wrapper
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource return method(*args, **kwargs)
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/plugin.py", line 780, in update_l3_policy
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource policy_context)
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/policy_driver_manager.py", line 204, in update_l3_policy_postcommit
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource self._call_on_drivers("update_l3_policy_postcommit", context)
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/policy_driver_manager.py", line 134, in _call_on_drivers
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource method=method_name
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource GroupPolicyDriverError: update_l3_policy_postcommit failed.
2015-08-19 13:41:20.860 18183 TRACE neutron.api.v2.resource
2015-08-19 13:41:20.862 18183 INFO neutron.wsgi [req-869807ce-f127-4a1f-a3f1-a1b7307d9615 None] 172.28.184.45 - - [19/Aug/2015 13:41:20] "PUT /v2.0/grouppolicy/l3_policies/d8d3527b-4246-45e3-bc4d-ba223893180d.json HTTP/1.1" 500 325 0.508825

Tags: gbp
puppet-py (jbanerje)
description: updated
Changed in group-based-policy:
importance: Undecided → High
status: New → Confirmed
milestone: none → liberty-1
Changed in group-based-policy:
assignee: nobody → Ivar Lazzaro (mmaleckk)
Revision history for this message
Ivar Lazzaro (mmaleckk) wrote :

Please next time try to specify when a bug is driver specific (apic mapping in this case).
That said, this error refers to a code base that doesn't exist in tree yet.

At glance, I would say you are using https://review.openstack.org/#/c/219501 .Thanks for testing this. Please add a comment to that patch on this regard, at this time this issue is invalid since the code causing it is not in tree yet..

Revision history for this message
Ivar Lazzaro (mmaleckk) wrote :

Apic mapping driver requires the usage of 'apic_gbp_l3' as Neutron L3 Plugin. This should avoid the need of a L3 agent to manage external networks. Please confirm whether you are using it

Changed in group-based-policy:
status: Confirmed → Incomplete
Changed in group-based-policy:
importance: High → Undecided
Changed in group-based-policy:
milestone: liberty-1 → next
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.