nova doesn't clean up the resources after shelve offload

Bug #1710249 reported by Balazs Gibizer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Balazs Gibizer

Bug Description

Scenario:
1) boot a server
2) shelve the server
3) shelve offload the server
4) unshelve the server

The expectation is that after 3) the server has no allocations and after 4) the server has a single allocation on a given host it is booted on during 4).
However after 3) placement API still shows allocation for the server. After 4) the server has double allocations.

Debug log for the reproduction: https://paste.ubuntu.com/25290864/

tags: added: openstack-version.pike placement shelve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/493062

Sean Dague (sdague)
Changed in nova:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
yuqian (roger-yu) wrote :

I have not encountered you in this situation

Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :

Compute manager _shelve_offload_instance calls resource_traceker.update_usages [1] but that ends up at [2] doing nothing. I guess we need to explicitly release the resources in _shelve_offload_instance.

[1] https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4345
[2] https://github.com/openstack/nova/blob/master/nova/compute/resource_tracker.py#L1071

Changed in nova:
assignee: nobody → Balazs Gibizer (balazs-gibizer)
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/493834

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/pike)

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/494631

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/494632

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

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

commit 13c39b1e79fa4e4a697ec3df5bea9b2470cc3deb
Author: Balazs Gibizer <email address hidden>
Date: Fri Aug 11 17:48:09 2017 +0200

    test shelve and shelve offload with placement

    The following 3 scenarios are covered by this patch:
    * boot, shelve, unshelve, delete
    * boot, shelve, shelve offload, unshelve on different host, delete
    * boot, shelve, shelve offload, unshelve on the same host, delete

    The second and the third scenarios are faulty and therefore those
    test cases now assert the wrong behavior but contain the expected
    behavior as commented out asserts.

    Change-Id: Iaf88f8802a456d5e197b65405fa6959a2c514325
    Related-Bug: 1710249

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

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

commit 563d71f7cc4742414be75332f1442f4ec6f5147b
Author: Balazs Gibizer <email address hidden>
Date: Tue Aug 15 10:24:04 2017 +0200

    Clean up resources at shelve offload

    Resource tracker doesn't clean up the resources of an instance after
    it is offloaded since Ia93168b1560267178059284186fb2b7096c7e81f. So
    this patch proposes an explicit cleanup in compute manager.

    Closes-Bug: #1710249
    Change-Id: Ib16e987d50162a4c11a31692704859b981915bed

Changed in nova:
status: In Progress → Fix Released
Dan Smith (danms)
tags: added: pike-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (stable/pike)

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

commit ddd6eabb6dd2d28ef3479f83393e6db41729c582
Author: Balazs Gibizer <email address hidden>
Date: Fri Aug 11 17:48:09 2017 +0200

    test shelve and shelve offload with placement

    The following 3 scenarios are covered by this patch:
    * boot, shelve, unshelve, delete
    * boot, shelve, shelve offload, unshelve on different host, delete
    * boot, shelve, shelve offload, unshelve on the same host, delete

    The second and the third scenarios are faulty and therefore those
    test cases now assert the wrong behavior but contain the expected
    behavior as commented out asserts.

    Change-Id: Iaf88f8802a456d5e197b65405fa6959a2c514325
    Related-Bug: 1710249
    (cherry picked from commit 13c39b1e79fa4e4a697ec3df5bea9b2470cc3deb)

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

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

commit a833a801b1909065adcaf6722a0e55d5897f714c
Author: Balazs Gibizer <email address hidden>
Date: Tue Aug 15 10:24:04 2017 +0200

    Clean up resources at shelve offload

    Resource tracker doesn't clean up the resources of an instance after
    it is offloaded since Ia93168b1560267178059284186fb2b7096c7e81f. So
    this patch proposes an explicit cleanup in compute manager.

    Closes-Bug: #1710249
    Change-Id: Ib16e987d50162a4c11a31692704859b981915bed
    (cherry picked from commit 563d71f7cc4742414be75332f1442f4ec6f5147b)

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.