Service instance teardown makes non-optimal neutron port-list query
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Shared File Systems Service (Manila) |
Fix Released
|
Low
|
George Melikov |
Bug Description
Description
===========
Manila's Generic driver and Windows drivers use the service instance helper module to create and manage the lifecycle of share servers. While tearing down the service instance, we release the ports associated with the instance, and if the subnet is unused by any other service instance, we remove it from the router provisioned.
In order to identify if there are any ports being used on the subnet, we list *all* the ports:
This can be a very expensive call; and is absolutely unnecessary for us to get all ports and then filter them based on their subnet_id. Instead, we can rely on the subnet_id filtering in the neutron API: https:/
Steps to reproduce
==================
* Deploy manila with the generic driver
* Create a share network, and a share on that share network
* Delete the share, and the associated share server (or set "[DEFAULT]
* Watch the neutron API calls in the neutron API log. The GET /ports call from manila retrieves *all* ports known to neutron
Expected result
===============
Manila only requests the ports relevant to its operation to act upon.
Actual result
=============
Manila requests a complete port list from neutron, and performs client side filtering to grab the relevant ones.
Environment
===========
1. OpenStack master
2. Which storage backend did you use? Generic
3. Which networking type did you use? Neutron with OpenVSwitch
Fix proposed to branch: master /review. opendev. org/#/c/ 712972/
Review: https:/