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

Bug #1782393 reported by Matt Riedemann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Zhenyu Zheng

Bug Description

While testing the (partial) fix for bug 1469179:

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

Someone reported that nova hypervisor-statistics still reported local_gb_used, even though 'openstack resource provider allocation show' for the instance didn't report DISK_GB usage.

This is because of some code in the resource tracker that is not boot-from-volume aware when reporting disk usage, it just gets the root_gb off the flavor:

https://github.com/openstack/nova/blob/eb4f65a7951e921b1cd8d05713e144e72f2f254f/nova/compute/resource_tracker.py#L1455

We have an instance uuid in scope for the callers of that code so we should be able to determine if it's a volume-backed instance and report 0 for root_gb if that's the case.

Long-term, once we drop the CachingScheduler and we can rely on allocations in placement, we should just change this code to report the disk usage based on the DISK_GB allocation against the given compute node provider for the given consumer (instance or migration record).

Revision history for this message
Matt Riedemann (mriedem) wrote :
Changed in nova:
assignee: nobody → Zhenyu Zheng (zhengzhenyu)
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/584204

Changed in nova:
status: Triaged → In Progress
Changed in nova:
assignee: Zhenyu Zheng (zhengzhenyu) → Matt Riedemann (mriedem)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Matt Riedemann (mriedem) → Zhenyu Zheng (zhengzhenyu)
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/584962

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

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

commit ece289fa5a5e5e805cde5dd7189cf05f643d0fd0
Author: Eric Fried <email address hidden>
Date: Wed Jul 18 10:15:18 2018 -0500

    Func test for improper cn local DISK_GB reporting

    Change I9c2111f7377df65c1fc3c72323f85483b3295989 fixed it so we stop
    allocating the flavor's root_gb if we're booting from volume. However,
    we're still reporting it against the compute node's capacity.

    Furthermore, we're not reporting swap space at all.

    This adds functional test coverage demonstrating these bugs.

    Change-Id: Ia46754d8ff65c501545853e6c2909a5a900d45c0
    Related-Bug: #1782393
    Related-Bug: #1782386

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

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

commit f63fd14975cda83d24121b010cbedfc3a7e5ff1f
Author: Kevin_Zheng <email address hidden>
Date: Fri Jul 20 10:38:30 2018 +0800

    Report 0 root_gb in resource tracker if instance is bfv.

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

    This is because of some code in the resource tracker that is not
    boot-from-volume aware when reporting disk usage, it just gets the
    root_gb off the flavor:

    https://github.com/openstack/nova/blob/eb4f65a7951e921b1cd8d05713e144e72f2f254f/nova/compute/resource_tracker.py#L1455

    This patch simply check if the instance is bfv before returning
    the result. If it's a volume-backed instance and report 0 for root_gb if
    that's the case.

    Change-Id: I0839470c4bcfb16590a0d87b306d683b059bf8a9
    Closes-bug: #1782393

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 18.0.0.0b3

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

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

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

commit 3a022299c13ff6a0a949c05c54fdc7331416a0b0
Author: Matt Riedemann <email address hidden>
Date: Mon Jul 23 12:15:44 2018 -0400

    Cache is_bfv check in ResourceTracker

    Whether or not an instance is volume-backed shouldn't
    change for the lifetime of the server, so rather than
    figure that out during every operation (or periodic task)
    for an instance in the resource tracker, get the is_bfv
    value once and cache it. The cache entries are removed
    when the instance is removed from the host (either deleted,
    migrated or shelved offloaded).

    Change-Id: Ic5188d4c5a7e8aa4c79c37e63124fe3a305ef568
    Related-Bug: #1782393

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.