This should be OK since allow_post of external_gateway_info is True.
--- log ---
$ quantum net-show net-ext
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | 364db7e1-6343-497b-bc9b-0c6ec72fce3f |
| name | net-ext |
| provider:network_type | local |
| provider:physical_network | |
| provider:segmentation_id | |
| router:external | True |
| shared | False |
| status | ACTIVE |
| subnets | 9454a527-5e59-4e36-8bb2-ee188b24fb85 |
| tenant_id | be3fc4694da2413c833574d6e018d338 |
+---------------------------+--------------------------------------+
$ quantum -v router-create router-test -- --external_gateway_info type=dict network_id=364db7e1-6343-497b-bc9b-0c6ec72fce3f
DEBUG: quantumclient.quantum.v2_0.router.CreateRouter get_data(Namespace(admin_state_down=True, columns=[], formatter='table', name='router-test', prefix='', request_format='json', tenant_id=None, value_specs=['--external_gateway_info', 'type=dict', 'network_id=364db7e1-6343-497b-bc9b-0c6ec72fce3f'], variables=[]))
DEBUG: quantumclient.client REQ: curl -i http://172.17.190.3:5000/v2.0/tokens -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-quantumclient"
DEBUG: quantumclient.client REQ BODY: {"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "oda"}}}
DEBUG: quantumclient.client RESP:{'date': 'Tue, 09 Oct 2012 07:39:16 GMT', 'vary': 'X-Auth-Token', 'content-length': '2727', 'status': '200', 'content-type': 'application/json'}
DEBUG: quantumclient.client RESP BODY:{"access": {"token": {"expires": "2012-10-10T07:39:16Z", "id": "3dd65a586af1412c802643d04c4cf0f2", "tenant": {"enabled": true, "description": null, "name": "admin", "id": "be3fc4694da2413c833574d6e018d338"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://172.17.190.3:8774/v2/be3fc4694da2413c833574d6e018d338", "region": "RegionOne", "publicURL": "http://172.17.190.3:8774/v2/be3fc4694da2413c833574d6e018d338", "internalURL": "http://172.17.190.3:8774/v2/be3fc4694da2413c833574d6e018d338"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://172.17.190.3:9696/", "region": "RegionOne", "publicURL": "http://172.17.190.3:9696/", "internalURL": "http://172.17.190.3:9696/"}], "endpoints_links": [], "type": "network", "name": "Quantum Service"}, {"endpoints": [{"adminURL": "http://172.17.190.3:3333", "region": "RegionOne", "publicURL": "http://172.17.190.3:3333", "internalURL": "http://172.17.190.3:3333"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://172.17.190.3:9292", "region": "RegionOne", "publicURL": "http://172.17.190.3:9292", "internalURL": "http://172.17.190.3:9292"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://172.17.190.3:8776/v1/be3fc4694da2413c833574d6e018d338", "region": "RegionOne", "publicURL": "http://172.17.190.3:8776/v1/be3fc4694da2413c833574d6e018d338", "internalURL": "http://172.17.190.3:8776/v1/be3fc4694da2413c833574d6e018d338"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://172.17.190.3:8773/services/Admin", "region": "RegionOne", "publicURL": "http://172.17.190.3:8773/services/Cloud", "internalURL": "http://172.17.190.3:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://172.17.190.3:8000/v1", "region": "RegionOne", "publicURL": "http://172.17.190.3:8000/v1", "internalURL": "http://172.17.190.3:8000/v1"}], "endpoints_links": [], "type": "orchestration", "name": "Heat Service"}, {"endpoints": [{"adminURL": "http://172.17.190.3:35357/v2.0", "region": "RegionOne", "publicURL": "http://172.17.190.3:5000/v2.0", "internalURL": "http://172.17.190.3:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "admin", "roles_links": [], "id": "af4f007f3197436dad5e6e6df0a75003", "roles": [{"name": "KeystoneServiceAdmin"}, {"name": "admin"}, {"name": "KeystoneAdmin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["0351c121ed544e79a32c599f84ee898c", "61a36e1107e84ddc941317a6cedaae66", "7988289d6b0740259640c39a47c0d7c5"]}}}
DEBUG: quantumclient.client REQ: curl -i http://172.17.190.3:9696/v2.0/routers.json -X POST -H "User-Agent: python-quantumclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: 3dd65a586af1412c802643d04c4cf0f2"
DEBUG: quantumclient.client REQ BODY: {"router": {"external_gateway_info": {"network_id": "364db7e1-6343-497b-bc9b-0c6ec72fce3f"}, "name": "router-test", "admin_state_up": true}}
DEBUG: quantumclient.client RESP:{'date': 'Tue, 09 Oct 2012 07:39:16 GMT', 'status': '500', 'content-length': '88', 'content-type': 'application/json'}
DEBUG: quantumclient.client RESP BODY:{"QuantumError": "Request Failed: internal server error while processing your request."}
DEBUG: quantumclient.v2_0.client Error message: {"QuantumError": "Request Failed: internal server error while processing your request."}
ERROR: cliff.app Request Failed: internal server error while processing your request.
DEBUG: quantumclient.shell clean_up CreateRouter
DEBUG: quantumclient.shell got an error: Request Failed: internal server error while processing your request.
---
Yes, I see this following traceback:
2012-10-09 16:07:35 ERROR [quantum. api.v2. resource] create failed quantum/ quantum/ api/v2/ resource. py", line 95, in resource request= request, **args) quantum/ quantum/ api/v2/ base.py" , line 331, in create request. context, **kwargs) quantum/ quantum/ db/l3_db. py", line 154, in create_router router_ dict(router_ db) quantum/ quantum/ db/l3_db. py", line 131, in _make_router_dict gw_port[ 'network_ id']
Traceback (most recent call last):
File "/opt/stack/
result = method(
File "/opt/stack/
obj = obj_creator(
File "/opt/stack/
return self._make_
File "/opt/stack/
nw_id = router.
TypeError: 'NoneType' object has no attribute '__getitem__'
This has to do with some unexpected behavior from SQLAlchemy in which the "gw_port" relationship on the Router object is not loaded in create_port(), even though the router[ 'gw_port_ id'] is populated. Very similar logic for update_port() seems to behave correctly, so this requires more investigation (ideally by someone who understands sqlalchemy relationships well)