我有一台服务器 2008r2 机器,上面有许多 san 卷。有没有办法(最好使用 powershell)快速列出所有 lun 编号?
答案1
假设您使用多路径 IO (MPIO) 来实现高可用性,那么您可以使用 mpclaim.exe 实用程序获取有关 LUN 的一些详细信息。可能还有另一种方法可以使用 WMI 或 HBA/SAN 提供商的软件来实现,但到目前为止,我发现的唯一通用解决方案是使用 mpclaim。即便如此,它也与其他平台上列出的略有不同。
例如,在 Linux 中,你可以使用类似多路径-ll获得这种类型的输出:
[root@localhost ~]# multipath -ll
mpathb (360A9800572D4F6761346536792D6C56) dm-2 NETAPP,LUN
size=150G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=4 status=active
| |- 0:0:1:1 sdg 8:96 active ready running
| `- 1:0:1:1 sdi 8:128 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
|- 0:0:0:1 sdc 8:32 active ready running
`- 1:0:0:1 sde 8:64 active ready running
mpatha (360A9800572D4F675034653679386A69) dm-1 NETAPP,LUN
size=150G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=4 status=active
| |- 0:0:0:0 sdb 8:16 active ready running
| `- 1:0:0:0 sdd 8:48 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
|- 0:0:1:0 sdf 8:80 active ready running
`- 1:0:1:0 sdh 8:112 active ready running
这显示 2 个 LUN,每个 LUN 通过 4 条路径连接。现在要在 Windows 中获取类似信息,您可以使用mpclaim-vc:\mpio.txt创建一个包含以下输出的文本文件:
MPIO Storage Snapshot on Friday, 31 August 2012, at 13:14:45.345
Registered DSMs: 1
================
+--------------------------------|-------------------|----|----|----|---|-----+
|DSM Name | Version |PRP | RC | RI |PVP| PVE |
|--------------------------------|-------------------|----|----|----|---|-----|
|Microsoft DSM |006.0001.07601.17514|0020|0003|0001|030|False|
+--------------------------------|-------------------|----|----|----|---|-----+
Microsoft DSM
=============
MPIO Disk1: 04 Paths, Round Robin, ALUA Not Supported
SN: 60A9800572D4F6761346536792D6C56
Supported Load Balance Policies: FOO RR RRWS LQD WP LB
Path ID State SCSI Address Weight
---------------------------------------------------------------------------
0000000077030001 Active/Optimized 003|000|001|001 0
Adapter: QLogic Fibre Channel Adapter... (B|D|F: 034|000|000)
Controller: 46616B65436F6E74726F6C6C6572 (State: Active)
0000000077030000 Active/Optimized 003|000|000|001 0
Adapter: QLogic Fibre Channel Adapter... (B|D|F: 034|000|000)
Controller: 46616B65436F6E74726F6C6C6572 (State: Active)
0000000077010001 Active/Optimized 001|000|001|001 0
Adapter: QLogic Fibre Channel Adapter... (B|D|F: 006|000|000)
Controller: 46616B65436F6E74726F6C6C6572 (State: Active)
0000000077010000 Active/Optimized 001|000|000|001 0
Adapter: QLogic Fibre Channel Adapter... (B|D|F: 006|000|000)
Controller: 46616B65436F6E74726F6C6C6572 (State: Active)
MPIO Disk0: 04 Paths, Round Robin, ALUA Not Supported
SN: 60A9800572D4F675034653679386A69
Supported Load Balance Policies: FOO RR RRWS LQD WP LB
Path ID State SCSI Address Weight
---------------------------------------------------------------------------
0000000077030001 Active/Optimized 003|000|001|000 0
Adapter: QLogic Fibre Channel Adapter... (B|D|F: 034|000|000)
Controller: 46616B65436F6E74726F6C6C6572 (State: Active)
0000000077030000 Active/Optimized 003|000|000|000 0
Adapter: QLogic Fibre Channel Adapter... (B|D|F: 034|000|000)
Controller: 46616B65436F6E74726F6C6C6572 (State: Active)
0000000077010001 Active/Optimized 001|000|001|000 0
Adapter: QLogic Fibre Channel Adapter... (B|D|F: 006|000|000)
Controller: 46616B65436F6E74726F6C6C6572 (State: Active)
0000000077010000 Active/Optimized 001|000|000|000 0
Adapter: QLogic Fibre Channel Adapter... (B|D|F: 006|000|000)
Controller: 46616B65436F6E74726F6C6C6572 (State: Active)
MSDSM-wide default load balance policy: N\A
No target-level default load balance policies have been set.
================================================================================
您会注意到,在 Linux 中,WWID 以 3 开头,但除此之外,SN 和 WWID 应该与 SAN 控制器上列出的一致。您可以使用以下命令获取 FC HBA 的其他详细信息fcinfo/详细信息或者存储资源管理器管理控制台。Server 2012 将添加新的MPIO cmdlet,但我还没有机会测试它们。