Do not specify a host for live-migration for non homogeneous nodes
In production cloud with non homogeneous compute nodes, specifying a host for live-migration may fail unexpectedly, e.g., if source host is with CPU "E5-2699 v4" and the selected target host is with CPU "E5-2670 v3", the live-migration will fail because of the downgrade issue. So this is to add config option can_migrate_between_any_hosts which can be set to False so that in non homogeneous cloud it can select destination host automatically. Change-Id: I05e9c8360b86326b7f58b2c0600fcb420bc31482 Closes-Bug: #1851185
This commit is contained in:
parent
2844774bb2
commit
be052d6198
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Add a new config option can_migrate_between_any_hosts in the
|
||||||
|
compute-feature-enabled section, which can be set to False for environment
|
||||||
|
with non homogeneous compute nodes, so that it can select a destination
|
||||||
|
host for migrating automatically, otherwise the testcase may fail
|
||||||
|
unexpectedly. e.g., if source host is with CPU "E5-2699 v4" and the
|
||||||
|
selected target host is with CPU "E5-2670 v3", the live-migration will
|
||||||
|
fail because of the downgrade issue.
|
@ -70,6 +70,10 @@ class LiveMigrationTestBase(base.BaseV2ComputeAdminTest):
|
|||||||
|
|
||||||
def _live_migrate(self, server_id, target_host, state,
|
def _live_migrate(self, server_id, target_host, state,
|
||||||
volume_backed=False):
|
volume_backed=False):
|
||||||
|
# If target_host is None, check whether source host is different with
|
||||||
|
# the new host after migration.
|
||||||
|
if target_host is None:
|
||||||
|
source_host = self.get_host_for_server(server_id)
|
||||||
self._migrate_server_to(server_id, target_host, volume_backed)
|
self._migrate_server_to(server_id, target_host, volume_backed)
|
||||||
waiters.wait_for_server_status(self.servers_client, server_id, state)
|
waiters.wait_for_server_status(self.servers_client, server_id, state)
|
||||||
migration_list = (self.admin_migration_client.list_migrations()
|
migration_list = (self.admin_migration_client.list_migrations()
|
||||||
@ -81,6 +85,10 @@ class LiveMigrationTestBase(base.BaseV2ComputeAdminTest):
|
|||||||
if (live_migration['instance_uuid'] == server_id):
|
if (live_migration['instance_uuid'] == server_id):
|
||||||
msg += "\n%s" % live_migration
|
msg += "\n%s" % live_migration
|
||||||
msg += "]"
|
msg += "]"
|
||||||
|
if target_host is None:
|
||||||
|
self.assertNotEqual(source_host,
|
||||||
|
self.get_host_for_server(server_id), msg)
|
||||||
|
else:
|
||||||
self.assertEqual(target_host, self.get_host_for_server(server_id),
|
self.assertEqual(target_host, self.get_host_for_server(server_id),
|
||||||
msg)
|
msg)
|
||||||
|
|
||||||
@ -104,6 +112,10 @@ class LiveMigrationTest(LiveMigrationTestBase):
|
|||||||
server_id = self.create_test_server(wait_until="ACTIVE",
|
server_id = self.create_test_server(wait_until="ACTIVE",
|
||||||
volume_backed=volume_backed)['id']
|
volume_backed=volume_backed)['id']
|
||||||
source_host = self.get_host_for_server(server_id)
|
source_host = self.get_host_for_server(server_id)
|
||||||
|
if not CONF.compute_feature_enabled.can_migrate_between_any_hosts:
|
||||||
|
# not to specify a host so that the scheduler will pick one
|
||||||
|
destination_host = None
|
||||||
|
else:
|
||||||
destination_host = self.get_host_other_than(server_id)
|
destination_host = self.get_host_other_than(server_id)
|
||||||
|
|
||||||
if state == 'PAUSED':
|
if state == 'PAUSED':
|
||||||
@ -150,6 +162,10 @@ class LiveMigrationTest(LiveMigrationTestBase):
|
|||||||
def test_iscsi_volume(self):
|
def test_iscsi_volume(self):
|
||||||
server = self.create_test_server(wait_until="ACTIVE")
|
server = self.create_test_server(wait_until="ACTIVE")
|
||||||
server_id = server['id']
|
server_id = server['id']
|
||||||
|
if not CONF.compute_feature_enabled.can_migrate_between_any_hosts:
|
||||||
|
# not to specify a host so that the scheduler will pick one
|
||||||
|
target_host = None
|
||||||
|
else:
|
||||||
target_host = self.get_host_other_than(server_id)
|
target_host = self.get_host_other_than(server_id)
|
||||||
|
|
||||||
volume = self.create_volume()
|
volume = self.create_volume()
|
||||||
|
@ -483,6 +483,12 @@ ComputeFeaturesGroup = [
|
|||||||
'MIN_LIBVIRT_VERSION is >= 1.2.17 on all '
|
'MIN_LIBVIRT_VERSION is >= 1.2.17 on all '
|
||||||
'branches from stable/rocky and will be '
|
'branches from stable/rocky and will be '
|
||||||
'removed in a future release.'),
|
'removed in a future release.'),
|
||||||
|
cfg.BoolOpt('can_migrate_between_any_hosts',
|
||||||
|
default=True,
|
||||||
|
help="Does the test environment support migrating between "
|
||||||
|
"any hosts? In environments with non-homogeneous compute "
|
||||||
|
"nodes you can set this to False so that it will select "
|
||||||
|
"destination host for migrating automatically"),
|
||||||
cfg.BoolOpt('vnc_console',
|
cfg.BoolOpt('vnc_console',
|
||||||
default=False,
|
default=False,
|
||||||
help='Enable VNC console. This configuration value should '
|
help='Enable VNC console. This configuration value should '
|
||||||
|
Loading…
Reference in New Issue
Block a user