How to configure PureStorage FlashArray over iSCSI in Ubuntu Linux

Applying Queue Settings with udev and Maximum IO Size Settings:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
root@vm1:~# cat /lib/udev/rules.d/99-pure-storage.rules
# Recommended settings for Pure Storage FlashArray.
# Use none scheduler for high-performance solid-state storage for SCSI devices
ACTION=="add|change", KERNEL=="sd*[!0-9]", SUBSYSTEM=="block", ENV{ID_VENDOR}=="PURE", ATTR{queue/scheduler}="none"
ACTION=="add|change", KERNEL=="dm-[0-9]*", SUBSYSTEM=="block", ENV{DM_NAME}=="3624a937*", ATTR{queue/scheduler}="none"

# Reduce CPU overhead due to entropy collection
ACTION=="add|change", KERNEL=="sd*[!0-9]", SUBSYSTEM=="block", ENV{ID_VENDOR}=="PURE", ATTR{queue/add_random}="0"
ACTION=="add|change", KERNEL=="dm-[0-9]*", SUBSYSTEM=="block", ENV{DM_NAME}=="3624a937*", ATTR{queue/add_random}="0"

# Spread CPU load by redirecting completions to originating CPU
ACTION=="add|change", KERNEL=="sd*[!0-9]", SUBSYSTEM=="block", ENV{ID_VENDOR}=="PURE", ATTR{queue/rq_affinity}="2"
ACTION=="add|change", KERNEL=="dm-[0-9]*", SUBSYSTEM=="block", ENV{DM_NAME}=="3624a937*", ATTR{queue/rq_affinity}="2"

# Set the HBA timeout to 60 seconds
ACTION=="add|change", KERNEL=="sd*[!0-9]", SUBSYSTEM=="block", ENV{ID_VENDOR}=="PURE", ATTR{device/timeout}="60"

ACTION=="add|change", KERNEL=="sd*[!0-9]", SUBSYSTEM=="block", ENV{ID_VENDOR}=="PURE", ATTR{queue/max_sectors_kb}="4096"

Recommended DM-Multipath Settings:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
root@vm1:~# cat /etc/multipath.conf
defaults {
polling_interval 10
}

devices {
device {
vendor "NVME"
product "Pure Storage FlashArray"
path_selector "queue-length 0"
path_grouping_policy group_by_prio
prio ana
failback immediate
fast_io_fail_tmo 10
user_friendly_names no
no_path_retry 0
features 0
dev_loss_tmo 60
}
device {
vendor "PURE"
product "FlashArray"
path_selector "service-time 0"
hardware_handler "1 alua"
path_grouping_policy group_by_prio
prio alua
failback immediate
path_checker tur
fast_io_fail_tmo 10
user_friendly_names no
no_path_retry 0
features 0
dev_loss_tmo 600
}
}

Refer to here for more detail.

Check multipath service status:

1
root@vm1:~# systemctl status multipathd

Get initiator name on host

1
2
root@vm1:~# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2005-03.org.open-iscsi:aaaaaaaa

Create host in FlashArray

Create a host entry in FlashArray in order to connect volumes:

Configure iSCSI IQNs in FlashArray

Set the iSCSI IQNs under the host ports with the above InitiatorName:

Create volume and connect to host in FlashArray

Create multiple volumes in FlashArray:

Connect volumes to a host:

Install iscsi-initiator-utils package

1
2
3
4
5
6
7
8
9
10
11
root@vm1:~# apt install iscsi-initiator-utils

root@vm1:~# iscsiadm --help
iscsiadm -m discoverydb [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -Dl ] ] | [ [ -p ip:port -t type] [ -o operation ] [ -n name ] [ -v value ] [ -lD ] ]
iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -l ] ] | [ [ -p ip:port ] [ -l | -D ] ]
iscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port -I ifaceN ] [ -l | -u | -R | -s] ] [ [ -o operation ] [ -n name ] [ -v value ] ]
iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel] [ -r sessionid | sysfsdir [ -R | -u | -s ] [ -o operation ] [ -n name ] [ -v value ] ]
iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename | -H hostno|MAC ] [ [ -o operation ] [ -n name ] [ -v value ] ] [ -C ping [ -a ip ] [ -b packetsize ] [ -c count ] [ -i interval ] ]
iscsiadm -m fw [ -d debug_level ] [ -l ]
iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ [ -C chap [ -x chap_tbl_idx ] ] | [ -C flashnode [ -A portal_type ] [ -x flashnode_idx ] ] | [ -C stats ] ] [ [ -o operation ] [ -n name ] [ -v value ] ]
iscsiadm -k priority

Discover paths and list the target ports

1
2
3
4
5
6
7
8
9
10
11
root@vm1:~# iscsiadm -m discovery -t st -p 10.10.10.15
10.10.10.59:3260,119 iqn.2010-06.com.purestorage:flasharray.xxxxxxxx
10.10.10.16:3260,119 iqn.2010-06.com.purestorage:flasharray.xxxxxxxx
10.10.10.58:3260,119 iqn.2010-06.com.purestorage:flasharray.xxxxxxxx
10.10.10.15:3260,119 iqn.2010-06.com.purestorage:flasharray.xxxxxxxx

root@vm1:~# iscsiadm -m node
10.10.10.59:3260,119 iqn.2010-06.com.purestorage:flasharray.xxxxxxxx
10.10.10.16:3260,119 iqn.2010-06.com.purestorage:flasharray.xxxxxxxx
10.10.10.15:3260,119 iqn.2010-06.com.purestorage:flasharray.xxxxxxxx
10.10.10.58:3260,119 iqn.2010-06.com.purestorage:flasharray.xxxxxxxx

Scan the volumes on host automatically after reboot

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
root@vm1:~# multipath -ll

root@vm1:~# iscsiadm -m node --target iqn.2010-06.com.purestorage:flasharray.xxxxxxxx --op update -n node.startup -v automatic

root@vm1:~# multipath -ll

root@vm1:~# reboot

root@vm1:~# multipath -ll
3624a93702e5c57e44f014def0001dd2f dm-5 PURE,FlashArray
size=250G features='0' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=50 status=active
|- 18:0:0:3 sdk 8:160 active ready running
|- 16:0:0:3 sdc 8:32 active ready running
|- 19:0:0:3 sdl 8:176 active ready running
`- 17:0:0:3 sdf 8:80 active ready running

Other commands

Login to the iscsi target port manually:

1
root@vm1:~# iscsiadm -m node --targetname iqn.2010-06.com.purestorage:flasharray.xxxxxxxx –login

Scan the volume manually:

1
echo 1>/sys/class/block/sda/device/rescan