VMware {code} Community
Ashwin89
Contributor
Contributor

UUID issue with esx inventory

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

0 Kudos
2 Replies
lamw
Community Manager
Community Manager

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:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
stumpr
Virtuoso
Virtuoso

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

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos