Merge "Comprehensive storage scrub in pre_live_migration"
This commit is contained in:
@@ -123,7 +123,8 @@ class TestLPM(test.TestCase):
|
||||
self.lpmdst.check_destination, 'context',
|
||||
src_compute_info, dst_compute_info)
|
||||
|
||||
def test_pre_live_mig(self):
|
||||
@mock.patch('pypowervm.tasks.storage.ComprehensiveScrub')
|
||||
def test_pre_live_mig(self, mock_scrub):
|
||||
mock_vol_drv = mock.MagicMock()
|
||||
resp = self.lpmdst.pre_live_migration(
|
||||
'context', 'block_device_info', 'network_info', 'disk_info',
|
||||
@@ -134,6 +135,7 @@ class TestLPM(test.TestCase):
|
||||
self.assertIsNotNone(resp)
|
||||
mock_vol_drv.pre_live_migration_on_destination.assert_called_once_with(
|
||||
{}, {})
|
||||
self.assertEqual(1, mock_scrub.call_count)
|
||||
|
||||
@mock.patch('pypowervm.tasks.migration.migrate_lpar')
|
||||
def test_live_migration(self, mock_migr):
|
||||
|
||||
@@ -20,6 +20,7 @@ from nova import exception
|
||||
from nova.i18n import _, _LE, _LI
|
||||
from pypowervm.tasks import management_console as mgmt_task
|
||||
from pypowervm.tasks import migration as mig
|
||||
from pypowervm.tasks import storage as stor_task
|
||||
from pypowervm.tasks import vterm
|
||||
|
||||
from oslo_config import cfg
|
||||
@@ -151,7 +152,6 @@ class LiveMigrationDest(LiveMigration):
|
||||
"""Prepare an instance for live migration
|
||||
|
||||
:param context: security context
|
||||
:param instance: nova.objects.instance.Instance object
|
||||
:param block_device_info: instance block device information
|
||||
:param network_info: instance network information
|
||||
:param disk_info: instance disk information
|
||||
@@ -182,6 +182,11 @@ class LiveMigrationDest(LiveMigration):
|
||||
raise LiveMigrationVolume(
|
||||
host=self.drvr.host_wrapper.system_name,
|
||||
name=self.instance.name, volume=vol_drv.volume_id)
|
||||
|
||||
# Scrub stale/orphan mappings and storage to minimize probability of
|
||||
# collisions on the destination.
|
||||
stor_task.ComprehensiveScrub(self.drvr.adapter).execute()
|
||||
|
||||
return dest_mig_data
|
||||
|
||||
def post_live_migration_at_destination(self, network_info, vol_drvs):
|
||||
|
||||
Reference in New Issue
Block a user