Add functional recreate test for regression bug 1825537
Change I2d9ab06b485f76550dbbff46f79f40ff4c97d12f in Rocky
(and backported through to Pike) added error handling to
the resize_instance and finish_resize methods to revert
allocations in placement when a failure occurs.
This is OK for resize_instance, which runs on the source
compute, as long as the instance.host/node values have not
yet been changed to the dest host/node before RPC casting
to the finish_resize method on the dest compute. It's OK
because the instance is still on the source compute and the
DB says so, so any attempt to recover the instance via hard
reboot or rebuild will be on the source host.
This is not OK for finish_resize because if we fail there
and revert the allocations, the instance host/node values
are already pointing at the dest compute and by reverting
the allocations in placement, placement will be incorrectly
tracking the instance usage with the old flavor against the
source node resource provider rather than the new flavor
against the dest node resource provider - where the instance
is actually running and the nova DB says the instance lives.
This change adds a simple functional regression test to
recreate the bug with a multi-host resize. There is already
a same-host resize functional test marked here which will
need to be fixed as well.
NOTE(mriedem): The test_servers conflict is due to not having
change If6aa37d9b6b48791e070799ab026c816fda4441c in Rocky. As
a result, the new regression test also had to be modified for
the call to assertFlavorMatchesAllocation. The fake module
conflict is due to not having change
Iefff121640e04abdbb6a4ae546c447f168dc8af9 in Rocky.
Change-Id: Ie9e294db7e24d0e3cbe83eee847f0fbfb7478900
Related-Bug: #1825537
(cherry picked from commit f4bb67210602914e1b9a678419cf22cfbeaf1431)
(cherry picked from commit eaa1fc6159ca4437a1e0cbaa77a3da779afb8cb2)
Reviewed: https:/ /review. opendev. org/669361 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=9a977cb28c1 c4f2e8d950476fa 373326f636dfd6
Committed: https:/
Submitter: Zuul
Branch: stable/rocky
commit 9a977cb28c1c4f2 e8d950476fa3733 26f636dfd6
Author: Matt Riedemann <email address hidden>
Date: Fri Apr 19 11:54:07 2019 -0400
Add functional recreate test for regression bug 1825537
Change I2d9ab06b485f76 550dbbff46f79f4 0ff4c97d12f in Rocky
(and backported through to Pike) added error handling to
the resize_instance and finish_resize methods to revert
allocations in placement when a failure occurs.
This is OK for resize_instance, which runs on the source
compute, as long as the instance.host/node values have not
yet been changed to the dest host/node before RPC casting
to the finish_resize method on the dest compute. It's OK
because the instance is still on the source compute and the
DB says so, so any attempt to recover the instance via hard
reboot or rebuild will be on the source host.
This is not OK for finish_resize because if we fail there
and revert the allocations, the instance host/node values
are already pointing at the dest compute and by reverting
the allocations in placement, placement will be incorrectly
tracking the instance usage with the old flavor against the
source node resource provider rather than the new flavor
against the dest node resource provider - where the instance
is actually running and the nova DB says the instance lives.
This change adds a simple functional regression test to
recreate the bug with a multi-host resize. There is already
a same-host resize functional test marked here which will
need to be fixed as well.
Conflicts:
nova/ tests/functiona l/test_ servers. py
nova/ virt/fake. py
NOTE(mriedem): The test_servers conflict is due to not having 91e070799ab026c 816fda4441c in Rocky. As chesAllocation. The fake module e04abdbb6a4ae54 6c447f168dc8af9 in Rocky.
change If6aa37d9b6b487
a result, the new regression test also had to be modified for
the call to assertFlavorMat
conflict is due to not having change
Iefff121640
Change-Id: Ie9e294db7e24d0 e3cbe83eee847f0 fbfb7478900 e1b9a678419cf22 cfbeaf1431) 7a1e0cbaa77a3da 779afb8cb2)
Related-Bug: #1825537
(cherry picked from commit f4bb67210602914
(cherry picked from commit eaa1fc6159ca443