Are u using the iscsi LUN or FC LUN, in case of FC u can use WWN number & in case of iscsi u can use iqn name. Both remains constant for a LUN.
Did you not make a consistent naming scheme between the Target name and the name in vSphere? Go to your Host, click Storage Views, then Maps at the top, check Virtual Machine and SCSI Target on the right, and click update view. That should show you VM to SCSI Target. Hope this helps.
Can u guide me how to get the WWN number or IQN name of the LUN using vi java. Also are these numbers unique even if i have multiple storage devices each having multiple LUNs? Can we somehow use UUID of the LUN to associate it with either the VM or datastore?