The problem description:
The number of private networks (internal networks for the instances) is limited by the fact that the curl requests that instances make (i.e. curl -I http://<server IP>/2009-04-04/meta-data/instance-id/) returns the ENTIRE list of networks, and at a certain point this exceed the 8190 URI length limit for apache (which neutron-metadata-agent uses as webserver backend).
Here is the URI that the metadata curl request generates on the OpenStack side in case:
/v2.0/ports.json?network_id=ce1dc3ce-6a23-4067-b97b-2d774b95a38e&network_id=108fef5f-fcaa-4c61-a9eb-0aed4ca27638&network_id=ce1e0a35-bddf-46b2-a6e4-a285310ee27b&network_id=7329c284-69c5-4085-8c4b-a423968f277c&network_id=25d51663-2aca-4cfd-8351-ebb6fe6ac21e&network_id=47968396-8dcf-45d2-b7ca-7b142779606b&network_id=f1d8fcc5-74dd-4e45-897f-acfc349bf214&network_id=ab868487-0b8f-4f2d-9fa7-07cef6a4d08c&network_id=d6c62b22-46b7-4bf6-9973-12c7366ee0aa&network_id=13d809ad-34e9-4c7e-a89e-3b1d0ad46516&network_id=9a45b6af-98c2-41da-9742-0f1be9653a7f&network_id=cd4ebaea-9437-4ed1-834d-6ba1285f458e&network_id=7ad5b66b-c913-429f-9608-0df761d4a1c0&network_id=1cc8e42f-f8d7-47cc-89a9-084193388529&network_id=eaa69786-f63c-4576-9798-f6e6e1781b77&network_id=4f24a32a-5066-4dfd-9564-bb0175ba398a&network_id=f82890ec-4422-499d-b9b2-991c4db133a7&network_id=d18aa4b6-4336-4813-876a-b1e036020691&network_id=e767f01a-3874-4cbd-95c9-821cb597e584&network_id=00fb2bef-fd6d-4bd7-afd2-21b792f2d327&network_id=54234780-1867-4aca-8c84-9da17f57fb64&network_id=d5fc9a5b-b211-40a9-9a10-80132a59abf9&network_id=3eeb9b41-c7ee-4b92-bb0e-fcee30877e6b&network_id=7cf2db1f-0b45-42fc-acf1-e1e5f7d37f9a&network_id=7c0f8b11-e6b6-4d0a-9b75-62a849c310d4&network_id=58af0513-8ab2-4dc8-8303-3f75f0ee1915&network_id=e37fd173-71a9-4c85-b15c-a0b43173bcbe&network_id=a1bcf2d1-1dee-45dc-8554-6776197609b8&network_id=8867cc58-044a-4f43-aea9-0c3616509c14&network_id=f453ba4a-68f1-4e78-9ee9-f6236b1e26cd&network_id=eef09a5e-6c38-4ae9-9375-d4dffce96465&network_id=caeb38af-bd77-48bd-bc7a-54267d15d386&network_id=20209828-2b66-4d6d-a6ed-11bbe97ae2f7&network_id=8ce7b415-eede-4d84-bcc8-5b5342560b05&network_id=8883efbf-5a07-4c95-b140-85e038c2f8fe&network_id=5a5fb19d-8fc3-483c-9d17-fbe011849a46&network_id=dfc92ac5-9d2a-4e98-b08c-d40765e0f8a3&network_id=966a9801-c42a-4b36-a959-d74d7b355d03&network_id=47994b11-9f14-4708-bc1a-7adc98d4c0e1&network_id=fd48c2d2-bb7d-4886-a890-6f23a3ecdca9&network_id=5b19cee1-8c91-4fda-9d0d-6f6ba6632f56&network_id=bc50eada-2419-4bd2-80d2-86ccd9e1266c&network_id=51bfc8c3-c06a-4ed6-a492-cf55d380ac33&network_id=fb58fce6-be4a-4a46-89a3-bf1ff9ace954&network_id=7892b3d2-216a-4ea3-a45b-f1311180c638&network_id=f32e446b-1a56-42cd-8fe3-9ecae6405bef&network_id=53c8eff9-2657-4a7f-b02a-f86b28411eec&network_id=710af1e4-27af-4393-b46d-30c6e6dbb606&network_id=9e94f25b-e49e-4804-a784-f4c325e727ae&network_id=03933632-a885-474b-acd7-a980ef1120e3&network_id=fabac2ac-ffea-4d1c-8f85-7856a846641f&network_id=bfb0570c-84b8-4c2e-ba62-f011d1950591&network_id=8ef1ccf3-c11c-4010-b6ed-f599d97fb565&network_id=ac3b8389-45d9-4a3b-9188-1059912c8565&network_id=65704511-430c-4760-a78a-21c7b0a1dd2c&network_id=19e16f27-d69f-4d4b-8487-6a7b6d468eb9&network_id=0512afdb-4e54-4bb8-abc7-793975734bb1&network_id=1d2bcb94-1a25-4bbb-88c2-d946d3acc3af&network_id=6e53d931-b036-46fc-b849-81263f11aca7&network_id=56225598-96ec-4d48-b702-a38c9bf6bec5&network_id=312c22f3-1291-4885-bdf9-079cfc2f766b&network_id=cc3083f7-f552-44ac-bad7-7a7e9e880fcb&network_id=10d618bc-0745-4294-be19-2a353756e78d&network_id=24716fa2-2680-4ca9-b026-e2b4b2fd5d08&network_id=8850aafc-ace8-4ac8-87aa-6de25cf6557c&network_id=506a1e17-b2e8-4571-acba-af300c4ccf29&network_id=e1233e15-f839-478f-9328-9c6ceb1e0e4b&network_id=a6c778a5-adf0-4f8f-8460-ead0c9636206&network_id=ae50ed79-221b-4817-b456-82ef1e1285bb&network_id=6192fad1-82ee-4a24-8b6f-c1bbfa62a0e8&network_id=b37e679d-4e96-47d2-b52c-44cb25708132&network_id=6f5146db-cfa4-4ab4-840f-06345a036401&network_id=659672a1-c0d5-408a-9929-a5c5759ec0bf&network_id=45de56b1-2691-409b-a6d0-8a8ba3e16ac6&network_id=9625b113-3a47-441c-a3ea-a649e0274c0f&network_id=b29a85eb-05cc-4f10-aace-fd035b9d49bf&network_id=71a110d7-72a1-4a89-9df5-b5df6d441794&network_id=eca28062-3779-4b4f-95f2-d97eb20def56&network_id=ef65f55b-a908-4777-bbc5-99e821be0c33&network_id=604edad9-4201-47f9-8cad-ecdd1c237973&network_id=35d74d36-f379-4902-9560-112845d64cba&network_id=c47b771d-24d9-491f-af81-fc7451b0a9a9&network_id=3643b5ac-7867-4d72-b7a8-95b623c5100b&network_id=15520eff-7cd3-4baf-a9e2-7a159e0a9687&network_id=8c3e6c37-5067-4b06-b647-07d92faa371f&network_id=8dba215d-5b8e-4811-9a72-dfe4a2a299f7&network_id=a8cf7931-ec7f-4a66-bdf0-62dd1f89a776&network_id=e867f27d-8e7d-4c18-8bd4-aa16358e3a84&network_id=fbe785dd-96ce-45b5-a21c-f07a5bfd6a49&network_id=cc8d3030-363f-46d1-b60d-fd493a4bf399&network_id=1b2afb06-6e3d-417d-9b51-5da7694c5668&network_id=b7d250ef-43a6-4486-83a4-5d52d28fd184&network_id=03a2a12b-9e1a-4f1d-9230-29d79bdaec8a&network_id=a14a8cc3-745c-4bbe-97a8-a62196d19309&network_id=4918e2b1-ecab-4460-a004-006cf870599d&network_id=5d5d670d-b2a2-4c0f-a402-6b7b06572267&network_id=1afeabda-6b11-4d07-a38c-b8c8f45fd1f2&network_id=b84e4ee9-48c6-404c-bc3c-9d70d861c1d3&network_id=ade51ab2-beda-42a1-a5a5-50485bfdfb20&network_id=89c0e381-bbdf-4651-99f5-3c021e775b41&network_id=527f6f7d-c579-496e-b9da-b2892dae2a91&network_id=cbd928ac-a364-4ad0-b3d7-45d11bbd0739&network_id=e91cd98e-7857-4cab-9c9e-c15e0d06988e&network_id=cf52f6b6-5beb-4ef6-8338-b3ec342e6cbe&network_id=e061ef26-3efc-4127-87bc-03ae766bb6cb&network_id=560bb600-bb71-4360-93de-9f5a86c509f4&network_id=0820adfb-047f-4f78-affe-0e4e0cb672a2&network_id=465b64f9-0dc9-4512-b20e-1ae3bd00553f&network_id=46ca8b2e-2fae-4e56-92bc-686b9722dd8c&network_id=96839919-c0b7-44a8-8f62-f4456758dd96&network_id=9af448bd-a978-4d9d-83b8-40b57da2f9e4&network_id=778818eb-9a73-4da5-9c6b-ccc304c63d5f&network_id=15f7b3c9-c45b-44dc-bd16-92c8aff91a5e&network_id=2f35ef62-86d5-4985-b86b-ca444b5d4818&network_id=361f0946-c488-4a72-9338-6168f5c8bd26&network_id=3f7b6859-c2e2-4ceb-8250-2106d2673e82&network_id=91f91a5a-0524-4bd7-bcb1-9bfc89712956&network_id=fcf5f676-8c02-46a8-977b-f0c041043287&network_id=2dc791e1-c12c-4d68-a8b8-2b5589e75974&network_id=c6a761c6-cba4-4248-9829-e1e903a3d3b5&network_id=601cee06-afcf-47e2-a3d3-75247aac4022&network_id=932b404c-0f14-433b-8ba6-9a311007e1b9&network_id=0f82a7e5-294d-41d2-833d-cc69c0564e71&network_id=1b2e4d2b-4e71-4131-87af-a71ce7c1ff36&network_id=4089c593-ef6d-4331-b3bf-67b56f371e08&network_id=5d69a9d4-6517-4b62-ab6e-f39e9eb119a0&network_id=878ee765-bc99-41c7-a5fe-e31bfe0b5339&network_id=b9a15848-0759-4ca7-ad2a-8ab5aeab2898&network_id=e5211cb8-61cc-4f6b-bbae-7f249cf753bd&network_id=435d5e91-75ed-479c-bd9d-0674945fb8be&network_id=6ae531c9-d1a7-495f-9bed-c221ae0e5c8b&network_id=d116c6e1-2573-47b6-81bf-0540b8bc7eb0&network_id=90aa5157-d1be-41ae-9270-a01693b01653&network_id=39994e95-fe11-4878-8811-87e9afd85548&network_id=76b563ae-4f1e-4a2e-8f96-ac80a59b169d&network_id=11d78a66-ca5c-40ad-abca-9c6c0dfd75da&network_id=cbf71b5f-d894-46a2-9567-f4341df5c8e3&network_id=f5f015d6-44e1-454e-89b6-3f04c9c63b06&network_id=f6f2fdc3-2692-4cfe-a356-7743fe785a7a&network_id=3165e8c0-3e7d-428b-845a-e9481c7ae7b0&network_id=ae04bc3f-75a5-4ae8-a3ae-a6042f4a3ca4&network_id=b5f492a4-b6d1-4e20-8649-e4547febdf22&network_id=7d52efaa-76ae-41a1-bb28-4b1c92a8802f&network_id=3d381bf9-f8a3-4b70-8780-0e0b45ded03a&network_id=60548a6f-ed01-4c3a-b9e7-00d6e67b1d35&network_id=b35437a5-0400-40ac-94ec-7661e53f1a62&network_id=f3c7bd67-a3f0-458d-97aa-fd6e339eac7c&network_id=50e1342e-f936-4073-9ba5-c669593df0b7&network_id=b2222aba-f416-4684-8ff7-2e96a8ec0bf8&network_id=a05d8b59-5d07-4cb4-a31e-9016a516b485&network_id=9165faa6-ee87-4b5f-9b9c-f4610bc19df7&network_id=a0856fc7-0328-4bf7-9da7-0503a024b9c6&network_id=7b6025b6-1196-4b6a-8a05-9b53ed92ebba&network_id=cddc61d2-ae24-484c-9508-2d628a8019ee&network_id=5978f660-8353-4be6-859b-3637b3a87090&network_id=8b98dfd8-4685-4093-9944-32f3e1e81245&network_id=532bb319-e78f-4e88-98b3-37bc7d0c5476&network_id=1b84bffa-0625-4fe1-b563-204bd922056c&network_id=764824d9-9e55-4032-a433-8cbd306c7507&network_id=ca472d10-a27d-4d07-a704-0c77096925a2&network_id=abb59c35-3a6d-4062-bc56-618b3e6826da&network_id=540f26ff-3fb9-4498-9874-90dca92f0fa4&network_id=6ccb6ac4-be6f-461a-9cb9-ce37c02bd9c8&network_id=eb65a45a-22e9-46b8-bb61-9fc05622886d&network_id=7a87f7e6-1dc6-4bd1-b737-8baa458bc3d2&network_id=e7fcb223-941d-499e-a390-97a120d4fb54&network_id=d927261b-8405-40c4-91b7-26d3b175720c&network_id=dce6ebb4-b1e2-498a-bf01-53d92ea62685&network_id=9cea528a-4dcc-48b4-b062-5ed50b0eed53&network_id=eedda88a-4eb7-4640-8efa-9318cda15957&network_id=3482ad24-1e4d-427b-a90f-ee9b1def596c&network_id=0f502647-a700-4e23-b3e4-f10537ca3804&network_id=296aadee-7961-4a8d-b870-9578b0b2d2e5&network_id=a154e040-5c0b-42ac-9c06-096fa4d2d1b9&network_id=0b1ffdf8-1f4e-4d15-b6be-3065be9cda0a&network_id=98ed63be-b697-4824-b83d-238c558910aa&fixed_ips=ip_address%3D10.0.45.2
As you can see, it’s super long, 8497 characters, this breaks Apache.
Similar case - URI too long; but for security groups https://bugs.launchpad.net/python-neutronclient/+bug/1271462
For this bug fix was applied: https://review.openstack.org/#/c/95990/
Basically - (from code) ‘# 1 char of extra URI len will cause a split in 2 requests’ (https://review.openstack.org/#/c/95990/3/neutronclient/tests/unit/test_cli20_securitygroup.py)
I believe there are more clients, which do not support request splitting by length.
Upstream bug: https://bugs.launchpad.net/neutron/+bug/1348097
This particular case you are talking about is a python- neutronclient/ neutron- metadata- agent issue, so I'm not sure why you assigned MOS Nova team to fix it.
At the same time, I agree, that we might have similar issues in nova/python- novaclient, although I haven't seen ones yet. Can you point me to specific problems in Nova?
We'll need to find out, if we can fix this once and for all, or the fixes will be per-case as with the python- neutronclient fix you mentioned here.