exp: add multipath support to the iSCSI patch
Change-Id: I0fa3ba729083a5a99e61781a66d6f4381c3e5e84
diff --git a/patches/openstack/cinder/sep-sp-iscsi.patch b/patches/openstack/cinder/sep-sp-iscsi.patch
index 82d9591..dfbec0c 100644
--- a/patches/openstack/cinder/sep-sp-iscsi.patch
+++ b/patches/openstack/cinder/sep-sp-iscsi.patch
@@ -390,15 +390,29 @@
+ ]
+ })
+
++ target_portals = [
++ "{addr}:3260".format(addr=net.address)
++ for net in cfg['pg'].networks
++ ]
++ target_iqns = [cfg['target'].name] * len(target_portals)
++ target_luns = [0] * len(target_portals)
++ if connector.get('multipath', False):
++ multipath_settings = {
++ 'target_iqns': target_iqns,
++ 'target_portals': target_portals,
++ 'target_luns': target_luns,
++ }
++ else:
++ multipath_settings = {}
++
+ res = {
+ 'driver_volume_type': 'iscsi',
+ 'data': {
++ **multipath_settings,
+ 'target_discovered': False,
-+ 'target_iqn': cfg['target'].name,
-+ 'target_portal': '{}:3260'.format(
-+ cfg['pg'].networks[0].address
-+ ),
-+ 'target_lun': 0,
++ 'target_iqn': target_iqns[0],
++ 'target_portal': target_portals[0],
++ 'target_lun': target_luns[0],
+ 'volume_id': volume['id'],
+ 'discard': True,
+ },