nova/nova/conductor
Matt Riedemann 09e678ee14 Use instance project/user when creating RequestSpec during resize reschedule
When rescheduling from a failed cold migrate / resize, the compute
service does not pass the request spec back to conductor so we
create one based on the in-scope variables.

This introduces a problem for some scheduler filters like the
AggregateMultiTenancyIsolation filter since it will create the
RequestSpec using the project and user information from the current
context, which for a cold migrate is the admin and might not be
the owner of the instance (which could be in some other project).
So the AggregateMultiTenancyIsolation filter might reject the
request or select a host that fits an aggregate for the admin but
not the end user.

This fixes the problem by using the instance project/user information
when constructing the RequestSpec which will take priority over
the context in RequestSpec.from_components().

Long-term we need the compute service to pass the request spec back
to the conductor during a reschedule, but we do this first since we
can backport it.

NOTE(mriedem): RequestSpec.user_id was added in Rocky in commit
6e49019fae so we have to remove its
usage in this backport.

NOTE(mriedem): Some existing tests in test_conductor.py had to
be updated to set a project_id on the fake instance since change
I34b1d99a9d0d2aca80f094a79ec1656abaf762dc is not in Ocata.

Change-Id: Iaaf7f68d6874fd5d6e737e7d2bc589ea4a048fee
Closes-Bug: #1774205
(cherry picked from commit 8c21660819)
(cherry picked from commit 1162902280)
(cherry picked from commit ce7ad87809)
2018-06-26 12:13:26 -04:00
..
tasks Merge "Update RequestSpec nested flavor when a resize comes in" 2016-07-29 19:34:56 +00:00
__init__.py Remove conductor local api:s and 'use_local' config option 2016-10-18 14:26:06 +02:00
api.py Add schedule_and_build_instances conductor method 2016-12-14 11:56:55 -08:00
manager.py Use instance project/user when creating RequestSpec during resize reschedule 2018-06-26 12:13:26 -04:00
rpcapi.py Integrate OSProfiler and Nova 2017-01-18 15:00:14 +07:00