commit b8435d6001c30e67ac277e414b11708d4d660555
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 14:02:17 2019 -0400
Delete allocations even if _confirm_resize raises
When we are confirming a resize, the guest is on the dest
host and the instance host/node values in the database
are pointing at the dest host, so the _confirm_resize method
on the source is really best effort. If something fails, we
should not leak allocations in placement for the source compute
node resource provider since the instance is not actually
consuming the source node provider resources.
This change refactors the error handling around the _confirm_resize
call so the big nesting for _error_out_instance_on_exception is
moved to confirm_resize and then a try/finally is added around
_confirm_resize so we can be sure to try and cleanup the allocations
even if _confirm_resize fails in some obscure way. If _confirm_resize
does fail, the error gets re-raised along with logging a traceback
and hint about how to correct the instance state in the DB by hard
rebooting the server on the dest host.
Change-Id: I29c5f491ec20a71283190a1599e7732541de736f
Closes-Bug: #1821594
(cherry picked from commit 03a6d26691c1f182224d59190b79f48df278099e)
(cherry picked from commit 5f515060f6c79f113f7b8107596e41056445c79f)
(cherry picked from commit 37ac54a42ec91821d62864d63c486c002608491b)
Reviewed: https:/ /review. opendev. org/652153 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=b8435d6001c 30e67ac277e414b 11708d4d660555
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit b8435d6001c30e6 7ac277e414b1170 8d4d660555
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 14:02:17 2019 -0400
Delete allocations even if _confirm_resize raises
When we are confirming a resize, the guest is on the dest
host and the instance host/node values in the database
are pointing at the dest host, so the _confirm_resize method
on the source is really best effort. If something fails, we
should not leak allocations in placement for the source compute
node resource provider since the instance is not actually
consuming the source node provider resources.
This change refactors the error handling around the _confirm_resize out_instance_ on_exception is
call so the big nesting for _error_
moved to confirm_resize and then a try/finally is added around
_confirm_resize so we can be sure to try and cleanup the allocations
even if _confirm_resize fails in some obscure way. If _confirm_resize
does fail, the error gets re-raised along with logging a traceback
and hint about how to correct the instance state in the DB by hard
rebooting the server on the dest host.
Change-Id: I29c5f491ec20a7 1283190a1599e77 32541de736f 2224d59190b79f4 8df278099e) 13f7b8107596e41 056445c79f) 1d62864d63c486c 002608491b)
Closes-Bug: #1821594
(cherry picked from commit 03a6d26691c1f18
(cherry picked from commit 5f515060f6c79f1
(cherry picked from commit 37ac54a42ec9182