The SCSI ID number is assigned…get this…alphabetically! Why, oh why!?!

Think this is silly? (I do), but it gets worse.. It is enumerated alphabetically by the full path name! GASP!

E.g.

cat /etc/tgt/targets.conf

:.target1>

/dev/mapper/mpathb = “IET 00010001″ #this is lun1

/dev/mapper/mpathc = “IET 00010002″ #this is lun2

Ok fine, not that bad. At least above makes some sense, but try this on for size:

E.g.

cat /etc/tgt/targets.conf

:.target1>

backingstore /dev/mapper/mpathb #”IET 00010002″ #this is now lun2

backingstore /dev/mapper/mpathc # “IET 00010003″ #this is now lun3

backingstore /animagefile # = “IET 00010001″ #this is lun1

Lets paint the scenario. An admin creates the mpathb and mpathc LUNs a few years ago. All is well. Admin comes to add a LUN called animagefile to the configuration and finds that the LUN numbers have changed. If your connecting hosts are VMware, kabooom!. All LUNs are now unmountable, because VMware (ESX 4.1 in my case) treats them as a snapshot volume, or simply cannot unmount/mount the filesystem, because it already thinks it is mounted.