Handle legacy request spec dict in ComputeTaskManager._cold_migrate
Prior to change I4244f7dd8fe74565180f73684678027067b4506e in Stein,
conductor would pass a legacy dict request spec to compute during
cold migrate / resize and if compute rescheduled it would not pass
the request spec back to conductor, so the _cold_migrate method in
conductor would have to create a new RequestSpec from components
it had available.
As of that change, compute will send the request spec it got back
to conductor and _cold_migrate avoids the RequestSpec.from_components
call.
There are two issues here:
1. Technically if conductor RPC API is pinned to less than 1.13 the ComputeTaskAPI.migrate_server method will remove the request spec
from the call to conductor. So conductor (server-side) can still
not get a RequestSpec and need to use from_components. As a result
the TODO in the _cold_migrate method needs to be updated since we
require an RPC API major version bump to make request spec required.
2. Just because conductor is passing compute a RequestSpec object, if
compute RPC API versions are pinned to less than 5.1, conductor will
pass a legacy request spec dict to compute and compute will send that
back to conductor, so the _cold_migrate method needs to handle getting
a request spec that is a dict and convert it to an object. A new test
is added for that case.
Conflicts: nova/compute/rpcapi.py
NOTE(mriedem): The conflict is due to not having change
Ib4e0b9ab050a59ab5a290e6eecea01b87c3bd4c6 in Stein.
NOTE(mriedem): The unit test in test_conductor.py had to be changed
slightly since change If1e461da382f707be2b5ba89f74f77269f0909dd is
not in Stein.
Change-Id: I188b7aa9cb220f93e69a68f0c3592b28d41ba5b6
Closes-Bug: #1843090
(cherry picked from commit b36c44c449533edfbcfd970ccef9d794ac3b4171)
Reviewed: https:/ /review. opendev. org/684407 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=66bf82864de aabf1c3eff7237b cde6dc961dea09
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit 66bf82864deaabf 1c3eff7237bcde6 dc961dea09
Author: Matt Riedemann <email address hidden>
Date: Fri Sep 6 15:13:00 2019 -0400
Handle legacy request spec dict in ComputeTaskMana ger._cold_ migrate
Prior to change I4244f7dd8fe745 65180f736846780 27067b4506e in Stein,
conductor would pass a legacy dict request spec to compute during
cold migrate / resize and if compute rescheduled it would not pass
the request spec back to conductor, so the _cold_migrate method in
conductor would have to create a new RequestSpec from components
it had available.
As of that change, compute will send the request spec it got back from_components
to conductor and _cold_migrate avoids the RequestSpec.
call.
There are two issues here:
1. Technically if conductor RPC API is pinned to less than 1.13 the
ComputeTaskAPI. migrate_ server method will remove the request spec
from the call to conductor. So conductor (server-side) can still
not get a RequestSpec and need to use from_components. As a result
the TODO in the _cold_migrate method needs to be updated since we
require an RPC API major version bump to make request spec required.
2. Just because conductor is passing compute a RequestSpec object, if
compute RPC API versions are pinned to less than 5.1, conductor will
pass a legacy request spec dict to compute and compute will send that
back to conductor, so the _cold_migrate method needs to handle getting
a request spec that is a dict and convert it to an object. A new test
is added for that case.
Conflicts:
nova/ compute/ rpcapi. py
NOTE(mriedem): The conflict is due to not having change 0a59ab5a290e6ee cea01b87c3bd4c6 in Stein.
Ib4e0b9ab05
NOTE(mriedem): The unit test in test_conductor.py had to be changed 7be2b5ba89f74f7 7269f0909dd is
slightly since change If1e461da382f70
not in Stein.
Change-Id: I188b7aa9cb220f 93e69a68f0c3592 b28d41ba5b6 fbcfd970ccef9d7 94ac3b4171)
Closes-Bug: #1843090
(cherry picked from commit b36c44c449533ed