Protocol conversion
Changing the protocol used to access a LUN is a common requirement.
In some cases, it is part of an overall strategy to migrate data to the cloud. TCP/IP is the protocol of the cloud, and changing from FC to iSCSI allows easier migration into various cloud environments. In other cases, iSCSI might be desirable to leverage the decreased costs of an IP SAN. On occasion, a migration might use a different protocol as a temporary measure. For example, if a foreign array and ONTAP based LUNs cannot coexist on the same HBAs, you can use iSCSI LUNs long enough to copy data from the old array. You can then convert back to FC after the old LUNs are removed from the system.
The following procedure demonstrates conversion from FC to iSCSI, but the overall principles apply to a reverse iSCSI to FC conversion.
Install iSCSI initiator
Most operating systems include a software iSCSI initiator by default, but if one is not included, it can be easily installed.
[root@host1 /]# yum install -y iscsi-initiator-utils Loaded plugins: langpacks, product-id, search-disabled-repos, subscription- : manager Resolving Dependencies --> Running transaction check ---> Package iscsi-initiator-utils.x86_64 0:6.2.0.873-32.el7 will be updated --> Processing Dependency: iscsi-initiator-utils = 6.2.0.873-32.el7 for package: iscsi-initiator-utils-iscsiuio-6.2.0.873-32.el7.x86_64 ---> Package iscsi-initiator-utils.x86_64 0:6.2.0.873-32.0.2.el7 will be an update --> Running transaction check ---> Package iscsi-initiator-utils-iscsiuio.x86_64 0:6.2.0.873-32.el7 will be updated ---> Package iscsi-initiator-utils-iscsiuio.x86_64 0:6.2.0.873-32.0.2.el7 will be an update --> Finished Dependency Resolution Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Updating: iscsi-initiator-utils x86_64 6.2.0.873-32.0.2.el7 ol7_latest 416 k Updating for dependencies: iscsi-initiator-utils-iscsiuio x86_64 6.2.0.873-32.0.2.el7 ol7_latest 84 k Transaction Summary ============================================================================= Upgrade 1 Package (+1 Dependent package) Total download size: 501 k Downloading packages: No Presto metadata available for ol7_latest (1/2): iscsi-initiator-utils-6.2.0.873-32.0.2.el7.x86_6 | 416 kB 00:00 (2/2): iscsi-initiator-utils-iscsiuio-6.2.0.873-32.0.2. | 84 kB 00:00 ----------------------------------------------------------------------------- Total 2.8 MB/s | 501 kB 00:00Cluster01 Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : iscsi-initiator-utils-iscsiuio-6.2.0.873-32.0.2.el7.x86 1/4 Updating : iscsi-initiator-utils-6.2.0.873-32.0.2.el7.x86_64 2/4 Cleanup : iscsi-initiator-utils-iscsiuio-6.2.0.873-32.el7.x86_64 3/4 Cleanup : iscsi-initiator-utils-6.2.0.873-32.el7.x86_64 4/4 rhel-7-server-eus-rpms/7Server/x86_64/productid | 1.7 kB 00:00 rhel-7-server-rpms/7Server/x86_64/productid | 1.7 kB 00:00 Verifying : iscsi-initiator-utils-6.2.0.873-32.0.2.el7.x86_64 1/4 Verifying : iscsi-initiator-utils-iscsiuio-6.2.0.873-32.0.2.el7.x86 2/4 Verifying : iscsi-initiator-utils-iscsiuio-6.2.0.873-32.el7.x86_64 3/4 Verifying : iscsi-initiator-utils-6.2.0.873-32.el7.x86_64 4/4 Updated: iscsi-initiator-utils.x86_64 0:6.2.0.873-32.0.2.el7 Dependency Updated: iscsi-initiator-utils-iscsiuio.x86_64 0:6.2.0.873-32.0.2.el7 Complete! [root@host1 /]#
Identify iSCSI initiator name
A unique iSCSI initiator name is generated during the installation process. On Linux, it is located in the /etc/iscsi/initiatorname.iscsi
file. This name is used to identify the host on the IP SAN.
[root@host1 /]# cat /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.1992-05.com.redhat:497bd66ca0
Create new initiator group
An initiator group (igroup) is part of the ONTAP LUN masking architecture. A newly created LUN is not accessible unless a host is first granted access. This step is accomplished by creating an igroup that lists either the FC WWNs or iSCSI initiator names that require access.
In this example, an igroup is created that contains the iSCSI initiator of the Linux host.
Cluster01::*> igroup create -igroup linuxiscsi -protocol iscsi -ostype linux -initiator iqn.1994-05.com.redhat:497bd66ca0
Shut down environment
Before changing the LUN protocol, the LUNs must be fully quiesced. Any database on one of the LUNs being converted must be shut down, file systems must be dismounted, and volume groups must be deactivated. Where ASM is used, make sure that the ASM disk group is dismounted and shut down all grid services.
Unmap LUNs from FC network
After the LUNs are fully quiesced, remove the mappings from the original FC igroup.
Cluster01::*> lun unmap -vserver vserver1 -path /vol/new_asm/LUN0 -igroup linuxhost Cluster01::*> lun unmap -vserver vserver1 -path /vol/new_asm/LUN1 -igroup linuxhost ... Cluster01::*> lun unmap -vserver vserver1 -path /vol/new_lvm/LUN8 -igroup linuxhost Cluster01::*> lun unmap -vserver vserver1 -path /vol/new_lvm/LUN9 -igroup linuxhost
Remap LUNs to IP network
Grant access to each LUN to the new iSCSI-based initiator group.
Cluster01::*> lun map -vserver vserver1 -path /vol/new_asm/LUN0 -igroup linuxiscsi Cluster01::*> lun map -vserver vserver1 -path /vol/new_asm/LUN1 -igroup linuxiscsi ... Cluster01::*> lun map -vserver vserver1 -path /vol/new_lvm/LUN8 -igroup linuxiscsi Cluster01::*> lun map -vserver vserver1 -path /vol/new_lvm/LUN9 -igroup linuxiscsi Cluster01::*>
Discover iSCSI targets
There are two phases to iSCSI discovery. The first is to discover the targets, which is not the same as discovering a LUN. The iscsiadm
command shown below probes the portal group specified by the -p argument
and stores a list of all IP addresses and ports that offer iSCSI services. In this case, there are four IP addresses that have iSCSI services on the default port 3260.
This command can take several minutes to complete if any of the target IP addresses cannot be reached. |
[root@host1 ~]# iscsiadm -m discovery -t st -p fas8060-iscsi-public1 10.63.147.197:3260,1033 iqn.1992-08.com.netapp:sn.807615e9ef6111e5a5ae90e2ba5b9464:vs.3 10.63.147.198:3260,1034 iqn.1992-08.com.netapp:sn.807615e9ef6111e5a5ae90e2ba5b9464:vs.3 172.20.108.203:3260,1030 iqn.1992-08.com.netapp:sn.807615e9ef6111e5a5ae90e2ba5b9464:vs.3 172.20.108.202:3260,1029 iqn.1992-08.com.netapp:sn.807615e9ef6111e5a5ae90e2ba5b9464:vs.3
Discover iSCSI LUNs
After the iSCSI targets are discovered, restart the iSCSI service to discover the available iSCSI LUNs and build associated devices such as multipath or ASMlib devices.
[root@host1 ~]# service iscsi restart Redirecting to /bin/systemctl restart iscsi.service
Restart environment
Restart the environment by reactivating volume groups, remounting file systems, restarting RAC services, and so on. As a precaution, NetApp recommends that you reboot the server after the conversion process is complete to be certain that all configuration files are correct and all stale devices are removed.
Caution: Before restarting a host, make sure that all entries in /etc/fstab
that reference migrated SAN resources are commented out. If this step is not taken and there are problems with LUN access, the result can be an OS that does not boot. This issue does not damage data. However, it can be very inconvenient to boot into rescue mode or a similar mode and correct /etc/fstab
so that the OS can be booted to allow troubleshooting efforts to begin.