您的位置:首页 > 其它

在vmware虚机上用iscsi协议建立多路径环境测试multipath (5)

2017-04-09 19:09 316 查看

Linux multipath与SCSI ID

Scsi_id命令包含在udev程序包中,可以在multipath.conf中配置该程序来获取scsi设备的SCSI ID。通过SCSI ID,便可以判断多个路径对应了同一设备。这个是多路径实现的关键。scsi_id是通过sg驱动,向设备发送EVPD page80或page83 的inquery命令来查询scsi设备的标识。但一些设备并不支持EVPD 的inquery命令,所以他们无法被用来生成multipath设备。如果这样,据说可以手工改写scsi_id,为不能提供scsi设备标识的设备虚拟一个标识符,并输出到标准输出,但是改写SCSI ID的方法不详。
multipath程序在创建multipath设备时,会调用scsi_id,从其标准输出中获得该设备的scsi id。

1. 几个查看SCSI设备详细信息的命令

l cat /proc/scsi/scsi
[root@centos-i2lb]# cat /proc/scsi/scsiAttacheddevices:Host: scsi1Channel: 00 Id: 00 Lun: 00 Vendor: NECVMWar Model: VMware IDE CDR10 Rev:1.00 Type: CD-ROM ANSI SCSI revision: 05Host: scsi2Channel: 00 Id: 00 Lun: 00 Vendor: VMware, Model: VMware Virtual S Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02Host: scsi6Channel: 00 Id: 00 Lun: 00 Vendor: IET Model: Controller Rev: 0001 Type: RAID ANSI SCSI revision: 05Host: scsi5Channel: 00 Id: 00 Lun: 00 Vendor: IET Model: Controller Rev: 0001 Type: RAID ANSI SCSI revision: 05Host: scsi5Channel: 00 Id: 00 Lun: 01 Vendor: lb Model: lb_iscsi Rev: 01 Type: Direct-Access ANSI SCSI revision: 05Host: scsi6Channel: 00 Id: 00 Lun: 01 Vendor: lb Model: lb_iscsi Rev: 01 Type: Direct-Access ANSI SCSI revision: 05Lsscsi工具(需要安装)

[root@centos-i2lb]# lsscsi -v [1:0:0:0] cd/dvd NECVMWar VMware IDE CDR10 1.00 /dev/sr0 dir: /sys/bus/scsi/devices/1:0:0:0 [/sys/devices/pci0000:00/0000:00:07.1/host1/target1:0:0/1:0:0:0][2:0:0:0] disk VMware, VMware Virtual S 1.0 /dev/sda dir: /sys/bus/scsi/devices/2:0:0:0 [/sys/devices/pci0000:00/0000:00:10.0/host2/target2:0:0/2:0:0:0][5:0:0:0] storage IET Controller 0001 - dir: /sys/bus/scsi/devices/5:0:0:0 [/sys/devices/platform/host5/session3/target5:0:0/5:0:0:0][5:0:0:1] disk lb lb_iscsi 01 /dev/sdb dir: /sys/bus/scsi/devices/5:0:0:1 [/sys/devices/platform/host5/session3/target5:0:0/5:0:0:1][6:0:0:0] storage IET Controller 0001 - dir: /sys/bus/scsi/devices/6:0:0:0 [/sys/devices/platform/host6/session4/target6:0:0/6:0:0:0][6:0:0:1] disk lb lb_iscsi 01 /dev/sdc dir: /sys/bus/scsi/devices/6:0:0:1 [/sys/devices/platform/host6/session4/target6:0:0/6:0:0:1] l ls –rtl /dev/disk/by-id
[root@centos-i2lb]# ls -rtl /dev/disk/by-idtotal 0lrwxrwxrwx. 1root root 9 Apr 7 13:16ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001 -> ../../sr0lrwxrwxrwx. 1root root 10 Apr 7 13:16lvm-pv-uuid-K3FudW-pVbU-3CxO-vYbz-JQgt-7cMD-trWZfc -> ../../sda2lrwxrwxrwx. 1root root 10 Apr 7 13:16dm-uuid-LVM-6OQeAXlfx14VazFp21YfwgbtSE3P0IH1BMNhZdogpE93EoKvCxT3KZcCAqVmjG6M-> ../../dm-1lrwxrwxrwx. 1root root 10 Apr 7 13:16dm-name-vg_centosi2-lv_swap -> ../../dm-1lrwxrwxrwx. 1root root 10 Apr 7 13:16dm-uuid-LVM-6OQeAXlfx14VazFp21YfwgbtSE3P0IH129JpYlBs33F2gS64l2eNyeeIasmtvu2O-> ../../dm-0lrwxrwxrwx. 1root root 10 Apr 7 13:16dm-name-vg_centosi2-lv_root -> ../../dm-0lrwxrwxrwx. 1root root 9 Apr 7 13:28 scsi-1IET_00010001 -> ../../sdblrwxrwxrwx. 1root root 10 Apr 7 13:28dm-uuid-mpath-1IET\x20\x20\x20\x20\x2000010001 -> ../../dm-2lrwxrwxrwx. 1root root 10 Apr 7 13:28 dm-name-yellow-> ../../dm-2lrwxrwxrwx. 1root root 10 Apr 7 13:28dm-uuid-part1-mpath-1IET\x20\x20\x20\x20\x2000010001 -> ../../dm-3lrwxrwxrwx. 1root root 10 Apr 7 13:28dm-name-yellowp1 -> ../../dm-3ls –rtl /dev/disk/by-id

[root@centos-i2lb]# ls -rtl /dev/disk/by-pathtotal 0lrwxrwxrwx. 1root root 9 Apr 7 13:16 pci-0000:00:10.0-scsi-0:0:0:0 ->../../sdalrwxrwxrwx. 1root root 9 Apr 7 13:16 pci-0000:00:07.1-scsi-1:0:0:0 ->../../sr0lrwxrwxrwx. 1root root 10 Apr 7 13:16pci-0000:00:10.0-scsi-0:0:0:0-part2 -> ../../sda2lrwxrwxrwx. 1root root 10 Apr 7 13:16pci-0000:00:10.0-scsi-0:0:0:0-part1 -> ../../sda1lrwxrwxrwx. 1root root 9 Apr 7 13:28ip-192.168.136.101:3260-iscsi-iqn.2017-03.centos-i1:target1-lun-1 ->../../sdclrwxrwxrwx. 1root root 9 Apr 7 13:28ip-192.168.20.101:3260-iscsi-iqn.2017-03.centos-i1:target1-lun-1 ->../../sdb2. Linustorvalds关于使用scsiid的争论

http://yarchive.net/comp/linux/scsi_ids.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  iscsi multipath 多路径