Evacuated instances that are deleted before the source host comes up causes cleanup not to happen

Bug #1687479 reported by Matt Rabe
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Rabe
Ocata
Fix Committed
Medium
Matt Rabe

Bug Description

Description
===========
When an instance is evacuated to another host, the VM remains on the source host until it is brought back up and deleted by compute via _destroy_evacuated_instances.

However if the VM that's created on the destination is deleted before the source host is brought back up, then _destroy_evacuated_instances won't reap the remains because it searches non-deleted records.

Steps to reproduce
==================
1. Deploy a VM.
2. Bring the host the VM is on down.
3. Evacuate the VM to a different host.
4. Delete the VM from the destination.
5. Bring the source host back up.

The source remnants from the evacuation will not be cleaned up, but they should be.

Suspect code is in the nova compute manager in _destroy_evacuated_instances:

1. MigrationList.get_by_filters doesn't appear to return deleted migration records.
2. {'deleted': False} is currently passed as the filter to _get_instances_on_driver.

Tags: evacuate
Changed in nova:
assignee: nobody → Dinesh Bhor (dinesh-bhor)
Changed in nova:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/467774

Changed in nova:
assignee: Dinesh Bhor (dinesh-bhor) → Matt Rabe (mdrabe)
status: Confirmed → In Progress
Changed in nova:
assignee: Matt Rabe (mdrabe) → Eric Fried (efried)
Matt Rabe (mdrabe)
Changed in nova:
assignee: Eric Fried (efried) → Matt Rabe (mdrabe)
Matt Riedemann (mriedem)
tags: added: evacuate
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/482620

Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/467774
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=42b1fa965028c12d6e78b70d2487d5dd49158176
Submitter: Jenkins
Branch: master

commit 42b1fa965028c12d6e78b70d2487d5dd49158176
Author: mdrabe <email address hidden>
Date: Wed May 24 15:56:13 2017 -0500

    Query deleted instance records during _destroy_evacuated_instances

    _destroy_evacuated_instances is responsible for cleaning up the
    remnants of instance evacuations from the source host. Currently
    this method doesn't account for instances that have been deleted
    after being evacuated.

    Change-Id: Ib5f6b03189b7fc5cd0b226ea2dca74865fbef12a
    Closes-Bug: #1687479

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/ocata)

Reviewed: https://review.openstack.org/482620
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2954f0dfc913c3ad6ffe8c5f1178c6711f64eb9d
Submitter: Jenkins
Branch: stable/ocata

commit 2954f0dfc913c3ad6ffe8c5f1178c6711f64eb9d
Author: mdrabe <email address hidden>
Date: Wed May 24 15:56:13 2017 -0500

    Query deleted instance records during _destroy_evacuated_instances

    _destroy_evacuated_instances is responsible for cleaning up the
    remnants of instance evacuations from the source host. Currently
    this method doesn't account for instances that have been deleted
    after being evacuated.

    Change-Id: Ib5f6b03189b7fc5cd0b226ea2dca74865fbef12a
    Closes-Bug: #1687479
    (cherry picked from commit 42b1fa965028c12d6e78b70d2487d5dd49158176)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.0.0b3

This issue was fixed in the openstack/nova 16.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 15.0.7

This issue was fixed in the openstack/nova 15.0.7 release.

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.