In this article, I’ll show how to set up SCSI-3 Persistent Reservations on Fedora Core 20 using targetcli, serving a pair of iSCSI LUNs to a simple Red Hat Cluster that will host a failover filesystem for the purposes of testing the iSCSI implementation. The Linux IO target (LIO) (http://linux-iscsi.org/wiki/LIO) has been the Linux SCSI target since kernel version 2.6.38. It supports a rapidly growing number of fabric modules, and all existing Linux block devices as backstores. For the purposes of our demonstration, the important fact is that it supports operating as an iSCSI target. targetcli is the tool used to perform the LIO configuration. SCSI-3 persistent reservations are required for a number of cluster storage configurations for I/O fencing and failover/retakeover. Therefore, LIO can be used as the foundation for high-end clustering solutions such as Red Hat Cluster Suite. You can read more about persistent reservations here.
The nodes in the lab are as follows:
- 10.1.1.103 - centos03 - Red Hat Cluster node 1 on CentOS 6.5
- 10.1.1.104 - centos04 - Red Hat Cluster node 2 on CentOS 6.5
- 10.1.1.108 - fedora01 - Fedora Core 20 storage node
Installation
I’ll start by installing targetcli onto fedora01:
|
1 |
[root@fedora01 ~]# yum -y install targetcli |
Let’s check that it has been installed correctly:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
root@fedora01 ~]# targetcli Warning: Could not load preferences file /root/.targetcli/prefs.bin. targetcli shell version 2.1.fb35 Copyright 2011-2013 by Datera, Inc and others. For help on commands, type 'help'. /> ls o- / ...................................................................................... [...] o- backstores ........................................................................... [...] | o- block ............................................................... [Storage Objects: 0] | o- fileio .............................................................. [Storage Objects: 0] | o- pscsi ............................................................... [Storage Objects: 0] | o- ramdisk ............................................................. [Storage Objects: 0] o- iscsi ......................................................................... [Targets: 0] o- loopback ...................................................................... [Targets: 0] o- vhost ......................................................................... [Targets: 0] /> exit Global pref auto_save_on_exit=true Last 10 configs saved in /etc/target/backup. Configuration saved to /etc/target/saveconfig.json |
Make sure that, before proceeding, any existing configuration is removed:
|
1 2 |
[root@fedora01 ~]# targetcli clearconfig confirm=true All configuration cleared |