Since I8abdf58a6537dd5e15a012ea37a7b48abd726579 in Newton
we update the RequestSpec.flavor to the new flavor during
a resize. However, if the resize is reverted, we didn't
revert the RequestSpec.flavor to the previous flavor
on the instance, which could cause issues later when
moving the instance since the scheduler will get a
RequestSpec with a flavor that doesn't match the actual
flavor on the instance.
This fixes the bug by updating the RequestSpec.flavor
with instance.old_flavor on resize_revert in the API.
Functional test wrinkles are added.
This fix was ported from the starlingx-staging/stx-nova
repo commit 71acfeae0.
Conflicts:
nova/tests/functional/test_servers.py
NOTE(mriedem): The conflict is due to not having change
I40a244601e1612a87bd41cd6ad652202035a1ce4 in Pike, which
would be difficult to backport because of change
I89e2682c9210901cf1992dac2f9068b51f0373cd not being in
Pike, so it's easier to just update the existing tests
as they were in Pike.
Change-Id: Ic6e74702f2a5b57b437f4ffdfbc86c1e34cdac7d
Closes-Bug: #1785339
(cherry picked from commit ef3849e2da)
(cherry picked from commit 9125fc7caf)
(cherry picked from commit f2d2a9a7c5)