Bug 1779138
| Summary: | Add additional debug logging for neutron OVN/ML2 trunk deletion | ||
|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | Andreas Karis <akaris> |
| Component: | openstack-neutron | Assignee: | Nate Johnston <nate.johnston> |
| Status: | CLOSED ERRATA | QA Contact: | Eran Kuris <ekuris> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 13.0 (Queens) | CC: | amuller, chrisw, jraju, lmartins, nate.johnston, scohen |
| Target Milestone: | z12 | Keywords: | Triaged, ZStream |
| Target Release: | 13.0 (Queens) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | openstack-neutron-12.1.1-7.el7ost | Doc Type: | No Doc Update |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-06-24 11:53:05 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Andreas Karis
2019-12-03 11:50:45 UTC
[root@overcloud-controller-1 containers]# docker ps | grep neutron 7c910bce2a13 registry.access.redhat.com/rhosp13/openstack-neutron-server-ovn:13.0-92 "dumb-init --singl..." 4 days ago Up 19 minutes (healthy) neutron_api I'm taking back my more generic request wrt OVN. I'd like to see more debug logging in this specific use case for deleting trunk ports, both for ML2-OVS and OVN:
~~~
[root@overcloud-controller-1 containers]# grep 'Trunk' /usr/lib/python2.7/site-packages/neutron -R | grep 'in use' -C2 -n
42-/usr/lib/python2.7/site-packages/neutron/services/trunk/exceptions.py:class PortInUseAsTrunkParent(n_exc.InUse):
43-/usr/lib/python2.7/site-packages/neutron/services/trunk/exceptions.py:class TrunkInUse(n_exc.InUse):
44:/usr/lib/python2.7/site-packages/neutron/services/trunk/exceptions.py: message = _("Trunk %(trunk_id)s is currently in use.")
45-/usr/lib/python2.7/site-packages/neutron/services/trunk/exceptions.py:class TrunkDisabled(n_exc.Conflict):
46-/usr/lib/python2.7/site-packages/neutron/services/trunk/exceptions.py: message = _("Trunk %(trunk_id)s is currently disabled.")
[root@overcloud-controller-1 containers]#
~~~
~~~
[root@overcloud-controller-1 containers]# grep TrunkInUse /usr/lib/python2.7/site-packages/neutron/ -R
Binary file /usr/lib/python2.7/site-packages/neutron/services/trunk/plugin.pyc matches
Binary file /usr/lib/python2.7/site-packages/neutron/services/trunk/exceptions.pyo matches
/usr/lib/python2.7/site-packages/neutron/services/trunk/exceptions.py:class TrunkInUse(n_exc.InUse):
/usr/lib/python2.7/site-packages/neutron/services/trunk/plugin.py: raise trunk_exc.TrunkInUse(trunk_id=trunk_id)
Binary file /usr/lib/python2.7/site-packages/neutron/services/trunk/plugin.pyo matches
Binary file /usr/lib/python2.7/site-packages/neutron/services/trunk/exceptions.pyc matches
~~~
~~~
/usr/lib/python2.7/site-packages/neutron/services/trunk/plugin.py
(...)
261 """Delete the specified trunk."""
262 with db_api.autonested_transaction(context.session):
263 trunk = self._get_trunk(context, trunk_id)
264 rules.trunk_can_be_managed(context, trunk)
265 trunk_port_validator = rules.TrunkPortValidator(trunk.port_id)
266 if not trunk_port_validator.is_bound(context):
267 # NOTE(status_police): when a trunk is deleted, the logical
268 # object disappears from the datastore, therefore there is no
269 # status transition involved. If PRECOMMIT failures occur,
270 # the trunk remains in the status where it was.
271 trunk.delete()
272 payload = callbacks.TrunkPayload(context, trunk_id,
273 original_trunk=trunk)
274 registry.notify(constants.TRUNK, events.PRECOMMIT_DELETE, self,
275 payload=payload)
276 else:
277 raise trunk_exc.TrunkInUse(trunk_id=trunk_id)
278 registry.notify(constants.TRUNK, events.AFTER_DELETE, self,
279 payload=payload)
(...)
With the merge of https://bugzilla.redhat.com/show_bug.cgi?id=1765640 we have added logs that display the addition and removal of trunk subports [0]. These logs are available on version python-networking-ovn-4.0.3-18.el7ost or newer. Could you please let us know if that is enough and if not, what kind of information in the logs is being required? Also, it may be better to have these log requirements done outside OVN, so it is not dependent on a given ml2 provider. [0]: openstack/networking-ovn / networking_ovn/ml2/trunk_driver.py def _set_binding_profile(self, context, subport, parent_port, ovn_txn): LOG.debug("Setting parent %s for subport %s", parent_port, subport.port_id) ... def _unset_binding_profile(self, context, subport, ovn_txn): LOG.debug("Unsetting parent for subport %s", subport.port_id) ... Looking at the file that I pointed to initially, this seems to be outside of OVN:
~~~
(undercloud) [stack@undercloud-0 ~]$ rpm -qf /usr/lib/python2.7/site-packages/neutron/services/trunk/plugin.py
python-neutron-12.1.0-2.el7ost.noarch
~~~
What I'd like to see is the following:
If a user tries to delete a trunk port that is still bound to an instance:
a) print the current error message that's returned to the API client in the logs as well. Note the following message is currently absent from the logs:
~~~
Error message: {"NeutronError": {"message": "Trunk 09d352d7-ef24-435b-bff5-820fa2a868f7 is currently in use.", "type": "TrunkInUse", "detail": ""}}
~~~
b) In both cases, logging the message to file and sending an error to the API cient, I'd like to see by whom the trunk is currently being used, e.g. instance xyz
Let me know if that's feasible or not.
Thanks,
Andreas
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2724 |