allocations not immediately removed when instance is deleted

Bug #1712684 reported by Chris Friesen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Matt Riedemann
Pike
Fix Committed
High
Matt Riedemann

Bug Description

Based on code inspection and a discussion with mriedem on IRC, it appears that when deleting an instance in a pure-Pike cloud the allocations are not removed until the update_available_resource() periodic task calls ResourceTracker._update_usage_from_instances(), which calls _remove_deleted_instances_allocations().

In a mixed Ocata/Pike cloud the allocation will be freed up immediately when _update_usage_from_instance() calls self.reportclient.update_instance_allocation().

In the ServerMovingTests functional test we bypass this by forcing the periodic task to run before checking that the allocations have been removed.

Chris Friesen (cbf123)
summary: - allocations not immediately removed when instance deleted
+ allocations not immediately removed when instance is deleted
Matt Riedemann (mriedem)
tags: added: pike-rc-potential
Changed in nova:
status: New → Triaged
importance: Undecided → High
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/496942

Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/496997

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

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

commit d6de0e57c21472b99cbe71ec62b3967ef7282dec
Author: Matt Riedemann <email address hidden>
Date: Wed Aug 23 17:39:51 2017 -0400

    Delete instance allocations when the instance is deleted

    In a deployment that still has Ocata computes, the resource
    tracker will delete the allocations for an instance when it
    is deleted, but in an all-Pike+ computes deployment, the
    allocations will only be removed for a deleted instance
    during the update_available_resource periodic task.

    The capacity on the node should be freed as soon as the
    instance is deleted, like when we shelve offload an
    instance, so this does that.

    The ServerMovingTests functional tests were glossing over
    this by forcing the run of the update_available_resource
    periodic task code after the instance was deleted but
    before checking the allocations were gone from Placement.
    So this change removes that part of the tests to show
    this fixes the problem.

    Change-Id: I0f57b4ba8e4c3931b70bd737de5b7c8ae47f033d
    Closes-Bug: #1712684

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

Reviewed: https://review.openstack.org/496997
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1b2f3c7bb25667527e7e1d2afd84d5d5533e7751
Submitter: Jenkins
Branch: stable/pike

commit 1b2f3c7bb25667527e7e1d2afd84d5d5533e7751
Author: Matt Riedemann <email address hidden>
Date: Wed Aug 23 17:39:51 2017 -0400

    Delete instance allocations when the instance is deleted

    In a deployment that still has Ocata computes, the resource
    tracker will delete the allocations for an instance when it
    is deleted, but in an all-Pike+ computes deployment, the
    allocations will only be removed for a deleted instance
    during the update_available_resource periodic task.

    The capacity on the node should be freed as soon as the
    instance is deleted, like when we shelve offload an
    instance, so this does that.

    The ServerMovingTests functional tests were glossing over
    this by forcing the run of the update_available_resource
    periodic task code after the instance was deleted but
    before checking the allocations were gone from Placement.
    So this change removes that part of the tests to show
    this fixes the problem.

    Change-Id: I0f57b4ba8e4c3931b70bd737de5b7c8ae47f033d
    Closes-Bug: #1712684
    (cherry picked from commit d6de0e57c21472b99cbe71ec62b3967ef7282dec)

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

This issue was fixed in the openstack/nova 16.0.0.0rc2 release candidate.

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

This issue was fixed in the openstack/nova 17.0.0.0b1 development milestone.

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.