What unique identifier we should use to identify each virtual machine. Even two VM's can have same UUID the same esx server or in a virtual center.
-AsHWin
I would recommending using either the managed object reference ID or using the instanceUuid which is suppose to be a unique uuid for a given vCenter instance. afaik, this value should be unique*. The MoRef ID will definitely be unique, but it may change depending on the operations you perform, so I would maybe keep a hash table mapping of the VM's displayName + MoRef ID as one way to uniquely identify a VM or use the instanceUuid
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
vSphere 4.0 added the instanceUuid.
InstanceUuid
VirtualCenter-specific 128-bit UUID of a virtual machine, represented as a hexademical string. This identifier is used by VirtualCenter to uniquely identify all virtual machine instances, including those that may share the same SMBIOS UUID.
Since vSphere API 4.0