nova/nova/tests/unit/conductor
Matt Riedemann 8c21660819 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.

Change-Id: Iaaf7f68d6874fd5d6e737e7d2bc589ea4a048fee
Closes-Bug: #1774205
2018-05-30 12:07:53 -04:00
..
tasks Remove mox in test_live_migrate.py 2018-05-14 22:22:03 +00:00
__init__.py move all tests to nova/tests/unit 2014-11-12 15:31:08 -05:00
test_conductor.py Use instance project/user when creating RequestSpec during resize reschedule 2018-05-30 12:07:53 -04:00