Hello, and welcome to this presentation. This presentation shows you how to configure an
iSCSI target of an Oracle Linux instance in Oracle Cloud Infrastructure. You also see
how to configure an Oracle Linux instance as an iSCSI initiator.
Ultimately, this configuration is the basis of an Oracle Cluster File System 2 - or OCFS2
- cluster with two initiators and one target.
A VCN was first created with two subnets. One of the subnets is dedicated to supporting
instances in a single Availability Domain. The other subnet - which is used for this
configuration - is regional, and serves instances in more than one Availability Domain. This
subnet will be used to support the cluster configuration.
The security list has been updated to include rules for ports used by iSCSI and OCFS2.
We'll create an Oracle Linux 8 instance in Availability Domain 3 for our target. The
firewall on the target must be configured to allow tcp connections on port 3260. We'll
create and attach a Block Volume for the iSCSI backing store.
Using the iSCSI target command line interface utility, the Oracle Linux 8 instance is configured
as an iSCSI target.
Two Oracle Linux 8 instances have been created in Availability Domain 2, and one of them
is configured for this exercise.
The iscsi-initiator-utils package is verified and used to configure the initiator. The iSCSI
target is then discovered.
For this demonstration, I'm logged into the Oracle Cloud Infrastructure console. There
is an instance - smm_iSCSI_tgt - for the iSCSI target, and it is in Availability Domain 3.
There are two instances - smm_cluster_01 and 02 which are configured in Availability Domain
2. In this demonstration, we only focus on smm cluster 01.
The configuration the ocfs2 cluster with the two cluster instances is demonstrated in the
presentation titled "Configure and Test an OCFS2 Cluster with Oracle Linux on Oracle
Cloud Infrastructure".
The security list for this VCN includes a stateful ingress rule for port 3260.
Before we create the Block Volume, enable the Oracle Cloud Infrastructure utilities,
also known as oci-utils. Start an ssh session into the instance. Enter sudo systemctl enable
ocid.service.... then enter sudo systemctl start ocid.service. This utility will automatically
handle the iSCSI connection between the block volume and the instance.
From the Block Storage display in the Oracle Cloud Infrastructure console, click Create
Block Volume. For the name, I provide smm-iscsi-ocfs2-vol - for volume.
Select Availability Domain 3, because that is where the iscsi target instance has been
configured.
Under volume size and performance, click Custom, then change the size to 50GB for this demonstration.
Click Create Block Volume to continue.
Wait for a few minutes, then navigate to the target instance with the Oracle Cloud Infrastructure
console. There, click Attached Block Volumes in the Resources menu. Then click Attach Block
Volume.
In the dialog box that appears, select the iSCSI volume attachment type. Select the block
volume created for this demonstration: smm-iscsi-ocfs2-vol.
For Access, click Read/Write - shareable. This volume will be used to support the OCFS2
cluster file system. So acknowledge the warning by clicking the check box. Then click Attach.
Acknowledge the warning regarding records /etc/fstab by clicking Close.
Wait a few minutes.
Login to the instance and run the command sudo oci-iscsi-config -s, which shows the
iSCSI configuration with the oci-utils CLI. The iSCSI storage device is attached as device
/dev/sdb.
Clear the screen. Now install the targetcli utility by entering
sudo -E dnf install targetcli -y We use the -E option because there are environment
variables which point at an http proxy on a bastion that provides access to the private
subnet. Use -y to bypass the acknowledgement to enter y during the installation.
Clear the screen, then start the targetcli utility by entering sudo targetcli.
Begin the target configuration by setting the location to backstores/block. We are configuring
Oracle Cloud Infrastructure block storage as a backing store for the OCFS2 cluster.
Enter create name=ocfs2 dev=/dev/sdb.
Set the location to /iscsi and create the iscsi target iqn. The target portal group
(TGP) 1 is automatically created and the default port of 3260 is applied.
For this demonstration, we simplify login by disabling authentication. Set the location
to the iqn value/tpg1/acls. Create a node acl by entering create and the iqn value.
Set the location to the default target portal group by entering
cd ..
Enter set attribute authentication=0
And enter set attribute generate_node_acls=1
set the location to luns, under the target portal group and enter
create /backstores/block/ocfs2
Set location to the root and enter ls
to see the target configuration. After reviewing the configuration, enter
saveconfig
then exit.
Clear the screen.
Enter the command sudo systemctl enable target.service and enter sudo systemctl start target.service
to start the iSCSI target service.
Now, turn attention to the initiator configuration. I'm logged in to an Oracle Linux 8 instance
that will become a cluster member. However, the procedure to configure the iSCSI initiator
is the same, even for a single storage client.
To verify iSCSI initiator utilities are installed, enter
sudo -E dnf list iscsi-init*
The result shows that iSCSI utilities are installed.
Clear the screen.
Discover the device by entering sudo iscsiadm -m discovery -t -p 10.0.2.9
which is the IP address of the instance configured as the iSCSI target. The result shows the
instance IP address and port, and the iqn that was entered during the target configuration
previously shown in this demonstration.
Enter sudo vi /etc/iscsi/initiatorname.iscsi
to edit the file. Change the iqn value following the initatorName token and equal sign. Save
the file. Check the value has been saved by entering
cat /etc/iscsi/initatorname.iscsi
Clear the screen.
Restart the iscsi initator service by entering sudo systemctl restart iscsid.service
Check to see that the iscsi device is now connected to the instance. First, enter
sudo fdisk -l | grep sdb
The result shows the 50GB device has been connected. Enter
ls -l /dev/sdb*
to see the device. This device is now ready to be partitioned and used.
In this presentation, you saw an overview of the Oracle Cloud Infrastructure instances
and VCN security rules supporting iSCSI storage for Oracle Linux 8. You saw a demonstration
of the configuration of an Oracle Cloud Infrastructure instance as an iSCSI target, including the
local firewall configuration. And you saw the configuration of an instance as an iSCSI
initiator.