ESX: san attached storage

 

Method 1: parse /proc info

this should be the best way to find out how many LUNs are seen by the esx server

 

cat /proc/scsi | egrep "Host:|Vendor:"

 

Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: IBM Model: 2810XIV-LUN-0 Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 01
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 02
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 03
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 04
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 05
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 06
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 07
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 08
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 09
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 10
Vendor: IBM Model: 2810XIV Rev: 10.1
Host: scsi3 Channel: 00 Id: 00 Lun: 11
Vendor: IBM Model: 2810XIV Rev: 10.1 <...snip...>

 

cat /proc/scsi/sg/devices

 

3       0       0       0       12      0       1       0       1
3       0       0       1       0       0       1       0       1
3       0       0       2       0       0       1       0       1
3       0       0       3       0       0       1       0       1
3       0       0       4       0       0       1       0       1
3       0       0       5       0       0       1       0       1
3       0       0       6       0       0       1       0       1
3       0       0       7       0       0       1       0       1
3       0       0       8       0       0       1       0       1
3       0       0       9       0       0       1       0       1
3       0       0       10      0       0       1       0       1
3       0       0       11      0       0       1       0       1
3       0       0       12      0       0       1       0       1
3       0       0       13      0       0       1       0       1
3       0       0       14      0       0       1       0       1
3       0       0       15      0       0       1       0       1
3       0       0       16      0       0       1       0       1
3       0       0       17      0       0       1       0       1
<...snip...>

Method 2: grep "Target WWPN" from esxcfg-info"

this should show the total number of devices seen (plus one more) from each array storage port. look below at the last 4 storage port PWWNs - this is a Clariion - the 4th octet contains the storage port designator. the count for those 4 storage ports is 10 (first column). This means that this server sees 9 LUNs presented from 4 storage ports. Similarly, the other two arrays are presenting 73 LUNs and 15 LUNs.

 

esxcfg-info | grep "Target WWPN"| awk -F"." '{print $29}' | sort | uniq –c

 

     74 50:01:73:80:00:d9:01:50

     74 50:01:73:80:00:d9:01:61

     74 50:01:73:80:00:d9:01:71

     74 50:01:73:80:00:d9:01:80

     16 50:01:73:80:05:bd:01:40

     16 50:01:73:80:05:bd:01:60

     16 50:01:73:80:05:bd:01:70

     16 50:01:73:80:05:bd:01:90

     10 50:06:01:62:39:a0:40:10

     10 50:06:01:63:39:a0:40:10

     10 50:06:01:6a:39:a0:40:10

     10 50:06:01:6b:39:a0:40:10

 

Method 3: list / count unique occurrences of "singledevice" in messages file

again, this should show the total number of devices seen by the esx server.

 

$ cat messages | grep singledevice | awk '{print $8 $9, $10, $11}' | sort -n | wc -l

$ cat messages | grep singledevice | awk '{print $8 $9, $10, $11}' | sort -n | uniq

 

searching for singledevice (an instance of each LUN) you will see that there are 97 LUNs (73 + 15 + 9 from above) the 3rd column shows the array instance - 0, 1, or 2 - corresponding to my 3 storage arrays; the 4th column, a unique instance of a LUN on each array

 

*storage array 1*

3 0 0 1
3 0 0 2
3 0 0 3
3 0 0 4
3 0 0 5
3 0 0 6
3 0 0 7
3 0 0 8
3 0 0 9
3 0 0 10
3 0 0 11
3 0 0 12
3 0 0 13
3 0 0 14
3 0 0 15
3 0 0 16
3 0 0 17
3 0 0 18
3 0 0 19
3 0 0 20
3 0 0 21
3 0 0 22
3 0 0 23
3 0 0 24
3 0 0 25
3 0 0 26
3 0 0 27
3 0 0 28
3 0 0 29
3 0 0 30
3 0 0 31
3 0 0 32
3 0 0 33
3 0 0 34
3 0 0 35
3 0 0 36
3 0 0 37
3 0 0 38
3 0 0 39
3 0 0 40
3 0 0 41
3 0 0 42
3 0 0 43
3 0 0 44
3 0 0 45
3 0 0 46
3 0 0 47
3 0 0 48
3 0 0 49
3 0 0 50
3 0 0 51
3 0 0 52
3 0 0 53
3 0 0 54
3 0 0 55
3 0 0 56
3 0 0 57
3 0 0 58
3 0 0 59
3 0 0 60
3 0 0 61
3 0 0 62
3 0 0 63
3 0 0 64
3 0 0 65
3 0 0 66
3 0 0 67
3 0 0 68
3 0 0 69
3 0 0 70
3 0 0 71
3 0 0 72
3 0 0 73

*storage array 2*

3 0 1 0
3 0 1 1
3 0 1 2
3 0 1 3
3 0 1 4
3 0 1 5
3 0 1 6
3 0 1 7
3 0 1 8

*storage array 3*

3 0 2 1
3 0 2 2
3 0 2 3
3 0 2 4
3 0 2 5
3 0 2 6
3 0 2 7
3 0 2 8
3 0 2 9
3 0 2 10
3 0 2 11
3 0 2 12
3 0 2 13
3 0 2 14

3 0 2 15

 

There are a few basic questions that need to be answered:

  • how many servers are in the cluster?
  • do all the servers see (or not see) the LUNs in question?
  • how many LUNs do the servers see?