From 0800820fc909fa5ce273bb4ed881225681f9db40 Mon Sep 17 00:00:00 2001 From: Chhavi Agarwal Date: Tue, 3 Nov 2015 06:50:54 -0600 Subject: [PATCH] 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 --- nova_powervm/tests/virt/powervm/volume/test_npiv.py | 4 ++++ nova_powervm/virt/powervm/volume/npiv.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/nova_powervm/tests/virt/powervm/volume/test_npiv.py b/nova_powervm/tests/virt/powervm/volume/test_npiv.py index c57cf118..e1d88129 100644 --- a/nova_powervm/tests/virt/powervm/volume/test_npiv.py +++ b/nova_powervm/tests/virt/powervm/volume/test_npiv.py @@ -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'), diff --git a/nova_powervm/virt/powervm/volume/npiv.py b/nova_powervm/virt/powervm/volume/npiv.py index 2f37c8a0..350f6db6 100644 --- a/nova_powervm/virt/powervm/volume/npiv.py +++ b/nova_powervm/virt/powervm/volume/npiv.py @@ -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 = []