Labeling LUNs more easily
07 Dec 2023
In a recent post about expanding a volume, we covered a slow but sure way of making that LUNs are labeled so that we know which LUN in our volume config corresponds to which LUN in our RAID config. Bringing them on one by one definitely works, but takes time and many MDC restarts. While I was working on that, my coworker found a better way. For both Infortrend and Promise storage the cvlabel serial number is determined by the hardware. There may be similar methods for other vendors, but for example, I can’t find it for the NetApp storage a customer has.
For Infortrend storage, the serial number ends with the Volume ID found in each of the Volume Details of the Volume panel. The first part of the serial comes from the end of the WWPN of the controllers, available in Settings -> Access -> <a fibre channel>. For example from cvlabel
Prod_Data19 /dev/rdisk23 62749439967 EFI 0 # host 2 lun 0 sectors 62749439967 sector_size 512 inquiry [IFT GS 3000 Series 165G] serial 0D6CF86B159C7615A85DEA
The first part of the serial
0D6CF8 comes from the fibre ports which are of the form
210600D0230D6CF8. Then the rest of the serial comes from the Volume ID
Volume ID 6B159C7615A85DEA.
For Promise RAIDs, this is even easier. The serial number given by cvlabel is the logical drive serial number in the RAID web interface (Storage -> Logical Drive -> select one -> View). So
metadata /dev/rdisk20 7499980767 EFI 0 # host 2 lun 0 sectors 7499980767 sector_size 512 inquiry [Promise VTrak EFA5310f 1107] serial 49534520000000000000000000AAAB380B5CB65E
is directly from
Serial No 4953452000000000000000000AAAB380B5CB65E.
So now we can connect all the new LUNs at once and label them based on the raid config. i.e. for each LUN, find it in the RAID interface and search the untitled LUNs for the serial that matches and give it a name. Remove any previously labeled LUNs from the file (just to make the tool not ask about each one) and run
sudo cvlabel ~/Desktop/labels.txt to apply them all at once.