Monday, 16 December 2013

Adding new LUN from VNX on Linux - part1

Hi!
This is procedure for adding new LUN to Linux OS.
OS is SLES 11.1 x64, kernel is 2.6.32.54-0.3-default, new storage system is EMC VNX 7500, communication is with PowerPath version 5.5 (EMCpower.LINUX-5.5.0.00.00-275).

System already have attached LUN's from EMC Clarrion.

First thing to do is to display and save you powerpath settings.

#powermt display dev=all >state_1.txt

List your scsi devices from proc

 # cat /proc/scsi/scsi

Depending of how many paths you have to LUN, you will have that many scsi devices listed in this file. For example, this is for one LUN and this LUN have 4 paths.

Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: DGC      Model: RAID 5           Rev: 0430
  Type:   Direct-Access                    ANSI  SCSI revision: 04
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: DGC      Model: RAID 5           Rev: 0430
  Type:   Direct-Access                    ANSI  SCSI revision: 04
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: DGC      Model: RAID 5           Rev: 0430
  Type:   Direct-Access                    ANSI  SCSI revision: 04
Host: scsi1 Channel: 00 Id: 01 Lun: 00
  Vendor: DGC      Model: RAID 5           Rev: 0430
  Type:   Direct-Access                    ANSI  SCSI revision: 04


This is due to hardware architecture of your SAN network and how many FC cards do you have. In are case, we have 2 FC card Emulex A8002A. That is host attribute scsi0 for first FC and scsi1 for second FC. ID attribute is for storage FC cards. So ID 00 is for first storage FC card ID 01 is for second FC card. So you have 4 paths to single LUN. This is very good idea because you have double redundancy, redundancy of FC cards on server and redundancy od FC cards on storage system.
First you have to establish communication with your EMC VNX. This is called zoning. This means that you have to connect storage with server thru storage switch. Network admin do this. After this is you may need to restart your unihost agent. Do this in case that your storage admin tell you that he have warnings even dough he have communication with server.

#/etc/init.d/hostagent restart



This will not do any harm to your system and LUN's already attached.

After communication is established, your system will automatically recognise new storage system. Monitor your /var/log/messages for any changes. In your log you should see this.

kernel: scsi 1:0:2:0: Direct-Access     DGC      LUNZ             0532 PQ: 0 ANSI: 4
kernel: scsi 1:0:3:0: Direct-Access     DGC      LUNZ             0532 PQ: 0 ANSI: 4
kernel:  scsi 0:0:2:0: Direct-Access    DGC      LUNZ             0532 PQ: 0 ANSI: 4
kernel: scsi 0:0:3:0: Direct-Access     DGC      LUNZ             0532 PQ: 0 ANSI: 4

And in your /proc/scsi/scsi you should have new entry
Host: scsi1 Channel: 00 Id: 02 Lun: 00
  Vendor: DGC      Model: LUNZ             Rev: 0532
  Type:   Direct-Access                    ANSI  SCSI revision: 04
Host: scsi1 Channel: 00 Id: 03 Lun: 00
  Vendor: DGC      Model: LUNZ             Rev: 0532
  Type:   Direct-Access                    ANSI  SCSI revision: 04
Host: scsi0 Channel: 00 Id: 02 Lun: 00
  Vendor: DGC      Model: LUNZ             Rev: 0532
  Type:   Direct-Access                    ANSI  SCSI revision: 04
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: DGC      Model: LUNZ             Rev: 0532
  Type:   Direct-Access                    ANSI  SCSI revision: 04

LUNZ are not real LUN. they are just indication they you have communication with storage system. They are show only in first communication established with storage system and server.
If system don't automatically establish communication with storage you have to next procedure.

#echo 1 > /sys/class/fc_host/hostX/issue_lip 

where X is number of host adapter. This will restart FC interface buy doing link down and link up. Because of redundancy there will be no problems on accessing LUN that are connected through this FC card. When you are doing this step it s not a bad idea to wait a little bit before continue on another command. You can skip this step if your network admin has done link down and link up on FC link after done zoning. In messages you will see something like this

kernel: lpfc 0000:05:00.0: 0:1305 Link Down Event x4 received Data: x4 x20 x110 x0 x0
kernel: lpfc 0000:05:00.0: 0:1303 Link Up Event x5 received Data: x5 x0 x10 x0 x0 x0 0


When you finish with this on both FC cards it is time to rescan for new scsi devices.
Procedure is this:

#echo "- - -" >/sys/class/scsi_host/hostX/scan

where X is number of host adapter. You need to rescan only(but you can scan all of them) host adapter that are used for LUN. You can see what host adapters are used from several places:
-from /proc/scsi/scsi from info about already connected LUN
 from Id: 00 we know that we need to rescan host adapter 0
 from Id: 01 we know that we need to rescan host adapter 1
-from  /sys/class/scsi_disk/ where you can see attached scsi disk with their label

server:/sys/class/scsi_disk # ls
0:0:0:0
0:0:1:0
1:0:0:0
1:0:1:0

First number is representing number of host adapter (host0 and host1).
When you start rescanning for new scsi devices in your log should appear something like this
(for host1)
kernel: scsi 1:0:2:0: Direct-Access     DGC      LUNZ             0532 PQ: 0 ANSI: 4
kernel: scsi 1:0:3:0: Direct-Access     DGC      LUNZ             0532 PQ: 0 ANSI: 4


(for host0)
kernel: scsi 0:0:2:0: Direct-Access     DGC      LUNZ             0532 PQ: 0 ANSI: 4
kernel: scsi 0:0:3:0: Direct-Access     DGC      LUNZ             0532 PQ: 0 ANSI: 4


Now list /proc/scsi/scsi and new scsi devices(LUNZ) are there.
When you see all these LUNZ devices, you have connection with your storage system!!!












No comments: