ClusterLabs / resource-agents

Combined repository of OCF agents from the RHCS and Linux-HA projects
GNU General Public License v2.0
493 stars 580 forks source link

iSCSILogicalUnit assumes portal runs on 0.0.0.0 when using LIO-t #1425

Open ezaton opened 4 years ago

ezaton commented 4 years ago

The following lines fail to start the agent when a custom target group portal exists:

  o- iscsi ............................................................................................................ [Targets: 1]
  | o- iqn.1994-05.com.storage:4254abcabfea .............................................................................. [TPGs: 1]
  |   o- tpg1 .................................................................................................. [gen-acls, no-auth]
  |     o- acls .......................................................................................................... [ACLs: 0]
  |     o- luns .......................................................................................................... [LUNs: 2]
  |     | o- lun0 ........................................ [block/zpool1-iscsi-lun0 (/dev/storage/luns/lun0.lun) (default_tg_pt_gp)]
  |     | o- lun1 ........................................ [block/zpool1-iscsi-lun1 (/dev/storage/luns/lun1.lun) (default_tg_pt_gp)]
  |     o- portals .................................................................................................... [Portals: 2]
  |       o- 10.200.1.251:3260 ................................................................................................ [OK]
  |       o- 10.200.2.251:3260 ................................................................................................ [OK]

As you can see - I am using two target portals, however - I do not attach to all existing network interfaces. This allows for a very precise control over the paths clients will use. The following block fails, however:

if $(ip a | grep -q inet6); then
    ocf_run -q targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/portals delete 0.0.0.0 3260
    ocf_run -q targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/portals create ::0
fi

The script fails on start due to failure to delete the portal 0.0.0.0. We need to either modify the script to translate to IPv6 the existing IP addresses of all relevant portals, or to ignore this part entirely. I believe that IPv6 is hardly being used in iSCSI networks. What do you think about it?

hunter86bg commented 4 years ago

Actually I don't get why we cannot use both IPv4 and IPv6 ... After all our systems can do like that, thus the resource should be able to cope with it.

ezaton commented 4 years ago

I have suggested a patch (see here my pull request: https://github.com/ClusterLabs/resource-agents/pull/1427) which will ignore this directive if the portal is not defined for 0.0.0.0 (all interfaces). This way - the original behavior will not change, and if the cluster owner wants to make use of IPv6, then the portal IP defined should be v6 by nature in the "parent" resource iSCSITarget.