Enable evacuation with qos ports
Previous patch [1] implemented support for evacuation of servers with neutron ports having resource request. So this patch removes the API check that rejected such operations and document the new feature. [1] Id9ed7a82d42be8ffe760f03e6610b9e6f5a4287b Change-Id: Id5f2f4f22b856c989e2eef8ed56b9829d1bcefb6 blueprint: support-move-ops-with-qos-ports-ussuri
This commit is contained in:
parent
ab509a0043
commit
f06ff5949f
@ -31,5 +31,8 @@ compute services are upgraded to 20.0.0 (Train) and the
|
||||
``[upgrade_levels]/compute`` configuration does not prevent the computes from
|
||||
using the latest RPC version.
|
||||
|
||||
As of 21.0.0 (Ussuri), nova supports evacuating servers with neutron ports
|
||||
having resource requests.
|
||||
|
||||
See :nova-doc:`the admin guide <admin/port_with_resource_request.html>` for
|
||||
administrative details.
|
||||
|
@ -117,18 +117,6 @@ class EvacuateController(wsgi.Controller):
|
||||
msg = _("The target host can't be the same one.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
|
||||
# We could potentially move this check to conductor and avoid the
|
||||
# extra API call to neutron when we support move operations with ports
|
||||
# having resource requests.
|
||||
if (common.instance_has_port_with_resource_request(
|
||||
context, instance.uuid, self.network_api) and not
|
||||
common.supports_port_resource_request_during_move(req)):
|
||||
msg = _("The evacuate action on a server with ports having "
|
||||
"resource requests, like a port with a QoS minimum "
|
||||
"bandwidth policy, is not supported with this "
|
||||
"microversion")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
|
||||
try:
|
||||
self.compute_api.evacuate(context, instance, host,
|
||||
on_shared_storage, password, force)
|
||||
|
@ -5911,27 +5911,6 @@ class UnsupportedPortResourceRequestBasedSchedulingTest(
|
||||
'The os-migrateLive action on a server with ports having resource '
|
||||
'requests', six.text_type(ex))
|
||||
|
||||
def test_evacuate_server_with_port_resource_request_old_microversion(
|
||||
self):
|
||||
server = self._create_server(
|
||||
flavor=self.flavor,
|
||||
networks=[{'port': self.neutron.port_1['id']}])
|
||||
self._wait_for_state_change(self.admin_api, server, 'ACTIVE')
|
||||
|
||||
# We need to simulate that the above server has a port that has
|
||||
# resource request; we cannot boot with such a port but legacy servers
|
||||
# can exist with such a port.
|
||||
self._add_resource_request_to_a_bound_port(self.neutron.port_1['id'])
|
||||
|
||||
ex = self.assertRaises(
|
||||
client.OpenStackApiException,
|
||||
self.api.post_server_action, server['id'], {'evacuate': {}})
|
||||
|
||||
self.assertEqual(400, ex.response.status_code)
|
||||
self.assertIn(
|
||||
'The evacuate action on a server with ports having resource '
|
||||
'requests', six.text_type(ex))
|
||||
|
||||
def test_unshelve_offloaded_server_with_port_resource_request_old_version(
|
||||
self):
|
||||
server = self._create_server(
|
||||
@ -6994,18 +6973,6 @@ class ServerMoveWithPortResourceRequestTest(
|
||||
# the port that doesn't have resource request
|
||||
self.assertNotIn('binding:profile', updated_non_qos_port)
|
||||
|
||||
def _turn_off_api_check(self):
|
||||
# The API actively rejecting the move operations with resource
|
||||
# request so we have to turn off that check.
|
||||
# TODO(gibi): Remove this when the move operations are supported and
|
||||
# the API check is removed.
|
||||
patcher = mock.patch(
|
||||
'nova.api.openstack.common.'
|
||||
'supports_port_resource_request_during_move',
|
||||
return_value=True)
|
||||
self.addCleanup(patcher.stop)
|
||||
patcher.start()
|
||||
|
||||
def _check_allocation_during_evacuate(
|
||||
self, server, flavor, source_compute_rp_uuid, dest_compute_rp_uuid,
|
||||
non_qos_port, qos_port, qos_sriov_port):
|
||||
@ -7128,10 +7095,6 @@ class ServerMoveWithPortResourceRequestTest(
|
||||
self.assertNotIn('binding:profile', updated_non_qos_port)
|
||||
|
||||
def test_evacuate_with_qos_port(self, host=None):
|
||||
# TODO(gibi): remove this when evacuate is fully supported and
|
||||
# therefore the check is removed from the api
|
||||
self._turn_off_api_check()
|
||||
|
||||
non_qos_normal_port = self.neutron.port_1
|
||||
qos_normal_port = self.neutron.port_with_resource_request
|
||||
qos_sriov_port = self.neutron.port_with_sriov_resource_request
|
||||
@ -7182,10 +7145,6 @@ class ServerMoveWithPortResourceRequestTest(
|
||||
self.test_evacuate_with_qos_port(host='host2')
|
||||
|
||||
def test_evacuate_with_qos_port_fails_recover_source_compute(self):
|
||||
# TODO(gibi): remove this when evacuate is fully supported and
|
||||
# therefore the check is removed from the api
|
||||
self._turn_off_api_check()
|
||||
|
||||
non_qos_normal_port = self.neutron.port_1
|
||||
qos_normal_port = self.neutron.port_with_resource_request
|
||||
qos_sriov_port = self.neutron.port_with_sriov_resource_request
|
||||
@ -7238,9 +7197,6 @@ class ServerMoveWithPortResourceRequestTest(
|
||||
qos_normal_port, qos_sriov_port, server)
|
||||
|
||||
def test_evacuate_with_qos_port_pci_update_fail(self):
|
||||
# TODO(gibi): remove this when evacuate is fully supported and
|
||||
# therefore the check is removed from the api
|
||||
self._turn_off_api_check()
|
||||
# Update the name of the network device RP of PF2 on host2 to something
|
||||
# unexpected. This will cause
|
||||
# _update_pci_request_spec_with_allocated_interface_name() to raise
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The server ``evacute`` action API now supports servers with neutron
|
||||
ports having resource requests, e.g. ports that have QoS minimum bandwidth
|
||||
rules attached.
|
Loading…
Reference in New Issue
Block a user