标题: Lun id, scsi id, device id, unit serial number之间的关系 [打印本页] 作者: xiegang112 时间: 2009-01-19 16:23 标题: Lun id, scsi id, device id, unit serial number之间的关系 哪位兄弟能解释一下Lun id, scsi id, device id, unit serial number之间的关系?
谢谢作者: cncqpansky 时间: 2009-01-19 23:54
A device ID is a vendor-defined identification string that is the most specific ID that Setup uses to match a device to an INF file. A device has only one device ID. A device ID has the same format as a hardware ID. If an enumerator reports a list of hardware IDs for a device, the device ID should be the first hardware ID in the list.作者: cncqpansky 时间: 2009-01-19 23:56
SCSI ID numbers identify devices on the SCSI chain.
SCSI ID 7 is usually special because the Apple SCSI and Hi-Speed SCSI
cards count as a device set to ID 7 by default (and every Macintosh has a hard-
wired SCSI ID of 7).作者: cncqpansky 时间: 2009-01-19 23:58
LUN ID指的是划分给主机端操作系统的磁盘空间实体的识别ID作者: cncqpansky 时间: 2009-01-20 00:01
Unit Serial Number应该是指的是你的整个磁柜笼子的产品序列号...(这个我不确定是否正确, 等论坛的大虾们指正)
不知道这样明白没有, 一个UNIT SERIAL NUMBER笼子里面的不同device id的磁盘划分出不同的LUN (ID)通过SCSI设备的ID号码被主机识别
另外,之所以提到unit serial number。是因为scsi_id程序在查询device identifier不成功时,可能会返回unit serial number。通过unit serial number 来标示一个lun。而多路径软件,比如redhat的device mapper multipath tool会利用外部程序(一般是scsi_id程序),来获得lun的标识符。以此来实现路径的聚合。如果说unit serial number是一个closure的序列号。那么它又怎么标示一个lun呢? 并且在sam-3中提到This page (unit serial number) provides a product serial number for the target or logical unit.这句话该怎么理解呢?
谢谢
Manufacturer................HITACHI
Machine Type and Model......DF600F
Part Number.................
ROS Level and ID............30303030
Serial Number...............77011805
EC Level....................
FRU Number..................
Device Specific.(Z0)........00000312B3001102
Device Specific.(Z1)........0048
Device Specific.(Z2).........
Device Specific.(Z3).........
Device Specific.(Z4).........l..
Device Specific.(Z5)........
Device Specific.(Z6)........
发现U787B.001.DNWG61D-P1-C1-T2-W50060E801002E1D7-L0中最后的L0和map后的lun id对应。而Device Specific.(Z1)........0048中的048和lun的实际id对应。不知道这些id分别从scsi的那个命令来的。
[ 本帖最后由 xiegang112 于 2009-1-20 15:35 编辑 ]作者: xiegang112 时间: 2009-01-20 15:56 标题: 回复 #8 deadwind 的帖子 感觉上有点类似ip与mac的关系,但是不太确定。因为在iscsitarget程序中,scsi id和scsi serial number是可以自己指定的。现在还不明白它们之间的关系。这儿是否存在一种寻址关系还不确定。iscsitarget配置文件中配置的scsi id,实际上就是scsi inquery命令中的device identifier。不知道它和我们通常所说的,用于scsi 寻址的scsi id有什么联系。因为在直连的scsi 总线设备中,scsi id由连接顺序确定,它决定了选择阶段哪个设备被选择,感觉上有个寻址的作用。但device identifier视乎没有这个作用,这个已经是scsi 命令阶段的内容了。但是很多文档,把device idenfier叫做scsi id。比如在一篇scsi overview的文档上就是这样定义scsi identifier的:
SCSI Identifier represents either an initiator port or a target port identifier. Also
called device identifier and port identifier. Note that other standards define the value
of SCSI identifiers. For example, SPI-2 defines target identifiers to be in the range
0-7, 0-15, and 0-31.
这个定义明显和sam-3的中的device identifier的定义不符。所以现在很困惑,希望兄弟们指点一下。
谢谢作者: 冬瓜头 时间: 2009-01-21 11:28
那位大侠给的回复如下:
回答: raid 这一端如何实现lun mapping, host才不会管,对host来说一个lun 就是一个disk device. 这个lun 他有一个serial number, 而且是world wide unique的。这就是标示。但是由于lun serial number是在vpd page 80h获取的,而且根据scsi标准,vpd page 80h是optional的,不一定会有。所以一般是找device id的信息,因为device id是在vpd page 83h里的,而且是mandatory的。在实际上,vpd page 80h的实现已经成为事实上的业界比标准。所以device id + serial number成为一个混合标示。
另外,vpd page 80h里的logical Unit serial number 指的就是lun 的serial number, 不是enclosure的serial number. Logical unit 才是 真正对的叫法,但是被无数人误叫成LUN. LUN是LU’s number.
2.针对上面的例子,我所提到那些概念,比如device identifier,unit serial numbers是什么时候产生的?各自所属的对象是什么。
回答: LU serial number 是在lun 在raid里被生成的时候创建的,不管有没有被map。 就算是没有map,这个lun 也有serial number.
Device id 的话,有点复杂。虽然说vpd page 83h是强制的,但是里面有许多designator是可以有vendor 决定是否实现的,而且每个designator的内容和赋值没有硬性规定,比如designator logical unit names, 你也可以把serial number的值赋给logical unit name,也可以另外再搞一个。另外还有别的信息如relative port, port group等等, raid 可以通过这个报告这个lun是通过那个raid上的host port map到server 端的。这些东西是否实现和如何实现(和硬件有关),要有原厂的scsi external spec, 否则你无法知道他的数据的意思。更何况vpd page 83h里还有vendor自己可以定义的designator.