Bug 1668159

Summary: Nova Compute does not clean up host networking if UnexpectedDeletingTaskStateError is raised.
Product: Red Hat OpenStack Reporter: Robin Cernin <rcernin>
Component: openstack-novaAssignee: Stephen Finucane <stephenfin>
Status: CLOSED ERRATA QA Contact: James Parker <jparker>
Severity: high Docs Contact:
Priority: high    
Version: 13.0 (Queens)CC: bshephar, cmuresan, dasmith, eglynn, fsoppels, jhakimra, jparker, kchamart, ltamagno, lyarwood, mbooth, pamadio, rcernin, sbauza, sgordon, sknauss, smooney, stephenfin, vromanso
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-nova-17.0.13-5.el7ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-24 11:52:31 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:

Comment 2 smooney 2019-01-25 12:27:49 UTC
looking at the upstream code when destroy is called in the libvirt driver
https://github.com/openstack/nova/blob/stable/queens/nova/virt/libvirt/driver.py#L988-L992
it calls cleanup  which calls _unplug_vifs
https://github.com/openstack/nova/blob/stable/queens/nova/virt/libvirt/driver.py#L1018-L1019

which then loops over all the vifs and unplugs them via the dirver 
https://github.com/openstack/nova/blob/stable/queens/nova/virt/libvirt/driver.py#L838-L845


looking at the downstream code it is identical and i have confimed that the downstream
code deletes the tap device created during plug as it does upstream.
https://github.com/openstack/nova/blob/stable/queens/nova/virt/libvirt/vif.py#L908-L919

the privsep wrapped plug_contrail_vif and unplug_contrail_vif fucntions
https://github.com/openstack/nova/blob/stable/queens/nova/privsep/libvirt.py#L225-L254
are also identical downsteam so based on the inspection of the code the behavior you describe
cannot happen.

can you provide the full nova compute logs and preferably the full sos report for this host.
based on the inspection of the code i feel i should be marking this as invalid but i will
review the logs if the full logs are provided.

Comment 10 smooney 2019-02-18 21:04:23 UTC
when nova recived a delete request for and instance that has been spawned on the host
but not yet updated in the db a UnexpectedDeletingTaskStateError exception will be raised
when the compute manager tries to update the db state.

when that happens we do not call self.driver.cleanup
https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L2030-L2036

as a result we do not clean up the vif for the instance.

this will need to be fixed upstream first and then we can backport the fix downstream to osp 13

Comment 20 Stephen Finucane 2019-08-12 16:38:46 UTC
I have this patch refreshed but I'm unable to reproduce. Would it be possible to provide a reproducer for me if I provided a scratch RPM to test with?

Comment 30 Matthew Booth 2019-10-21 08:02:33 UTC
I've added the requested functional test upstream.

Comment 32 Cristian Muresanu 2019-11-24 23:11:28 UTC
Hi guys, I'm wondering if this can be back-ported to RHOSP 10 as well ?
Thanks

Comment 33 Cristian Muresanu 2019-11-27 05:18:58 UTC
Hi, we're wondering if there is there is anyway to clean these ghost/stale interfaces manually?
Thanks,

Comment 45 Stephen Finucane 2020-03-31 14:47:49 UTC
This has landed upstream. I have the backports proposed for stable branches upstream and downstream. Hoping to get this closed out this week.

Comment 47 Stephen Finucane 2020-04-24 10:21:48 UTC
This has landed and will be included in the next OSP13 z-stream, 13z12.

Comment 59 errata-xmlrpc 2020-06-24 11:52:31 UTC
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:2725