Comment 11 for bug 1721652

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/pike)

Reviewed: https://review.openstack.org/512716
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=fb968e18b2472b0dd7231ff3244b683d59f04cd0
Submitter: Zuul
Branch: stable/pike

commit fb968e18b2472b0dd7231ff3244b683d59f04cd0
Author: Balazs Gibizer <email address hidden>
Date: Thu Oct 12 16:07:28 2017 +0200

    fix cleaning up evacuated instances

    When bug 1709902 was fixed in I0df401a7c91f012fdb25cb0e6b344ca51de8c309
    the fix assumed that when the _destroy_evacuated_instances() is called
    during the init of the nova-compute service the resource tracker
    already knows the compute node ids associated to the given compute
    host. This is not true and therefore _destroy_evacuated_instances fails
    with and exception and does not clean up the evacuated instance.

    The resource tracker's compute_nodes dict only initalized during the
    first update_available_resource call that happens in the
    pre_start_hook. While the _destroy_evacuate_instances called from
    init_host which is called before the pre_hook_start.
    The _destroy_evacuated_instances call uses the
    _delete_allocation_for_moved_instance that relies on the resource
    tracker's compute_nodes dict.

    This patch inlines _delete_allocation_for_moved_instance in
    _destroy_evacuated_instances and queries the db for the compute node
    uuid. As ironic uses 1:M host:node setup we cannot ask the db only once
    about the node uuid as different instances might be on different nodes.

    NOTE(mriedem): A couple of changes had to be made to the compute
    manager code since I0883c2ba1989c5d5a46e23bcbcda53598707bcbc is
    not in stable/pike.

    Change-Id: I35749374ff09b0e98064c75ff9c33dad577579c6
    Closes-Bug: #1721652
    Related-Bug: #1709902
    (cherry picked from commit 9252ffdacf262008bc41409d4fb574ec472dc913)