De-dupe subnet IDs when calling neutron /subnets API
In the _get_subnets_from_port method, we call the neutron /subnets API
to list subnets filtered by subnet IDs. We get the subnet IDs by
iterating all of the fixed IPs for the instance and sending the list of
corresponding subnet IDs. The python-neutronclient sends the list of
subnet IDs as a query string in the URI. When an instance has a large
number of interfaces attached, the list of subnet IDs can be too long
for the URI, resulting in a RequestURITooLong error from neutronclient.
This de-dupes the subnet IDs before calling neutron, to handle the case
where an instance has a large number of interfaces attached, but many
of them are on the same subnet.
Closes-Bug: #1796074
Change-Id: I5b52ff81f74ae7cb11e6f012ab7e53cfc6821486
(cherry picked from commit ab5fc6870260d3b3c3bce90a7123c17816bf0093)
(cherry picked from commit 057a05dbbd7e4b9aea0aaa52f4bf6c1089f079be)
Reviewed: https:/ /review. openstack. org/616551 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=346c8feb583 7b33b3759c7faab a486715e32b685
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit 346c8feb5837b33 b3759c7faaba486 715e32b685
Author: melanie witt <email address hidden>
Date: Thu Oct 4 17:37:59 2018 +0000
De-dupe subnet IDs when calling neutron /subnets API
In the _get_subnets_ from_port method, we call the neutron /subnets API neutronclient sends the list of
to list subnets filtered by subnet IDs. We get the subnet IDs by
iterating all of the fixed IPs for the instance and sending the list of
corresponding subnet IDs. The python-
subnet IDs as a query string in the URI. When an instance has a large
number of interfaces attached, the list of subnet IDs can be too long
for the URI, resulting in a RequestURITooLong error from neutronclient.
This de-dupes the subnet IDs before calling neutron, to handle the case
where an instance has a large number of interfaces attached, but many
of them are on the same subnet.
Closes-Bug: #1796074
Change-Id: I5b52ff81f74ae7 cb11e6f012ab7e5 3cfc6821486 3c3bce90a7123c1 7816bf0093) aea0aaa52f4bf6c 1089f079be)
(cherry picked from commit ab5fc6870260d3b
(cherry picked from commit 057a05dbbd7e4b9