Nova unplug interface race condition when deleting an instance
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Arnaud Morin | ||
Queens |
Confirmed
|
Low
|
Unassigned | ||
Rocky |
Confirmed
|
Low
|
Unassigned | ||
Stein |
Fix Committed
|
Low
|
Arnaud Morin |
Bug Description
Description
===========
When nova start an instance, it asks neutron to create a port and then update the instance info cache based on information from neutron.
If, in the middle of the spawning, the instance is getting deleted, the terminate_instance function is called with an instance object that DOES NOT contain any network info.
As a result, nova is deleting the instance but is never unplugging the interface.
Step to reproduce
=================
I am booting an instance and immediately deleting it thanks to a command like:
$ openstack server create --key-name fake --image ubuntu1810 --flavor c2-7 --net Ext-Net arnaudubuntu1810-3 ; nova delete arnaudubuntu1810-3
- [1] build_and_
- [3] terminate_instance is executed few seconds later, but is waiting for the semaphore to be released. At this time, the instance network_info cache may not be filled, depending if the [2] update_
- If we follow the code, we end up at _shutdown_instance [4], which is doing a call to [5] get_network_info, which is returning a NetworkInfo object that contains no interface.
- At the end, nova is calling _unplug_vifs [6] which is doing nothing (no vif)
Note that I am running OpenStack Newton release, but the code involved seems identical on master.
[1] https:/
[2] https:/
[2] https:/
[4] https:/
[5] https:/
[6] https:/
tags: | added: compute neutron |
Changed in nova: | |
importance: | Undecided → Low |
Changed in nova: | |
assignee: | Arnaud Morin (arnaud-morin) → Matt Riedemann (mriedem) |
Changed in nova: | |
assignee: | Matt Riedemann (mriedem) → Arnaud Morin (arnaud-morin) |
Changed in nova: | |
assignee: | Arnaud Morin (arnaud-morin) → Matt Riedemann (mriedem) |
Changed in nova: | |
assignee: | Matt Riedemann (mriedem) → Arnaud Morin (arnaud-morin) |
Changed in nova: | |
assignee: | Arnaud Morin (arnaud-morin) → Matt Riedemann (mriedem) |
Changed in nova: | |
assignee: | Matt Riedemann (mriedem) → Arnaud Morin (arnaud-morin) |
Fix proposed to branch: master /review. opendev. org/660761
Review: https:/