/Add Pure Storage iSCSI to Linux CentOS – Part 1

Add Pure Storage iSCSI to Linux CentOS – Part 1


In this how-to blog post, I will Add Pure Storage iSCSI to Linux CentOS – Part 1.  This the first part of two articles, where the final goal is to move Oracle DB from a NetApp NFS Shared to an iSCSI Lun from PureStorage.

In this case, the plan is to set the iSCSI initiator in the Linux and enable multipath and add PureStorage LUNs as mount points.

In the second article, I will explain how to move the Oracle DB from the NFS mount point to the iSCSI mount point without changing anything in the Oracle configurations.

Environment:

  • Oracle 12c R2
  • Linux CentOS v7
  • NetApp FAS2240-4
  • Pure Storage FlashArray //X20 R3 Model

Since we have two Oracle Servers connected to NetApp, I need to move them to our new PureStorage system. But since these are physical servers, before making any changes on production Oracle Servers, I build a Virtual POC with the same environment and replicate all the steps for the move.

All the steps in the process in this first part.

Linux / Oracle

  • Install CentOS7.
  • Created two NFS Volumes in NetApp (similar to that exists in the production Oracle)
  • Installed Oracle 12c (in /netapp-Ora01 for applications and in /netapp-Ora02 for DB)
  • Created DB and some tables with 1M random record to have some data.

Linux / Pure Storage

  • Configured iSCSI in Linux with iSCSI initiator and multipath.
  • Connected Linux to Pure Storage using four paths (2 for each interface)
  • Created two iSCSI LUNs  in Pure Storage and add them to the Linux Server
  • Created two temporarily mount points in Linux (Pure-Ora01 and Pure-Ora01)
  • Mount iSCSI devices into the new mount points
  • Set Oracle and oinstall permissions to the mount points
  • Testing multipath by disconnecting network interfaces to check if iSCSI was configured properly and mounts are still available

In both articles, I will not go through installing Linux CentOS v7 or Oracle 12c R2 because there are already many articles out there.

After Linux and Oracle are installed, let us start to configure Linux to have the iSCSI initiator service installed.

First, I will check if there are any updates to do on my CentOS

Some updates were applied, and now we can continue.

First, we need to install iSCSI initiation tools.

If you try to start your iSCSI initiator at this point, you will get:

This is because the iSCSI initiator is only started and active when their devices are connected. We will leave for now the iSCSI initiator service.

Now we will install a multipath package.

Enable default multipath configuration file and start the multipath daemon

Now since we are using Pure Storage, we need to add to Pure Storage multipath settings to /etc/multipach.conf

This will enable multipath and Round Robin (RR) policy at boot.

Add the following to the etc/multipath.conf. This is for RHEL 7.x and CentOS 7. For different Linux or versions, you need to add different parameters. Check Pure Storage documentation for your Linux version parameters.

After adding the DM-Mutipathd parameters, restart the service: systemctl restart multipathd.service

Next, check your IQN and then create a Target in your Pure Storage.

While you create a new Target in your Pure Storage, rebooted your Linux.

How to create Host and add IQN in Pure Storage

First, create a host. Select the Storage tab in the main menu, then Hosts, and use the + icon to create the host.

Add Pure Storage iSCSI to Linux CentOS - Part 1

After the Host is created, select the Host created and add the IQN target. Add the IQN copy from the above Linux command.

Add Pure Storage iSCSI to Linux CentOS - Part 1

Next, add your LUNs that you create previously to the Host.

Add Pure Storage iSCSI to Linux CentOS - Part 1

At this moment, after the Linux reboot, Linux should already see your LUNs.

To see the created LUNs in Linux, you need to use the iSCSI initiator to discover the iSCSI Portal.

Now this command will depend on how many Network interfaces are used in your Pure Storage.

You can have this information directly from your Pure Storage (connecting to Pure Storage Console), using the command: pureport list

For my case, I have 4 interfaces per controller.

Add Pure Storage iSCSI to Linux CentOS - Part 1

So I need to run the discovery command in each IP.

Note: In Pure Storage, you should always use CHAP policy and set IQN Target per IP host, so that source hosts can only see their LUNs and not other LUNs in Pure Storage that may not use CHAP or are set per IP host.

Example:

Some useful commands:

  • Use the best interface to connect:

    iscsiadm -m discovery -t st -p 192.168.10.252 -I default -P 1

  • Use a specific interface in your host to connect to your Pure Storages:

    iscsiadm -m discovery -t st -p 192.100.27.95 -I ieth0 (your interface/iface name)

  • Create a new iface to use a specific Network interface:

    iscsiadm -m iface -I iface_name(for better management your interface name) –op=new

  • Delete an iface:

    iscsiadm -m iface -I iface_name –op=delete

  • Check iface that exists in your interface iSCSI configurations:

    iscsiadm -m iface

Now set the login to Pure Storage Controller(run the same command login command for each controller you have in your Storage System).

Set automatic login on boot: iscsiadm -m node -L automatic

Some useful commands:

  • Check all Targets on your Storage System:

    iscsiadm -m node

  • Connect to a specific Target:

    iscsiadm -m node -T iqn.2000-01.com.synology:HomeStorage.Oracle.75c007999 -p 192.168.10.252 -l

  • Remove a specific Target connection:

    iscsiadm -m node -T iqn.2000-01.com.synology:HomeStorage.Oracle.75c007999 -p 192.168.10.252 -u

Now check your multipath device-mapped ID: multipath -ll

Add Pure Storage iSCSI to Linux CentOS - Part 1

As we can see above, I have the two LUNs(1Tb each) with 4 connections each. So we are ok, and now we can start to mount our LUNs to mount points.

Checking my partitions now, I see those two new disks/volumes: fdisk -l

Add Pure Storage iSCSI to Linux CentOS - Part 1

We see 4 connections per volume, and we get 8 records, plus the mapper (I am only displaying here two). Always double-check the ID with the mapper with the same ID you have your volumes identified.

Now lets us create a mount point so that we can mount our volumes to it.

Map using device-mapped ID that we listed above.

Now mount your volume to your mount point.

Check if the mount is using the proper volumes/devices

Also do not forget to add both mount to your Linux fstab

Testing the rw on the new mounts

All permissions are ok, and the new disks are accessible and rw.

Since I need to move Oracle to these new volumes, I will already set Oracle permissions for the final step.

Double-check if all permissions were set, and this finishes the configuration of the Linux server with new volumes from Pure Storage.

So that this blog post is not too big, the Oracle move from the NetApp NFS Shares to this new Pure Storage iSCSI Volumes I will explain in the second part.

Both articles:

I hope this blog post about how to add Pure Storage iSCSI to Linux CentOS – Part 1 was useful.

Share this article if you think it is worth sharing. If you have any questions or comments, comment here, or contact me on Twitter.

©2021 ProVirtualzone. All Rights Reserved
By | 2021-03-29T00:01:19+02:00 March 28th, 2021|Olher, Storage|0 Comments

About the Author:

I am over 20 years’ experience in the IT industry. Working with Virtualization for more than 10 years (mainly VMware). I am an MCP, VCP6.5-DCV, VMware vSAN Specialist, Veeam Vanguard 2018/2019, vExpert vSAN 2018/2019 and vExpert for the last 4 years. Specialties are Virtualization, Storage, and Virtual Backups. I am working for Elits a Swedish consulting company and allocated to a Swedish multinational networking and telecommunications company as a Teach Lead and acting as a Senior ICT Infrastructure Engineer. I am a blogger and owner of the blog ProVirtualzone.com

Leave a Reply

%d bloggers like this: