Initial iSCSI configuration

Configuring interfaces

Before configuring iSCSI, the interfaces that would be used for it need to be described in storpool.conf. Here is the general config format:

SP_ISCSI_IFACE=IFACE1,RESOLVE:IFACE2,RESOLVE:[flags]

This row means that the first iSCSI network is on IFACE1 and the second one on IFACE2. The order is important for the configuration later. RESOLVE is the resolve interface, if different than the interfaces themselves, i.e. if it’s a bond or a bridge.

[flags] is not required - and more importantly, if not needed, must be omitted. Currently the only supported value is [lacp] (brackets included) if the interfaces are in a LACP trunk.

Here are a few examples:

  • Multipath, two separate interfaces used directly:

    SP_ISCSI_IFACE=eth0:eth1
    
  • Active-backup bond named bond0:

    SP_ISCSI_IFACE=eth0,bond0:eth1,bond0
    
  • LACP bond named bond0:

    SP_ISCSI_IFACE=eth0,bond0:eth1,bond0:[lacp]
    
  • Bridge interface cloudbr0 on top of LACP bond:

    SP_ISCSI_IFACE=eth0,cloudbr0:eth1,cloudbr0:[lacp]
    

Example setup

You can create a trivial iSCSI setup by following the series of StorPool CLI commands below (see iSCSI for details). The setup does the following:

  • Has baseName/IQN of iqn.2019-08.com.example:poc-cluster;

  • Has floating IP address is 192.168.42.247, which is in VLAN 42;

  • Two nodes from the cluster will be able to export in this group:

    • Node id 1, with IP address 192.168.42.246

    • Node id 3, with IP address 192.168.42.202

  • One client is defined, with IQN iqn.2019-08.com.example:poc-cluster:hv1

  • One volume, called tinyvolume will be exported to the client defined, in the portal group.

Note

You need to obtain the exact IQN of the initiator, available at:

  • Windows Server: iSCSI initiator, it is automatically generated upon installation

  • VMWare vSphere: it is automatically assigned upon creating a software iSCSI adapter

  • Linux-based (XenServer, etc.): /etc/iscsi/initiatorname.iscsi

# storpool iscsi config setBaseName iqn.2019-08.com.example:poc-cluster
OK

# storpool iscsi config portalGroup poc create
OK

# storpool iscsi config portalGroup poc addNet 192.168.42.247/24 vlan 42
OK

# storpool iscsi config portal create portalGroup poc address 192.168.42.246 controller 1
OK

# storpool iscsi config portal create portalGroup poc address 192.168.42.202 controller 3
OK

# storpool iscsi portalGroup list
---------------------------------------
| name | networksCount | portalsCount |
---------------------------------------
| poc  |             1 |            2 |
---------------------------------------

# storpool iscsi portalGroup list portals
--------------------------------------------
| group | address             | controller |
--------------------------------------------
| poc   | 192.168.42.246:3260 |          1 |
| poc   | 192.168.42.202:3260 |          3 |
--------------------------------------------

# storpool iscsi config initiator iqn.2019-08.com.example:poc-cluster:hv1 create
OK

# storpool volume tinyvolume template tinytemplate create # assumes tinytemplate exists
OK

# storpool iscsi config target create tinyvolume
OK

# storpool iscsi config export volume tinyvolume portalGroup poc initiator iqn.2019-08.com.example:poc-cluster:hv1
OK

# storpool iscsi initiator list
----------------------------------------------------------------------------------------------
| name                                    | username | secret | networksCount | exportsCount |
----------------------------------------------------------------------------------------------
| iqn.2019-08.com.example:poc-cluster:hv1 |          |        |             0 |            1 |
----------------------------------------------------------------------------------------------

# storpool iscsi initiator list exports
---------------------------------------------------------------------------------------------------------------------------------------------
| name                                           | volume     | currentControllerId | portalGroup | initiator                               |
---------------------------------------------------------------------------------------------------------------------------------------------
| iqn.2019-08.com.example:poc-cluster:tinyvolume | tinyvolume |                   1 | poc         | iqn.2019-08.com.example:poc-cluster:hv1 |
---------------------------------------------------------------------------------------------------------------------------------------------

Below is a setup with two separate networks that allows for multipath. It uses the 192.168.41.0/24 network on the first interface, 192.168.42.0/24 on the second interface, and the .247 IP for the floating IP in both networks:

# storpool iscsi config setBaseName iqn.2019-08.com.example:poc-cluster
OK

# storpool iscsi config portalGroup poc create
OK

# storpool iscsi config portalGroup poc addNet 192.168.41.247/24
OK

# storpool iscsi config portalGroup poc addNet 192.168.42.247/24
OK

# storpool iscsi config portal create portalGroup poc address 192.168.41.246 controller 1
OK

# storpool iscsi config portal create portalGroup poc address 192.168.42.246 controller 1
OK

# storpool iscsi config portal create portalGroup poc address 192.168.41.202 controller 3
OK

# storpool iscsi config portal create portalGroup poc address 192.168.42.202 controller 3
OK

# storpool iscsi portalGroup list
---------------------------------------
| name | networksCount | portalsCount |
---------------------------------------
| poc  |             2 |            4 |
---------------------------------------

# storpool iscsi portalGroup list portals
--------------------------------------------
| group | address             | controller |
--------------------------------------------
| poc   | 192.168.41.246:3260 |          1 |
| poc   | 192.168.41.202:3260 |          3 |
| poc   | 192.168.42.246:3260 |          1 |
| poc   | 192.168.42.202:3260 |          3 |
--------------------------------------------

Note

Please note that the order of adding the networks relates to the order in the SP_ISCSI_IFACE, the first network will be bound to the first interface appearing in this configuration. For details on how to list configured iSCSI interfaces, see Getting iSCSI configuration. For details on how to list addresses exposed by a particular node see Using iscsi_tool.

There is no difference in exporting volumes in multi-path setups.