Comment 8 for bug 1825020

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

Reviewed: https://review.opendev.org/653273
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8aae3e39e58a05ed50b891aeae261641f544ad1f
Submitter: Zuul
Branch: master

commit 8aae3e39e58a05ed50b891aeae261641f544ad1f
Author: Matt Riedemann <email address hidden>
Date: Tue Apr 16 23:53:03 2019 -0400

    Fix volume-backed resize with a smaller disk flavor

    Change I06fad233006c7bab14749a51ffa226c3801f951b in Stein started
    calling _validate_flavor_image_nostatus during resize but did not
    pass the root_bdm since the underlying volume does not change. This
    can, however, lead to FlavorDiskSmallerThanMinDisk being raised
    if the new flavor has a disk size smaller than the current flavor.
    This is wrong in the case of a volume-backed server because we don't
    care about the root disk size in the flavor in that case.

    This fixes the bug by splitting the pci/numa validation logic out
    of _validate_flavor_image_nostatus into a separate method so that
    the resize method can call that directly for a volume-backed server
    rather than deal with the complicated disk size logic in
    _validate_flavor_image_nostatus (see bug 1646740 for details, but
    tl;dr if the image min_disk is less than the flavor root_gb, the
    min_disk stored in the instance image system metadata is the
    flavor['root_gb'] which could be larger than the root volume size).
    To see why trying to use _validate_flavor_image_nostatus during
    resize for a volume-backed server is a mess, look at PS1 of this
    change.

    Change-Id: I91c9c1e88afa035c757f692c78ad72d69cc3c431
    Closes-Bug: #1825020