diff --git a/cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py b/cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py index 2458694417c..3079dea5cc0 100644 --- a/cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py +++ b/cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py @@ -7664,8 +7664,17 @@ class TestHPE3PARFCDriver(HPE3PARBaseDriver): 'volumeName': self.VOLUME_3PAR_NAME, 'remoteName': self.wwn[0], 'lun': 90, 'type': 0}]] - mock_replicated_client.getHostVLUNs.side_effect = ( - mock_client.getHostVLUNs.side_effect) + + mock_replicated_client.getHostVLUNs.side_effect = [ + hpeexceptions.HTTPNotFound('fake'), + [{'active': True, + 'volumeName': self.VOLUME_3PAR_NAME, + 'remoteName': self.wwn[1], + 'lun': 80, 'type': 0}], + [{'active': True, + 'volumeName': self.VOLUME_3PAR_NAME, + 'remoteName': self.wwn[0], + 'lun': 80, 'type': 0}]] location = ("%(volume_name)s,%(lun_id)s,%(host)s,%(nsp)s" % {'volume_name': self.VOLUME_3PAR_NAME, @@ -7673,15 +7682,23 @@ class TestHPE3PARFCDriver(HPE3PARBaseDriver): 'host': self.FAKE_HOST, 'nsp': 'something'}) mock_client.createVLUN.return_value = location - mock_replicated_client.createVLUN.return_value = location + location_peer = ("%(volume_name)s,%(lun_id)s,%(host)s,%(nsp)s" % + {'volume_name': self.VOLUME_3PAR_NAME, + 'lun_id': 80, + 'host': self.FAKE_HOST, + 'nsp': 'something'}) + mock_replicated_client.createVLUN.return_value = location_peer + + primary_luns = [90, 90] + peer_luns = [80, 80] expected_properties = { 'driver_volume_type': 'fibre_channel', 'data': { 'encrypted': False, - 'target_lun': 90, 'target_wwn': ['0987654321234', '123456789000987', '0987654321234', '123456789000987'], + 'target_luns': primary_luns + peer_luns, 'target_discovered': True, 'initiator_target_map': {'123456789012345': ['0987654321234', '123456789000987', diff --git a/cinder/volume/drivers/hpe/hpe_3par_fc.py b/cinder/volume/drivers/hpe/hpe_3par_fc.py index e0874dd4b2e..8d6773e40c2 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_fc.py +++ b/cinder/volume/drivers/hpe/hpe_3par_fc.py @@ -115,10 +115,11 @@ class HPE3PARFCDriver(hpebasedriver.HPE3PARDriverBase): failover. bug #1773069 4.0.6 - Set NSP for single path attachments. Bug #1809249 4.0.7 - Added Peer Persistence feature + 4.0.8 - For PP, return LUN ids from both arrays. Bug #2044255 """ - VERSION = "4.0.7" + VERSION = "4.0.8" # The name of the CI wiki page. CI_WIKI_NAME = "HPE_Storage_CI" @@ -279,9 +280,16 @@ class HPE3PARFCDriver(hpebasedriver.HPE3PARDriverBase): common._destroy_replication_client(remote_client) + len_main_wwn = len(info['data']['target_wwn']) + target_luns = [] + target_luns = [info['data']['target_lun']] * len_main_wwn + + len_backup_wwn = len(info_peer['data']['target_wwn']) + target_luns += [info_peer['data']['target_lun']] * len_backup_wwn + info = {'driver_volume_type': 'fibre_channel', 'data': {'encrypted': info['data']['encrypted'], - 'target_lun': info['data']['target_lun'], + 'target_luns': target_luns, 'target_discovered': True, 'target_wwn': info['data']['target_wwn'] + info_peer['data']['target_wwn'], diff --git a/releasenotes/notes/hpe-3par-return-lun-ids-6bc973ef74d0bf9c.yaml b/releasenotes/notes/hpe-3par-return-lun-ids-6bc973ef74d0bf9c.yaml new file mode 100644 index 00000000000..df5b1aed9ca --- /dev/null +++ b/releasenotes/notes/hpe-3par-return-lun-ids-6bc973ef74d0bf9c.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + HPE 3PAR driver `bug #2044255 + `_: + Fixed: In peer persistence setup, when volume is attached to instance, + now LUN ids are returned from both the arrays. +