Merge "Add a workaround to skip hypervisor version check on LM"
This commit is contained in:
commit
0bea7f6b6b
|
@ -347,8 +347,9 @@ class LiveMigrationTask(base.TaskBase):
|
|||
|
||||
source_version = source_info.hypervisor_version
|
||||
destination_version = destination_info.hypervisor_version
|
||||
if source_version > destination_version:
|
||||
raise exception.DestinationHypervisorTooOld()
|
||||
if not CONF.workarounds.skip_hypervisor_version_check_on_lm:
|
||||
if source_version > destination_version:
|
||||
raise exception.DestinationHypervisorTooOld()
|
||||
return source_info, destination_info
|
||||
|
||||
def _call_livem_checks_on_host(self, destination, provider_mapping):
|
||||
|
|
|
@ -409,6 +409,13 @@ With the libvirt driver, during live migration, skip comparing guest CPU
|
|||
with the destination host. When using QEMU >= 2.9 and libvirt >=
|
||||
4.4.0, libvirt will do the correct thing with respect to checking CPU
|
||||
compatibility on the destination host during live migration.
|
||||
"""),
|
||||
cfg.BoolOpt(
|
||||
'skip_hypervisor_version_check_on_lm',
|
||||
default=False,
|
||||
help="""
|
||||
When this is enabled, it will skip version-checking of hypervisors
|
||||
during live migration.
|
||||
"""),
|
||||
]
|
||||
|
||||
|
|
|
@ -345,6 +345,36 @@ class LiveMigrationTaskTestCase(test.NoDBTestCase):
|
|||
mock.call(self.destination)],
|
||||
mock_get_info.call_args_list)
|
||||
|
||||
@mock.patch.object(live_migrate.LiveMigrationTask, '_get_compute_info')
|
||||
def test_skip_hypervisor_version_check_on_lm_raise_ex(self, mock_get_info):
|
||||
host1 = {'hypervisor_type': 'a', 'hypervisor_version': 7}
|
||||
host2 = {'hypervisor_type': 'a', 'hypervisor_version': 6}
|
||||
self.flags(group='workarounds',
|
||||
skip_hypervisor_version_check_on_lm=False)
|
||||
mock_get_info.side_effect = [objects.ComputeNode(**host1),
|
||||
objects.ComputeNode(**host2)]
|
||||
self.assertRaises(exception.DestinationHypervisorTooOld,
|
||||
self.task._check_compatible_with_source_hypervisor,
|
||||
self.destination)
|
||||
self.assertEqual([mock.call(self.instance_host),
|
||||
mock.call(self.destination)],
|
||||
mock_get_info.call_args_list)
|
||||
|
||||
@mock.patch.object(live_migrate.LiveMigrationTask, '_get_compute_info')
|
||||
def test_skip_hypervisor_version_check_on_lm_do_not_raise_ex(
|
||||
self, mock_get_info
|
||||
):
|
||||
host1 = {'hypervisor_type': 'a', 'hypervisor_version': 7}
|
||||
host2 = {'hypervisor_type': 'a', 'hypervisor_version': 6}
|
||||
self.flags(group='workarounds',
|
||||
skip_hypervisor_version_check_on_lm=True)
|
||||
mock_get_info.side_effect = [objects.ComputeNode(**host1),
|
||||
objects.ComputeNode(**host2)]
|
||||
self.task._check_compatible_with_source_hypervisor(self.destination)
|
||||
self.assertEqual([mock.call(self.instance_host),
|
||||
mock.call(self.destination)],
|
||||
mock_get_info.call_args_list)
|
||||
|
||||
@mock.patch.object(compute_rpcapi.ComputeAPI,
|
||||
'check_can_live_migrate_destination')
|
||||
def test_check_requested_destination(self, mock_check):
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
feature:
|
||||
- |
|
||||
Adds a workaround that allows one to disable hypervisor
|
||||
version-check on live migration. This workaround option can be
|
||||
useful in certain scenarios when upgrading. E.g. if you want to
|
||||
relocate all instances off a compute node due to an emergency
|
||||
hardware issue, and you only have another old compute node ready at
|
||||
the time.
|
||||
|
||||
To enable this, use the config attribute
|
||||
``[workarounds]skip_hypervisor_version_check_on_lm=True`` in
|
||||
``nova.conf``. The option defaults to ``False``.
|
Loading…
Reference in New Issue