VMware Cloud Community
anshumanmathur
Contributor
Contributor

How can i identify the LUN on which the VM is present?

I want to develop an appplication to take snapshot of the LUN on which  a particular VM is present. How can i identify the LUN. i am using vi java api.

I have tried doing this by matching the canonical name of the scsi luns listed with the host an the datastore of the VM but canonical names are not unique and hence i can't be 100% sure if thats the correct lun.

Please help.

Reply
0 Kudos
3 Replies
Cooldude09
Commander
Commander

Hi,

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.

If U find my answer useful, feel free to give points by clicking Helpful or Correct.

Subscribe yourself at walkonblock.com

Reply
0 Kudos
ProPenguin
Hot Shot
Hot Shot

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.

Reply
0 Kudos
anshumanmathur
Contributor
Contributor

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?

Reply
0 Kudos