Operating System - HP-UX
1834149 Members
2852 Online
110064 Solutions
New Discussion

Re: HW Path translated to LUN

 
SOLVED
Go to solution
Juan M Leon
Trusted Contributor

HW Path translated to LUN

Hi everyone, can somebody help me to understand how to get the LUN number of a specific hardware path. Bellow is the output of my FCP devices, also I attached a partial output of the VA conf information (WWN / LUN / Access).


fcmsutil /dev/td0
N_Port Node World Wide Name = 0x50060b000021ee17
N_Port Port World Wide Name = 0x50060b000021ee16
Hardware Path is = 0/4/0/0
fcmsutil /dev/td1
N_Port Node World Wide Name = 0x50060b000021e5bb
N_Port Port World Wide Name = 0x50060b000021e5ba
Hardware Path is = 0/4/2/0

Checking WWN 50060b000021ee16
WWN LUN Access
:NODEWWN 50060b000021ee16 6 WC
:NODEWWN 50060b000021ee16 65 WC
:NODEWWN 50060b000021ee16 29 W
:NODEWWN 50060b000021ee16 40 W
:NODEWWN 50060b000021ee16 37 WC
:NODEWWN 50060b000021ee16 40 WC
:NODEWWN 50060b000021ee16 11 W
:NODEWWN 50060b000021ee16 13 W
Press Enter to continue
Checking WWN 50060b000021e5ba
:NODEWWN 50060b000021e5ba 6 WC
:NODEWWN 50060b000021e5ba 65 WC
:NODEWWN 50060b000021e5ba 29 W
:NODEWWN 50060b000021e5ba 40 W
:NODEWWN 50060b000021e5ba 37 WC
:NODEWWN 50060b000021e5ba 40 WC
:NODEWWN 50060b000021e5ba 11 W
:NODEWWN 50060b000021e5ba 13 W
Press Enter to continue


# ioscan -funH 0/4/2/0.6.18.0.0.1.3
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
disk 21 0/4/2/0.6.18.0.0.1.3 sdisk CLAIMED DEVICE HP A6218A
/dev/dsk/c10t1d3 /dev/rdsk/c10t1d3
# bc
3+8*1+0*128
11
quit
# ioscan -funH 0/4/0/0.5.18.0.0.1.3
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
disk 19 0/4/0/0.5.18.0.0.1.3 sdisk CLAIMED DEVICE HP A6218A

I believe the LUN number in the array is 11. I read some information here but I am not sure. Can somebody help me to understand the translation

:NODEWWN 50060b000021ee16 11 W
:NODEWWN 50060b000021e5ba 11 W
4 REPLIES 4
James A. Donovan
Honored Contributor
Solution

Re: HW Path translated to LUN

You've got it right. You can always divide the LUN number on this array by 8 to give you the target value, "t" and the remainder will be the scsi disk ID, "d"

LUN 11 --> c10 t1 d3

11/8 = 1 with a remainder of 3

similarly, LUN 12 --> t1d4
LUN 16 --> t2d0

and so on, and so forth....

The target and scsi ID will always be reflected in the last 2 digits of the hardware path, as you see from "0/4/0/0.5.18.0.0.1.3"

For more info on interpreting hardware paths see this: http://docs.hp.com/en/AB378-96001/ch01s12.html
Remember, wherever you go, there you are...
Nguyen Anh Tien
Honored Contributor

Re: HW Path translated to LUN

Of coure! c10t1d3 is LUN11
This is:
t0dx: x=1->8 (only address LUN1-LUN8)
If LUN number>8. it must use t1 (not t1)
then 11-8=3 so it named this LUN as c10t1d3
Below are abtract from HP-UX CSE book
We can now talk about the address of the actual disks themselves. HP-UX hardware paths follow the SCSI-2 standard for addressing, so we use the idea of a target and SCSI logical unit number (LUN). The LUN number we see in Figure 4-1 is the LUN number assigned by the disk array. This is a common concept for disk arrays. HP-UX has to translate the LUN address assigned by the disk array into a SCSI address. If we look at the components of a SCSI address, we can start to try to work out how to convert a LUN number into a SCSI address:

Target: 4-bit address means valid values = 0 through 15

LUN: 3-bit address means valid values = 0 through 7

If we take an example of a LUN number of 2010, there's a simple(ish) formula for calculating the SCSI target and LUN address. Here's the formula:

Ensure that the LUN number is represented in decimal; an HP XP disk array uses hexadecimal LUN numbers while an HP VA disk array uses decimal LUN numbers.

Divide the LUN number by 8. This gives us the SCSI target address.

The remainder gives us the SCSI LUN.

For our simple example of a LUN=20:

LUN(on disk array) = 2010.

Divide 20 by 8 â ¦ SCSI target = 2.

Remainder = 4 â ¦ SCSI LUN = 4.

SCSI address = 2.4.

HTH
tienna
HP is simple
Senthil Kumar .A_1
Honored Contributor

Re: HW Path translated to LUN

Hi Juan,

I will explain as per the follwoing example..

disk 1623 0/0/1/1/0/4/0.2.4.0.0.15.7 sdisk CLAIMED DEVICE HP OPEN-E
/dev/dsk/c2t15d7 /dev/rdsk/c2t15d7
disk 239 0/0/1/1/0/4/0.2.4.0.1.0.0 sdisk CLAIMED DEVICE HP OPEN-E
/dev/dsk/c29t0d0 /dev/rdsk/c29t0d0

If you notice, the Calculation of the LUN number is done with the last 3 decimal digits in the H/W path. You have indeed used the correct formula to compute the LUN number. Ex: 0/0/1/1/0/4/0.2.4.0.0.15.7 whould yield me..

0*128 + 15*8 + 7 = 127

That is, LUN number 127.

Please do not lay empashis on the device file. In cXtYdZ, only "Y" and "Z" has a direct one to one relation with the number you see in H/W path. See the ioscan example above. The "X" part is related to the instance number of the "ext_bus" class, that might even be just a "virtual bus" addressing employed in Logical unit addressing scheme in FC protocol.

In my example you can see... c2 and c29, is just the "ext_bus" instance number assigned to it by the kernel in the probing order.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Pat Obrien_1
Regular Advisor

Re: HW Path translated to LUN

I wrote this up in device files awahile ago.
2) Utilizing the Demo test environment, 2 addition luns were created and presented to the host with Lun idâ s 30 and 137. Again each was preferred to opposite controllers. Performing an ioscan and then an insf â e, we now see these devices per the following:

disk 37 0/0/8/1/0.6.170.0.0.3.6 sdisk /dev/dsk/c32t3d6
disk 43 0/0/8/1/0.6.171.0.0.3.6 sdisk /dev/dsk/c33t3d6
disk 38 0/0/8/1/0.6.187.0.0.3.6 sdisk /dev/dsk/c40t3d6
disk 40 0/0/8/1/1.6.168.0.0.3.6 sdisk /dev/dsk/c36t3d6
disk 44 0/0/8/1/1.6.169.0.0.3.6 sdisk /dev/dsk/c37t3d6
disk 39 0/0/8/1/1.6.184.0.0.3.6 sdisk /dev/dsk/c38t3d6
disk 41 0/0/8/1/1.6.185.0.0.3.6 sdisk /dev/dsk/c39t3d6
disk 36 0/0/8/1/0.6.186.0.0.3.6 sdisk /dev/dsk/c35t3d6
The lun specific information 0.0.3.6 is translated for this lun with lun id 30 as follows:
The number 3 is multiplied times 8 and 6 is added to the result resulting in the lun id 30.
disk 30 0/0/8/1/0.6.170.0.1.1.1 sdisk /dev/dsk/c42t1d1
disk 42 0/0/8/1/0.6.171.0.1.1.1 sdisk /dev/dsk/c43t1d1
disk 33 0/0/8/1/1.6.184.0.1.1.1 sdisk /dev/dsk/c48t1d1
disk 29 0/0/8/1/0.6.186.0.1.1.1 sdisk /dev/dsk/c44t1d1
disk 32 0/0/8/1/0.6.187.0.1.1.1 sdisk /dev/dsk/c45t1d1
disk 35 0/0/8/1/1.6.168.0.1.1.1 sdisk /dev/dsk/c46t1d1
disk 31 0/0/8/1/1.6.169.0.1.1.1 sdisk /dev/dsk/c47t1d1
disk 34 0/0/8/1/1.6.185.0.1.1.1 sdisk /dev/dsk/c49t1d1
The lun specific information 0.1.1.1 is translated for this lun with lun id 137 as follows:
The lead number 1 is multiplied times 128 which is then added to result of the middle 1 multiplied times 8 and this result is added to right most 1 resulting in the lun id 137.
For comparison, this is the HPUX device file assignments for a Eva5K:
disk 4 255/255/0/0.0 sdisk /dev/dsk/c33t0d0
disk 5 255/255/0/0.1 sdisk /dev/dsk/c33t0d1
disk 3 255/255/1/0.0 sdisk /dev/dsk/c28t0d0

--The HPUX native device files and hardware paths are different for the Eva8k than for the Eva5K. The Eva5K must use a drive known as a pseudo driver.
--When the presented lun id is greater that 128, the SCSI bus number in the device file is incremented to designate this as seen on lun id 137 where the scsi bus number is c42 instead of the c32 on lun id 30 even though this is the same path.
--Another item of note is that these last 2 luns added to the system did not get assigned c32t0d3 and c32t0d4 as the Eva5K would have assigned. This randomness seems to have been removed.