Thanks for providing a detailed bug report complete with log excerpts. From the log, we can see that the error you're hitting is coming from the python-neutronclient code:
RequestURITooLong: An unknown exception occurred.
Looking at the nova code where this is being emitted from nova/network/neutronv2/api.py in the _get_subnets_from_port method [1], it looks like this:
search_opts = {'id': [ip['subnet_id'] for ip in fixed_ips]}
data = client.list_subnets(**search_opts)
with the second line being the call to neutron. It's calling the neutron /subnets API with a list of subnet IDs per fixed IP. I think it's this API [2] with using the 'fields' request parameter, for example:
The python-neutronclient code will add all of the parameters to the query string [3].
So, because you have 250 interfaces attached to your instance, the request to neutron is too long because 250 subnet_ids are in the URI and we fail with RequestURITooLong.
Are your interfaces attached to 250 different subnets? If not, then I think in nova we could improve the code to de-dupe subnet_ids before we call neutron. Other than that, if you really needed to have 250 different subnets filtered in the neutron API, you would need to propose a change to the python-neutronclient project to send query parameters in the request body instead of in the URI as a query string.
As a test, could you try changing the line in nova/network/neutronv2/api.py from:
search_opts = {'id': [ip['subnet_id'] for ip in fixed_ips]}
to:
search_opts = {'id': set([ip['subnet_id'] for ip in fixed_ips])}
Thanks for providing a detailed bug report complete with log excerpts. From the log, we can see that the error you're hitting is coming from the python- neutronclient code:
RequestURIToo Long: An unknown exception occurred.
Looking at the nova code where this is being emitted from nova/network/ neutronv2/ api.py in the _get_subnets_ from_port method [1], it looks like this:
search_opts = {'id': [ip['subnet_id'] for ip in fixed_ips]} list_subnets( **search_ opts)
data = client.
with the second line being the call to neutron. It's calling the neutron /subnets API with a list of subnet IDs per fixed IP. I think it's this API [2] with using the 'fields' request parameter, for example:
/subnets? id=<subnet_ id1>&id= <subnet_ id2>&id= <subnet_ id3>...
The python- neutronclient code will add all of the parameters to the query string [3].
So, because you have 250 interfaces attached to your instance, the request to neutron is too long because 250 subnet_ids are in the URI and we fail with RequestURITooLong.
Are your interfaces attached to 250 different subnets? If not, then I think in nova we could improve the code to de-dupe subnet_ids before we call neutron. Other than that, if you really needed to have 250 different subnets filtered in the neutron API, you would need to propose a change to the python- neutronclient project to send query parameters in the request body instead of in the URI as a query string.
As a test, could you try changing the line in nova/network/ neutronv2/ api.py from:
search_opts = {'id': [ip['subnet_id'] for ip in fixed_ips]}
to:
search_opts = {'id': set([ip[ 'subnet_ id'] for ip in fixed_ips])}
and see if that helps you?
[1] https:/ /github. com/openstack/ nova/blob/ 85b36cd2f82ccd7 40057c1bee08fc7 22209604ab/ nova/network/ neutronv2/ api.py# L2875-L2889 /developer. openstack. org/api- ref/network/ v2/index. html#list- subnets /github. com/openstack/ python- neutronclient/ blob/15d99a7d68 435132fd2fbd4ba 604c3796802a83e /neutronclient/ v2_0/client. py#L276
[2] https:/
[3] https:/