VFC Migration mapping string vios reversal

In the case of multiple fabrics with dual vioses, VFC mapping
strings should build mapping across both the VIOSes. So we
need to reverse the vios wraps in order to use the second vios
for the next fabric.

Change-Id: I09d9bd65241195247b326c8afdb54501fd6e4ed9
This commit is contained in:
Chhavi Agarwal 2015-11-03 06:50:54 -06:00
parent 69215ddc54
commit 0800820fc9
2 changed files with 7 additions and 0 deletions

View File

@ -445,6 +445,7 @@ class TestNPIVAdapter(test_vol.TestVolumeAdapter):
dest_mig_data = {}
mock_build_mig_map.side_effect = [['a'], ['b']]
self.vol_drv.stg_ftsk = mock.MagicMock()
# Execute the test
self.vol_drv.pre_live_migration_on_destination(
@ -457,6 +458,9 @@ class TestNPIVAdapter(test_vol.TestVolumeAdapter):
self.assertEqual({'b', 'a'},
set(dest_mig_data.get('vfc_lpm_mappings')))
# Verify that on migration, the WWPNs are reversed.
self.assertEqual(2, self.vol_drv.stg_ftsk.feed.reverse.call_count)
def test_set_fabric_meta(self):
port_map = [('1', 'aa AA'), ('2', 'bb BB'),
('3', 'cc CC'), ('4', 'dd DD'),

View File

@ -145,6 +145,9 @@ class NPIVVolumeAdapter(v_driver.FibreChannelVolumeAdapter):
fabric_mapping = pvm_vfcm.build_migration_mappings_for_fabric(
vios_wraps, self._fabric_ports(fabric), slots)
dest_mig_data['npiv_fabric_mapping_%s' % fabric] = fabric_mapping
# Reverse the vios wrapper so that the other fabric will get the
# on the second vios.
vios_wraps.reverse()
# Collate all of the individual fabric mappings into a single element.
full_map = []