resize: hypervisor local_gb_used still reports usage even with volume-backed instances after fix for bug 1469179

Bug #1796737 reported by Matt Riedemann on 2018-10-08
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Matt Riedemann
Rocky
Medium
Matt Riedemann

Bug Description

This is a follow up to bug 1782393 which handled reporting 0 local_gb_used during an instance claim in the resource tracker but we still have the same issue with resize claims ignoring volume-backed instances.

This is the instance_claim fix:

https://review.openstack.org/#/c/584204/

The problem is here during a resize:

https://github.com/openstack/nova/blob/f63fd14975cda83d24121b010cbedfc3a7e5ff1f/nova/compute/resource_tracker.py#L1027

That passes the flavor object to the _get_usage_dict method which doesn't handle the is_bfv case:

https://github.com/openstack/nova/blob/f63fd14975cda83d24121b010cbedfc3a7e5ff1f/nova/compute/resource_tracker.py#L1466

Matt Riedemann (mriedem) wrote :

Marked as medium severity since this is mostly only a problem if you're using the DiskFilter which is deprecated.

Changed in nova:
status: New → Triaged
importance: Undecided → High
importance: High → Medium
assignee: nobody → Matt Riedemann (mriedem)

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

Changed in nova:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/608771
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=cb36ca76df788d45d70059b074691f7f3453b8fa
Submitter: Zuul
Branch: master

commit cb36ca76df788d45d70059b074691f7f3453b8fa
Author: Matt Riedemann <email address hidden>
Date: Mon Oct 8 17:02:12 2018 -0400

    Add regression test for bug 1796737

    Change I0839470c4bcfb16590a0d87b306d683b059bf8a9 fixed
    root disk reporting for volume-backed servers during
    an instance claim which is used during server create
    and unshelve. However, resize claims track usage a bit
    differently so local_gb_used reporting of a volume-backed
    instance is still wrong. This adds a test to exhibit the
    bug during resize.

    The test was copied and modified from original change:

      https://review.openstack.org/428505/

    Co-Authored-By: melanie witt <email address hidden>

    Change-Id: Iff6dc19f7f9eae3b6350fe6db7c08901d33f53e1
    Related-Bug: #1796737

Reviewed: https://review.openstack.org/608777
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a99722bb854d2ba99c3abc2d2738ba281148fde4
Submitter: Zuul
Branch: master

commit a99722bb854d2ba99c3abc2d2738ba281148fde4
Author: Matt Riedemann <email address hidden>
Date: Mon Oct 8 17:33:49 2018 -0400

    Properly track local root disk usage during moves

    Change I0839470c4bcfb16590a0d87b306d683b059bf8a9 fixed
    root disk usage tracking for volume-backed instances
    when performing an instance_claim which happens during
    the initial server create and unshelve. However, root
    disk reporting is still wrong for volume-backed instances
    during move claims (resize and evacuate) because a move
    claim calls _update_usage_from_migration which passes a
    Flavor object to ResourceTracker._get_usage_dict() and
    that method didn't have "is_bfv" logic in that scenario.

    This fixes the bug by always passing the instance object
    to the _get_usage_dict() method so we can determine if
    it's volume-backed and if so report the root_gb usage as 0.

    The related functional regression test is updated
    appropriately to show the bug is fixed for volume-backed
    instances.

    Change-Id: Ia19264ae7c88bb03ed3118795d4011ceb62ef92c
    Closes-Bug: #1796737

Changed in nova:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/614587
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d4ec96611c76128d0b8e0c7066ddda0490209565
Submitter: Zuul
Branch: stable/rocky

commit d4ec96611c76128d0b8e0c7066ddda0490209565
Author: Matt Riedemann <email address hidden>
Date: Mon Oct 8 17:02:12 2018 -0400

    Add regression test for bug 1796737

    Change I0839470c4bcfb16590a0d87b306d683b059bf8a9 fixed
    root disk reporting for volume-backed servers during
    an instance claim which is used during server create
    and unshelve. However, resize claims track usage a bit
    differently so local_gb_used reporting of a volume-backed
    instance is still wrong. This adds a test to exhibit the
    bug during resize.

    The test was copied and modified from original change:

      https://review.openstack.org/428505/

    Co-Authored-By: melanie witt <email address hidden>

    Change-Id: Iff6dc19f7f9eae3b6350fe6db7c08901d33f53e1
    Related-Bug: #1796737
    (cherry picked from commit cb36ca76df788d45d70059b074691f7f3453b8fa)

tags: added: in-stable-rocky

Reviewed: https://review.openstack.org/614588
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=980013d7008aff3f83d9de646417f387b29dc1df
Submitter: Zuul
Branch: stable/rocky

commit 980013d7008aff3f83d9de646417f387b29dc1df
Author: Matt Riedemann <email address hidden>
Date: Mon Oct 8 17:33:49 2018 -0400

    Properly track local root disk usage during moves

    Change I0839470c4bcfb16590a0d87b306d683b059bf8a9 fixed
    root disk usage tracking for volume-backed instances
    when performing an instance_claim which happens during
    the initial server create and unshelve. However, root
    disk reporting is still wrong for volume-backed instances
    during move claims (resize and evacuate) because a move
    claim calls _update_usage_from_migration which passes a
    Flavor object to ResourceTracker._get_usage_dict() and
    that method didn't have "is_bfv" logic in that scenario.

    This fixes the bug by always passing the instance object
    to the _get_usage_dict() method so we can determine if
    it's volume-backed and if so report the root_gb usage as 0.

    The related functional regression test is updated
    appropriately to show the bug is fixed for volume-backed
    instances.

    Change-Id: Ia19264ae7c88bb03ed3118795d4011ceb62ef92c
    Closes-Bug: #1796737
    (cherry picked from commit a99722bb854d2ba99c3abc2d2738ba281148fde4)

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

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers