Group creation in the OS Horizon UI fails when GBP with ODL GBP driver is used. The reason being the endpoint group payload passed to ODL is passed as a single element instead of list (which has been modified in ODL Lithium release) .
{
"endpoint-group": {
"consumer-named-selector": {
<---This contract is a leaf list in ODL Lithium release -->
"contract": "f1ac2a23-df54-3ca9-b302-38f015b11880",
"name": "Contract-f1ac2a23-df54-3ca9-b302-38f015b11880"
},
"id": "707ef2e3-ac91-4779-a3e6-2865f4be3b43",
"name": "g12",
"network-domain": "3c6e9a6a-861c-42bd-8d86-325c29b07905",
"provider-named-selector": {
<---This contract is a leaf list in ODL Lithium release -->
"contract": "f1ac2a23-df54-3ca9-b302-38f015b11880",
"name": "Contract-f1ac2a23-df54-3ca9-b302-38f015b11880"
}
}
}
The error seen in neutron server.log is 400: Bad Client Request as shown below
2015-09-01 12:03:11.291 19214 DEBUG gbpservice.neutron.services.grouppolicy.drivers.odl.odl_manager [req-e9530e5f-ce95-49aa-8a43-188fda237a1d None] Sending METHOD (put) URL (http://10.156.48.250:8181/restconf/config/policy:tenants/policy:tenant/6d85106d-5c2e-4cb3-99f9-4acc686c8520/policy:endpoint-group/707ef2e3-ac91-4779-a3e6-2865f4be3b43) _sendjson /usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/odl/odl_manager.py:142
2015-09-01 12:03:11.292 19214 DEBUG gbpservice.neutron.services.grouppolicy.drivers.odl.odl_manager [req-e9530e5f-ce95-49aa-8a43-188fda237a1d None] ({
"endpoint-group": {
"consumer-named-selector": {
"contract": "f1ac2a23-df54-3ca9-b302-38f015b11880",
"name": "Contract-f1ac2a23-df54-3ca9-b302-38f015b11880"
},
"id": "707ef2e3-ac91-4779-a3e6-2865f4be3b43",
"name": "g12",
"network-domain": "3c6e9a6a-861c-42bd-8d86-325c29b07905",
"provider-named-selector": {
"contract": "f1ac2a23-df54-3ca9-b302-38f015b11880",
"name": "Contract-f1ac2a23-df54-3ca9-b302-38f015b11880"
}
}
}) _sendjson /usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/odl/odl_manager.py:143
2015-09-01 12:03:11.293 19214 DEBUG gbpservice.neutron.services.grouppolicy.drivers.odl.odl_manager [req-e9530e5f-ce95-49aa-8a43-188fda237a1d None] ========================================================= _sendjson /usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/odl/odl_manager.py:144
2015-09-01 12:03:11.304 19214 ERROR gbpservice.neutron.services.grouppolicy.policy_driver_manager [req-e9530e5f-ce95-49aa-8a43-188fda237a1d None] Policy driver 'odl' failed in create_policy_target_group_postcommit
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager Traceback (most recent call last):
2015-09-01 12:03:11.304 19214 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-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager getattr(driver.obj, method_name)(context)
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/odl/odl_mapping.py", line 319, in create_policy_target_group_postcommit
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager self.odl_manager.create_update_endpoint_group(tenant_id, epg)
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/odl/odl_manager.py", line 255, in create_update_endpoint_group
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager self._sendjson('put', url, self._headers, data)
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/odl/odl_manager.py", line 153, in _sendjson
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager r.raise_for_status()
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/requests/models.py", line 834, in raise_for_status
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager raise HTTPError(http_error_msg, response=self)
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager HTTPError: 400 Client Error: Bad Request
2015-09-01 12:03:11.304 19214 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager
2015-09-01 12:03:11.474 19214 ERROR gbpservice.neutron.services.grouppolicy.plugin [req-e9530e5f-ce95-49aa-8a43-188fda237a1d None] create_policy_target_group_postcommit failed, deleting policy_tar