Merge "Test live migrate on a paused instance"
This commit is contained in:
commit
eefcdd33cf
|
@ -375,6 +375,11 @@
|
|||
# https://bugs.launchpad.net/nova/+bug/1398999 (boolean value)
|
||||
#block_migrate_cinder_iscsi = false
|
||||
|
||||
# Does the test system allow live-migration of paused instances? Note,
|
||||
# this is more than just the ANDing of paused and live_migrate, but
|
||||
# all 3 should be set to True to run those tests (boolean value)
|
||||
#live_migrate_paused_instances = false
|
||||
|
||||
# Enable VNC console. This configuration value should be same as
|
||||
# [nova.vnc]->vnc_enabled in nova.conf (boolean value)
|
||||
#vnc_console = false
|
||||
|
|
|
@ -84,10 +84,15 @@ class LiveBlockMigrationTestJSON(base.BaseV2ComputeAdminTest):
|
|||
self.volumes_client.wait_for_volume_status(volume_id, 'available')
|
||||
self.volumes_client.delete_volume(volume_id)
|
||||
|
||||
@test.idempotent_id('1dce86b8-eb04-4c03-a9d8-9c1dc3ee0c7b')
|
||||
@testtools.skipIf(not CONF.compute_feature_enabled.live_migration,
|
||||
'Live migration not available')
|
||||
def test_live_block_migration(self):
|
||||
def _test_live_block_migration(self, state='ACTIVE'):
|
||||
"""Tests live block migration between two hosts.
|
||||
|
||||
Requires CONF.compute_feature_enabled.live_migration to be True.
|
||||
|
||||
:param state: The vm_state the migrated server should be in before and
|
||||
after the live migration. Supported values are 'ACTIVE'
|
||||
and 'PAUSED'.
|
||||
"""
|
||||
# Live block migrate an instance to another host
|
||||
if len(self._get_compute_hostnames()) < 2:
|
||||
raise self.skipTest(
|
||||
|
@ -95,10 +100,33 @@ class LiveBlockMigrationTestJSON(base.BaseV2ComputeAdminTest):
|
|||
server_id = self._get_an_active_server()
|
||||
actual_host = self._get_host_for_server(server_id)
|
||||
target_host = self._get_host_other_than(actual_host)
|
||||
|
||||
if state == 'PAUSED':
|
||||
self.admin_servers_client.pause_server(server_id)
|
||||
self.admin_servers_client.wait_for_server_status(server_id, state)
|
||||
|
||||
self._migrate_server_to(server_id, target_host)
|
||||
self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
|
||||
self.servers_client.wait_for_server_status(server_id, state)
|
||||
self.assertEqual(target_host, self._get_host_for_server(server_id))
|
||||
|
||||
@test.idempotent_id('1dce86b8-eb04-4c03-a9d8-9c1dc3ee0c7b')
|
||||
@testtools.skipUnless(CONF.compute_feature_enabled.live_migration,
|
||||
'Live migration not available')
|
||||
def test_live_block_migration(self):
|
||||
self._test_live_block_migration()
|
||||
|
||||
@test.idempotent_id('1e107f21-61b2-4988-8f22-b196e938ab88')
|
||||
@testtools.skipUnless(CONF.compute_feature_enabled.live_migration,
|
||||
'Live migration not available')
|
||||
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
|
||||
'Pause is not available.')
|
||||
@testtools.skipUnless(CONF.compute_feature_enabled
|
||||
.live_migrate_paused_instances,
|
||||
'Live migration of paused instances is not '
|
||||
'available.')
|
||||
def test_live_block_migration_paused(self):
|
||||
self._test_live_block_migration(state='PAUSED')
|
||||
|
||||
@test.idempotent_id('e19c0cc6-6720-4ed8-be83-b6603ed5c812')
|
||||
@testtools.skipIf(not CONF.compute_feature_enabled.live_migration or not
|
||||
CONF.compute_feature_enabled.
|
||||
|
|
|
@ -335,6 +335,13 @@ ComputeFeaturesGroup = [
|
|||
help="Does the test environment block migration support "
|
||||
"cinder iSCSI volumes. Note, libvirt doesn't support this, "
|
||||
"see https://bugs.launchpad.net/nova/+bug/1398999"),
|
||||
# TODO(gilliard): Remove live_migrate_paused_instances at juno-eol.
|
||||
cfg.BoolOpt('live_migrate_paused_instances',
|
||||
default=False,
|
||||
help="Does the test system allow live-migration of paused "
|
||||
"instances? Note, this is more than just the ANDing of "
|
||||
"paused and live_migrate, but all 3 should be set to True "
|
||||
"to run those tests"),
|
||||
cfg.BoolOpt('vnc_console',
|
||||
default=False,
|
||||
help='Enable VNC console. This configuration value should '
|
||||
|
|
Loading…
Reference in New Issue