When multipath is enabled, and the 3PAR driver is configured
to export a VLUN over N iSCSI IP(ports), we now use the same
LUN ID for each iSCSI IP export. Previously, when we would
export a volume over N iSCSI ports, we would get a new LUN ID
for each iSCSI port.
Change-Id: Ide0ce373a14f348a554688dee9b699feed3c5f26
Closes-Bug: #
1551994
mock.call.createVLUN(
self.VOLUME_3PAR_NAME,
auto=True,
- hostname=self.FAKE_HOST),
+ hostname=self.FAKE_HOST,
+ lun=None),
mock.call.getHostVLUNs(self.FAKE_HOST)]
mock_client.assert_has_calls(
self.VOLUME_3PAR_NAME,
auto=True,
hostname=self.FAKE_HOST,
- portPos={'node': 7, 'slot': 1, 'cardPort': 1}),
+ portPos={'node': 7, 'slot': 1, 'cardPort': 1},
+ lun=None),
mock.call.getHostVLUNs(self.FAKE_HOST)]
mock_client.assert_has_calls(
mock.call.createVLUN(
self.VOLUME_3PAR_NAME,
auto=True,
- hostname=self.FAKE_HOST),
+ hostname=self.FAKE_HOST,
+ lun=None),
mock.call.getHostVLUNs(self.FAKE_HOST)]
mock_client.assert_has_calls(
self.VOLUME_3PAR_NAME,
auto=True,
hostname=self.FAKE_HOST,
- portPos=self.FAKE_ISCSI_PORT['portPos']),
+ portPos=self.FAKE_ISCSI_PORT['portPos'],
+ lun=None),
mock.call.getHostVLUNs(self.FAKE_HOST)]
mock_client.assert_has_calls(
3.0.13 - Support creating a cg from a source cg
3.0.14 - Comparison of WWNs now handles case difference. bug #1546453
3.0.15 - Update replication to version 2.1
+ 3.0.16 - Use same LUN ID for each VLUN path #1551994
"""
- VERSION = "3.0.15"
+ VERSION = "3.0.16"
stats = {}
def _delete_3par_host(self, hostname):
self.client.deleteHost(hostname)
- def _create_3par_vlun(self, volume, hostname, nsp):
+ def _create_3par_vlun(self, volume, hostname, nsp, lun_id=None):
try:
location = None
+ auto = True
+
+ if lun_id:
+ auto = False
+
if nsp is None:
location = self.client.createVLUN(volume, hostname=hostname,
- auto=True)
+ auto=auto, lun=lun_id)
else:
port = self.build_portPos(nsp)
location = self.client.createVLUN(volume, hostname=hostname,
- auto=True, portPos=port)
+ auto=auto, portPos=port,
+ lun=lun_id)
vlun_info = None
if location:
{'name': volume_name, 'host': hostname})
return found_vlun
- def create_vlun(self, volume, host, nsp=None):
+ def create_vlun(self, volume, host, nsp=None, lun_id=None):
"""Create a VLUN.
In order to export a volume on a 3PAR box, we have to create a VLUN.
"""
volume_name = self._get_3par_vol_name(volume['id'])
- vlun_info = self._create_3par_vlun(volume_name, host['name'], nsp)
+ vlun_info = self._create_3par_vlun(volume_name, host['name'], nsp,
+ lun_id=lun_id)
return self._get_vlun(volume_name,
host['name'],
vlun_info['lun_id'],
3.0.6 - Adding manage/unmanage snapshot support
3.0.7 - Optimize array ID retrieval
3.0.8 - Update replication to version 2.1
+ 3.0.9 - Use same LUN ID for each VLUN path #1551994
"""
- VERSION = "3.0.8"
+ VERSION = "3.0.9"
def __init__(self, *args, **kwargs):
super(HPE3PARISCSIDriver, self).__init__(*args, **kwargs)
# Cycle through each ready iSCSI port and determine if a new
# VLUN should be created or an existing one used.
+ lun_id = None
for port in ready_ports:
iscsi_ip = port['IPAddr']
if iscsi_ip in target_portal_ips:
break
else:
vlun = common.create_vlun(
- volume, host, iscsi_ips[iscsi_ip]['nsp'])
+ volume, host, iscsi_ips[iscsi_ip]['nsp'],
+ lun_id=lun_id)
+
+ # We want to use the same LUN ID for every port
+ if lun_id is None:
+ lun_id = vlun['lun']
iscsi_ip_port = "%s:%s" % (
iscsi_ip, iscsi_ips[iscsi_ip]['ip_port'])
target_portals.append(iscsi_ip_port)