Value of perserve_on_delete not correct after _heal_instance_info_cache

Bug #1834463 reported by hulina
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Triaged
Medium
Unassigned
Stein
Triaged
Medium
Unassigned

Bug Description

Description
===========
We spawn VM with port-id ,the value of preserve_on_delete is True ,When we lose some ports from instance_info_caches ,after periodic task _heal_instance_info_cache the instance_info_caches are recovery from neutron, however the value of preserve_on_delete became False,not the original value True.

Steps to reproduce
==================
1.Spawn VM with command :nova boot --flavor xx --nic port-id xx --image xx instance_name
2.nova interface-list instance_name(Preserve On Delete is True)
3.Update nova db row, drop one interface from interfaces,such as
Update instance_info_caches set network_info='[]' where instance_uuid='xxx';
4.nova show instance_name (we can see ,vm lost network info )
5.after periodic task _heal_instance_info_cache , interface is added to the instance
6.nova interface-list instance_name (Preserve On Delete became False ,not the original value)

Tags: neutron
Revision history for this message
Matt Riedemann (mriedem) wrote :

This is the related mailing list thread:

http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007363.html

I've proposed that when forcefully rebuilding the cache, since we don't know which ports nova created on behalf of the user, we should detect that and set preserve_on_delete=True so that the ports are not accidentally deleted when the server is deleted (or when the ports are detached). This is a change in behavior for the user, but so is deleting the ports they didn't want us to delete and that's arguably worse. With my suggested solution we'd at least give the owner of the port the chance to clean it up.

tags: added: neutron
description: updated
Changed in nova:
status: New → Triaged
importance: Undecided → Medium
Matt Riedemann (mriedem)
summary: - Value of perserve_on_delete not corrte after _heal_instance_info_cache
+ Value of perserve_on_delete not correct after _heal_instance_info_cache
Revision history for this message
hulina (sharonhu) wrote :

I think the value of preserve on delete should be consistent with the initial value

Revision history for this message
Matt Riedemann (mriedem) wrote :

> I think the value of preserve on delete should be consistent with the initial value

I'm pretty sure we don't have that information though, which is why we are storing it in the instance's network info cache. We don't store the initial requested networks during server create nor when attaching an interface to the server and nova creates the port on the provided network. So the problem is a chicken-and-egg issue.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.