Handle flavor disk mismatches when resizing
Handle flavor disk mismatches when resizing

When resizing a non-volume-backed instance, we call the
'_validate_flavor_image_nostatus' function to do a myriad of checks with
the aim of ensuring the flavor and image don't conflict. One of these
checks tests whether the flavor is requesting a smaller local disk than
the size of the image of the minimum size the image says it requires. If
this check fails, it will raise the 'FlavorDiskSmallerThanImage' or
'FlavorDiskSmallerThanMinDisk' exceptions, respectively. We currently
handle this exception in the 'create' and 'rebuild' flows but do not in
the 'resize' path. Correct this by way of adding this exception to
'INVALID_FLAVOR_IMAGE_EXCEPTIONS', a list of exceptions that can be
raised when an flavor and image conflict.

The fix for this issue also highlights another exception that can be
raised in the three code paths but is not handled by them all,
'FlavorMemoryTooSmall'. This is added to
'INVALID_FLAVOR_IMAGE_EXCEPTIONS' also.

Change-Id: Idc82ed3bcfc37220a50d9e2d552be5ab8844374a
Signed-off-by: Stephen Finucane <4725dc7f3632bf126d9fbdc30c347e91e8d2fe16@redhat.com>
Closes-Bug: #1867077

mahak/nova,mahak/nova,mahak/nova,klmitch/nova,openstack/nova,klmitch/nova,klmitch/nova,klmitch/nova,openstack/nova,openstack/nova