Deleted instances are resurrected by nova startup code

Bug #1255144 reported by Paul Murray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
ashwini

Bug Description

When the nova manager starts it goes through code to initialise the host (init_host), including each instance (in _init_instance). The _init_instance code checks the instance power state in the database; if it is power_state.RUNNING and the instance on the host is not power_state.RUNNING, it will start the instance. One side-effect of this is that instances that are in the task state "deleting" and are not there when the manager starts up will be recreated.

This needs to be changed to stop deleted instances being recreated.

Tags: compute
Revision history for this message
Paul Murray (pmurray) wrote :

This is related to: https://bugs.launchpad.net/nova/+bug/1247174

The point of this bug is that instances that have been deleted actually get recreated. Whether or not partial deletions are continued, instances should not be recreated.

Revision history for this message
John Garbutt (johngarbutt) wrote :

Nasty, we don't want them coming back to life.

Does this only happen if you have soft_delete enabled?

Changed in nova:
status: New → Triaged
importance: Undecided → High
tags: added: compute
Joe Gordon (jogo)
Changed in nova:
milestone: none → icehouse-3
Changed in nova:
milestone: icehouse-3 → none
Revision history for this message
ashwini (ashwini-mhatre) wrote :
  • bug.docx Edit (673.5 KiB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)

This bug is not reproduced. I checked the code of /opt/stack/nova/nova/compute/managar.py file but there also I could not find any code to re-create the VM in "_init_instance" method when the task_state is "deleting" so I analysed that bug is fixed.
The solution for already fixed bug "https://bugs.launchpad.net/nova/+bug/1247174" and current bug is same.
I am attaching my bug trace for more details.

Changed in nova:
assignee: nobody → ashwini (ashwini-mhatre)
Revision history for this message
Paul Murray (pmurray) wrote :

Reviewed: https://review.openstack.org/55660
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0252d0981af9daaf9370a50c28d8baf4a9d29619
Submitter: Jenkins
Branch: master

This was fixed by the following fix to https://bugs.launchpad.net/nova/+bug/1247174

commit 0252d0981af9daaf9370a50c28d8baf4a9d29619
Author: Stanislaw Pitucha <email address hidden>
Date: Fri Nov 8 13:38:08 2013 +0000

    Cleanup 'deleting' instances on restart

    In case some instance was marked as deleting but for some reason didn't
    finish (for example request was stuck in libvirt), retry the delete at
    startup. This happens at startup and on the host owning the instance,
    so there's no reason to use the lock.

    Change-Id: Iad18e9a7c6cb8e272e67a82284127ad895441dcf
    Partial-Bug: #1248563
    Closes-Bug: 1247174
    Implements: blueprint recover-stuck-state

Changed in nova:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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