Deploying And Configuring iSCSI Target

In this post, we will deploy and configure an iSCSI Target Server on CentOS 7.9, then we will attach this storage to Kubernetes Cluster in Kubernetes section.

 

My environment:

I am running Centos 7.9 VM on a ESXI 6.5 platform, running on HP DL380 server. Other VM’s that are cohabitating with the scuzzy VM, are 3 Kubernetes worker nodes,1 Kubernetes Master node, 1 Ansible Master node, Eveng and a Certificate server.

Snapshot from ESXI depicting the VM’s.

I have allocated 6 GB of RAM, 2 Hard disks 1 with 20 GB and another with 100 GB of size.

Let’s start now.

I have disabled the Selinux, the firewall and updated the VM with latest packages.

Firewall is disabled.

Let’s look at the partition

/dev/sdb is our partition we are planning to use for iSCSI storage.

Obtain the targetcli shell.

By default everything is blank, since this is new installation

Create a Storage Block “badheblock1” using following commands

Create a TPG (Target Portal Group)

Check the update

Obtain the client iqn from the folder

cat /etc/iscsi/initiatorname.iscsi

iqn.1994-05.com.redhat:356a869e52f5

Create Node ACL

Create a LUN (Logical Unit Number).

Create a Portal now

I encountered the error “Could not create network Portal in configFS in linux”

One of the solution is to delete network portal.

Start and enable the target service.

Verification:

The default port for the iSCSI portal is TCP/3260, verify that the system is listening on port 3260. You may need to install the package “net-tools” to run the command netstat. I have already installed it on this system.

Client-Side Configuration

That’s it for now, iSCSI Target has been configured successfully!!!

Please provide your feedback in the comment section.

Leave a Reply

Your email address will not be published. Required fields are marked *