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.
Reviewed: https:/ /review. opendev. org/653273 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=8aae3e39e58 a05ed50b891aeae 261641f544ad1f
Committed: https:/
Submitter: Zuul
Branch: master
commit 8aae3e39e58a05e d50b891aeae2616 41f544ad1f
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 I06fad233006c7b ab14749a51ffa22 6c3801f951b in Stein started flavor_ image_nostatus during resize but did not erThanMinDisk being raised
calling _validate_
pass the root_bdm since the underlying volume does not change. This
can, however, lead to FlavorDiskSmall
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 flavor_ image_nostatus into a separate method so that flavor_ image_nostatus (see bug 1646740 for details, but 'root_gb' ] which could be larger than the root volume size). flavor_ image_nostatus during
of _validate_
the resize method can call that directly for a volume-backed server
rather than deal with the complicated disk size logic in
_validate_
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[
To see why trying to use _validate_
resize for a volume-backed server is a mess, look at PS1 of this
change.
Change-Id: I91c9c1e88afa03 5c757f692c78ad7 2d69cc3c431
Closes-Bug: #1825020