commit 8f6371c868625351e3b017d6b2aaaa458cd73172
Author: Claudiu Belu <email address hidden>
Date: Sun Feb 11 10:07:52 2018 -0800
compute: Cleans up allocations after failed resize
During cold resize, the ComputeManager's prep_resize calls the
rpcapi.ComputeAPI's resize_instance method, which will then do an
RPC cast (async).
Because the RPC cast is asynchronous, the exception branch in prep_resize
will not be executed if the cold resize failed, the allocations will not
be cleaned up, and the instance will not be rescheduled.
This patch adds allocation cleanup in the resize_instance and finish_resize
methods.
NOTE(mriedem): The conflicts are due to not having these changes in Pike:
Id2f352a68f99df430d20634695be51f74db95d87
I4f0c99bb11d921d2875737c5cfbbb866be55c37c
Icc3ffe4037a44f4f323bec2f80d99ca226742e22
I9bcc1605945ddc35df2288be72e194c050b8ddd9
I7c3c95d4e0836e1af054d076aad29172574eab2c
Because we don't have I7c3c95d4e0836e1af054d076aad29172574eab2c which
added the _revert_allocation method, this backport has to use the
ResourceTracker.delete_allocation_for_failed_resize method to rollback
the *new* flavor allocation for the instance (the new flavor is the one
being used for the resize). When we fail, we remove the new flavor
allocation so the instance is left with it's current (old) flavor
allocation on the source compute node. As a result, several unit tests
must be updated to mock delete_allocation_for_failed_resize.
Change-Id: I2d9ab06b485f76550dbbff46f79f40ff4c97d12f
Closes-Bug: #1749215
(cherry picked from commit caf167862dd82e98f0189c9598856de57dfa7d35)
(cherry picked from commit 5039511840bd64151f3111d9c8d7d8a01344193b)
Reviewed: https:/ /review. openstack. org/548584 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=8f6371c8686 25351e3b017d6b2 aaaa458cd73172
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit 8f6371c86862535 1e3b017d6b2aaaa 458cd73172
Author: Claudiu Belu <email address hidden>
Date: Sun Feb 11 10:07:52 2018 -0800
compute: Cleans up allocations after failed resize
During cold resize, the ComputeManager's prep_resize calls the ComputeAPI' s resize_instance method, which will then do an
rpcapi.
RPC cast (async).
Because the RPC cast is asynchronous, the exception branch in prep_resize
will not be executed if the cold resize failed, the allocations will not
be cleaned up, and the instance will not be rescheduled.
This patch adds allocation cleanup in the resize_instance and finish_resize
methods.
Conflicts:
nova/ compute/ manager. py
nova/ tests/functiona l/test_ servers. py
nova/ tests/unit/ compute/ test_compute_ mgr.py
NOTE(mriedem): The conflicts are due to not having these changes in Pike:
Id2f352a6 8f99df430d20634 695be51f74db95d 87
I4f0c99bb 11d921d2875737c 5cfbbb866be55c3 7c
Icc3ffe40 37a44f4f323bec2 f80d99ca226742e 22
I9bcc1605 945ddc35df2288b e72e194c050b8dd d9
I7c3c95d4 e0836e1af054d07 6aad29172574eab 2c
Because we don't have I7c3c95d4e0836e 1af054d076aad29 172574eab2c which cker.delete_ allocation_ for_failed_ resize method to rollback allocation_ for_failed_ resize.
added the _revert_allocation method, this backport has to use the
ResourceTra
the *new* flavor allocation for the instance (the new flavor is the one
being used for the resize). When we fail, we remove the new flavor
allocation so the instance is left with it's current (old) flavor
allocation on the source compute node. As a result, several unit tests
must be updated to mock delete_
Change-Id: I2d9ab06b485f76 550dbbff46f79f4 0ff4c97d12f 8f0189c9598856d e57dfa7d35) 51f3111d9c8d7d8 a01344193b)
Closes-Bug: #1749215
(cherry picked from commit caf167862dd82e9
(cherry picked from commit 5039511840bd641