The UUID is not available for all inventory objects. In this scenario, the hierarchical location of these entities becomes important.
You may use Managed Object ID (MoID) to uniquely identify the object. The MoID is unique for the object's lifetime in the inventory and not just for a single session. For example, when you create a resource pool, it gets its unique ID. Now, till the time you delete this resource pool from vCenter/ESX inventory, it will continue to hold the same MoID throughout the multiple sessions.
Hope this helps.
Oh!! so you mean "value" property of ManagedObjectReference for an inventory object will be unique for the whole lifetime of an object in a VCenter but it might differ if i directly connect to a ESX ?
1 person found this helpful
Yes, the value property of ManagedObjectReference (also known as managed object ID) for an inventory object will remain unique for object's lifetime in the vCenter inventory.
However, these IDs will not match in vCenter and ESX inventory for the same object. For example, if you look at the managed object ID of a datastore in ESX inventory, it will differ from the ID fetched through vCenter inventory for the same datastore under same ESX that is being managed by vCenter.