summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api-guide/source/port_with_resource_request.rst9
-rw-r--r--nova/api/openstack/compute/migrate_server.py10
-rw-r--r--nova/tests/functional/test_servers.py32
-rw-r--r--releasenotes/notes/support-cold-migrating-neutron-ports-with-resource-request-6d23be654a253625.yaml9
4 files changed, 16 insertions, 44 deletions
diff --git a/api-guide/source/port_with_resource_request.rst b/api-guide/source/port_with_resource_request.rst
index d383ea6192..3ab019cea9 100644
--- a/api-guide/source/port_with_resource_request.rst
+++ b/api-guide/source/port_with_resource_request.rst
@@ -18,9 +18,14 @@ However the following API operations are still not supported in nova:
* Attaching Neutron ports and networks having QoS minimum bandwidth rule is not
supported.
+Also the following API operations are not supported in the 19.0.0 (Stein)
+version of nova:
+
* Moving (resizing, migrating, live-migrating, evacuating, unshelving after
shelve offload) servers with ports having resource request is not yet
supported.
-See :nova-doc:`the admin guide <admin/port_with_resource_request.html>` for
-administrative details.
+As of 20.0.0 (Train), nova supports cold migrating servers with neutron ports
+having resource requests if both the source and destination 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.
diff --git a/nova/api/openstack/compute/migrate_server.py b/nova/api/openstack/compute/migrate_server.py
index 6d75bdc4ac..dd5eff8e3a 100644
--- a/nova/api/openstack/compute/migrate_server.py
+++ b/nova/api/openstack/compute/migrate_server.py
@@ -58,18 +58,8 @@ class MigrateServerController(wsgi.Controller):
instance = common.get_instance(self.compute_api, context, id,
expected_attrs=['flavor'])
- # 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):
- if not common.supports_port_resource_request_during_move(req):
- msg = _("The migrate 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)
-
# TODO(gibi): Remove when nova only supports compute newer than
# Train
source_service = objects.Service.get_by_host_and_binary(
diff --git a/nova/tests/functional/test_servers.py b/nova/tests/functional/test_servers.py
index 03c19b967b..e70725ad89 100644
--- a/nova/tests/functional/test_servers.py
+++ b/nova/tests/functional/test_servers.py
@@ -5820,26 +5820,6 @@ class UnsupportedPortResourceRequestBasedSchedulingTest(
'The resize action on a server with ports having resource '
'requests', six.text_type(ex))
- def test_migrate_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'], {'migrate': None})
-
- self.assertEqual(400, ex.response.status_code)
- self.assertIn(
- 'The migrate action on a server with ports having resource '
- 'requests', six.text_type(ex))
-
def test_live_migrate_server_with_port_resource_request_old_microversion(
self):
server = self._create_server(
@@ -6362,18 +6342,6 @@ class ServerMoveWithPortResourceRequestTest(
self.flags(weight_classes=[__name__ + '.HostNameWeigher'],
group='filter_scheduler')
super(ServerMoveWithPortResourceRequestTest, self).setUp()
-
- # 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()
-
self.compute2 = self._start_compute('host2')
self.compute2_rp_uuid = self._get_provider_uuid_by_host('host2')
self._create_networking_rp_tree('host2', self.compute2_rp_uuid)
diff --git a/releasenotes/notes/support-cold-migrating-neutron-ports-with-resource-request-6d23be654a253625.yaml b/releasenotes/notes/support-cold-migrating-neutron-ports-with-resource-request-6d23be654a253625.yaml
new file mode 100644
index 0000000000..3f4f3fc92e
--- /dev/null
+++ b/releasenotes/notes/support-cold-migrating-neutron-ports-with-resource-request-6d23be654a253625.yaml
@@ -0,0 +1,9 @@
+---
+features:
+ - |
+ Cold migration is now supported for servers with neutron ports having
+ resource requests. E.g. ports that have QoS minimum bandwidth rules
+ attached. Note that the migration is only supported if both the source and
+ the destination compute services are upgraded to Train and the
+ ``[upgrade_levels]/compute`` configuration does not prevent the computes
+ from using the latest RPC version.