Tuesday 18 August 2015

Convert from EMC naa. in VMware VSphere to Device ID

This is a short how-to on converting the VMware VSphere device wwn (naa. number) to an EMC device ID.
Of course in real life one can always get this by using the symmetrix command line

symdev -sid 1234 list -all -wwn | grep wwn
If it is only few devices you want to work with, you can just copy and paste the naa number from Vsphere Client, where the number (naa) is a bit longer, as it contains additional information. e.g. 
vml.02000800006000097000019570421253303030424253594d4d4554


Convert from naa. to Dev id:
Take the last 8 digits of the naa number
e.g. for naa.60000970000292601174533030334435, numbers after 53 are 3030334435.
This will usually start with a 30.
Break it apart in pairs of two.
So 3030334435 becomes 30 30 33 44 35. The first "30" is discarded, so we'll take only 30 33 44 35
The Dev ID equivalence for the resultant pair of numbers is as follows:
30 = 0
31 = 1
32 = 2
33 = 3

34 = 4
35 = 5
36 = 6
37 = 7
38 = 8
39 = 9
40 = **** DOES NOT EXIST ****
41 = A
42 = B
43 = C

44 = D
45 = E
46 = F
…. Follows in that order

Just write that out and you’ll obtain the dev id.
So in the example, 30334435 becomes
30 = 0
33 = 3
44 = D
35 = 5
thus the EMC device ID for 30334435 is 03D5


No comments:

Post a Comment