Use admin neutron client to see if instance has qos ports
The nova-api checks at each move* operation if the instance has qos port
attached as not all the move operations are supported for such servers.
Nova uses the request context to initialize the neutron client for the
port query. However neutron does not return the value of the
resource_request of the port if it is queried with a non admin client.
This causes that if the move operation is initiated by a non admin
then nova thinks that the ports do not have resource request.
This patch creates an admin context for this neutron query.
The new functional tests are not added before this patch in a regression
test like way as existing functional tests are reused with different
setup and doing that without the fix causes a lot of different failure
scenarios.
Note that neutron fixture is changed to simulate the different behavior
in case of different request context are used to initialize the client.
*: Note that Id5f2f4f22b856c989e2eef8ed56b9829d1bcefb6 removed the check
for evacuate in Ussuri but exists in Train and Stein.
Conflicts:
nova/api/openstack/common.py due to
I6fc3cb0651f65b2448fbbb58989c920974f076c3 is missing
nova/api/openstack/compute/migrate_server.py
nova/tests/unit/api/openstack/compute/test_migrate_server.py
due to I09cac780b9ee5b5726874d4e6f895fd0cd4bff8c is missing
nova/api/openstack/compute/servers.py
due to Ib1a73f5e20b6f9a325d8b24d9253a18f2a46db1f and
Id0ee10e8d323786f4d79c82e3f05b48e76bd0956 is missing
nova/tests/unit/api/openstack/compute/test_server_actions.py
due to Ib1a73f5e20b6f9a325d8b24d9253a18f2a46db1f is missing
nova/api/openstack/compute/shelve.py due to
I6381365ff882cf23808e8dabfce41143c5e35192 is missing
Also integrated_helpers.py and test_servers.py needed to be changed due
to Id0ee10e8d323786f4d79c82e3f05b48e76bd0956 is missing. As well as
NonAdminUnsupportedPortResourceRequestBasedSchedulingTest.setUp() needed
to be extended to allow calling migrate and resize for the non admin api
client.
Change-Id: I3cf6eb4654663865d9258c38f05cd05974ffcf9d
Closes-Bug: #1850280
(cherry picked from commit 899976960503524b8e5c6588e339742ca4bf8158)
(cherry picked from commit 4cb493fe4f79e736ae4fd7874b02d1d5ceed02c1)
Reviewed: https:/ /review. opendev. org/694668 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=65ada9745cb 01c9004eb4f6e77 21a64b3a6e3ca5
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit 65ada9745cb01c9 004eb4f6e7721a6 4b3a6e3ca5
Author: Balazs Gibizer <email address hidden>
Date: Tue Oct 29 16:43:04 2019 +0100
Use admin neutron client to see if instance has qos ports
The nova-api checks at each move* operation if the instance has qos port request of the port if it is queried with a non admin client.
attached as not all the move operations are supported for such servers.
Nova uses the request context to initialize the neutron client for the
port query. However neutron does not return the value of the
resource_
This causes that if the move operation is initiated by a non admin
then nova thinks that the ports do not have resource request.
This patch creates an admin context for this neutron query.
The new functional tests are not added before this patch in a regression
test like way as existing functional tests are reused with different
setup and doing that without the fix causes a lot of different failure
scenarios.
Note that neutron fixture is changed to simulate the different behavior
in case of different request context are used to initialize the client.
*: Note that Id5f2f4f22b856c 989e2eef8ed56b9 829d1bcefb6 removed the check
for evacuate in Ussuri but exists in Train and Stein.
Conflicts: api/openstack/ common. py due to 51f65b2448fbbb5 8989c920974f076 c3 is missing
nova/
I6fc3cb06
nova/ api/openstack/ compute/ migrate_ server. py tests/unit/ api/openstack/ compute/ test_migrate_ server. py 5726874d4e6f895 fd0cd4bff8c is missing
nova/
due to I09cac780b9ee5b
nova/ api/openstack/ compute/ servers. py a325d8b24d9253a 18f2a46db1f and d323786f4d79c82 e3f05b48e76bd09 56 is missing
due to Ib1a73f5e20b6f9
Id0ee10e8
nova/ tests/unit/ api/openstack/ compute/ test_server_ actions. py a325d8b24d9253a 18f2a46db1f is missing
due to Ib1a73f5e20b6f9
nova/ api/openstack/ compute/ shelve. py due to f882cf23808e8da bfce41143c5e351 92 is missing
I6381365f
Also integrated_ helpers. py and test_servers.py needed to be changed due 6f4d79c82e3f05b 48e76bd0956 is missing. As well as upportedPortRes ourceRequestBas edSchedulingTes t.setUp( ) needed
to Id0ee10e8d32378
NonAdminUns
to be extended to allow calling migrate and resize for the non admin api
client.
Change-Id: I3cf6eb46546638 65d9258c38f05cd 05974ffcf9d b8e5c6588e33974 2ca4bf8158) 6ae4fd7874b02d1 d5ceed02c1)
Closes-Bug: #1850280
(cherry picked from commit 899976960503524
(cherry picked from commit 4cb493fe4f79e73