commit bf7112ee4d8e90c79f99526e9071e6e9e94031aa
Author: Matt Riedemann <email address hidden>
Date: Wed Mar 13 16:20:47 2019 -0400
Update instance.availability_zone on revertResize
When resizing a server that was not created in an explicit
zone, the scheduler can pick a host in another zone and
conductor will update the instance.availability_zone value
for the new dest host zone.
The problem is when reverting the resize, the server goes
back to the original source host/zone but the
instance.availability_zone value in the database is not
updated which can lead to incorrect results when listing
servers and filtering by zone.
This fixes the bug by updating the instance.availability_zone
value in the API (where we have access to the aggregates
table in the API DB) before casting to nova-compute to
complete the revert. As noted in the comment within, this
is not fail-safe in case the revert fails before the
instance.host is updated in finish_revert_resize, but we
don't have a lot of great backportable options here that
don't involve "up-calls" from the compute to the API DB.
Change-Id: I8dc862b90d398b693b259abd3583616d07d8d206
Closes-Bug: #1819963
(cherry picked from commit 40f6672f53794b563f4c7e27ede7b59a1d63c14a)
(cherry picked from commit 26e59912838b145b627aa247c45b0b19393466c0)
(cherry picked from commit 1342cd75e9a091d28bec857f44f833ab5a7d1b96)
(cherry picked from commit 99cbbcfd61c3569b9c299c99e4a2eaf38d335d19)
Reviewed: https:/ /review. opendev. org/648422 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=bf7112ee4d8 e90c79f99526e90 71e6e9e94031aa
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit bf7112ee4d8e90c 79f99526e9071e6 e9e94031aa
Author: Matt Riedemann <email address hidden>
Date: Wed Mar 13 16:20:47 2019 -0400
Update instance. availability_ zone on revertResize
When resizing a server that was not created in an explicit availability_ zone value
zone, the scheduler can pick a host in another zone and
conductor will update the instance.
for the new dest host zone.
The problem is when reverting the resize, the server goes availability_ zone value in the database is not
back to the original source host/zone but the
instance.
updated which can lead to incorrect results when listing
servers and filtering by zone.
This fixes the bug by updating the instance. availability_ zone revert_ resize, but we
value in the API (where we have access to the aggregates
table in the API DB) before casting to nova-compute to
complete the revert. As noted in the comment within, this
is not fail-safe in case the revert fails before the
instance.host is updated in finish_
don't have a lot of great backportable options here that
don't involve "up-calls" from the compute to the API DB.
Change-Id: I8dc862b90d398b 693b259abd35836 16d07d8d206 63f4c7e27ede7b5 9a1d63c14a) b627aa247c45b0b 19393466c0) 28bec857f44f833 ab5a7d1b96) b9c299c99e4a2ea f38d335d19)
Closes-Bug: #1819963
(cherry picked from commit 40f6672f53794b5
(cherry picked from commit 26e59912838b145
(cherry picked from commit 1342cd75e9a091d
(cherry picked from commit 99cbbcfd61c3569