Virtual machines - UUID or InstanceUUID
Historically, Unique ID's or serial numbers have been a challenge within VMware. The lack of Uniqueness limited the number of objects vCenter could manage and the inability to uniquely identify Virtual Machine utilization for asset control.
In the early days of version 3 Virtual Center, VMware virtual machines were unique identified by a managed object reference ID (called a MoREF). MoREF's were were limited to 99 instances and duplicates easily occured. vCenter 4.* came along and several changes were introduced. The Virtual Machine object history of unique identification was as follows
- Virtual Center 3
- MoREF's were expanded to 999, but that didn't sufficiently reduce duplicates or allow for more than 999 vm's per vCenter. - Virtual Center 4. *
UuID was introduced. When a VM is created, ESXi creates the 128-bit integer Uuid such as: 421b4187-bcb4-3dc1-e7d7-c9496d3fdca9 The UUID was how vCenter 4.* tracked a Virtual Machines. This failed however, because duplicates occur during VM copy or cloning. - vCenter 4.1 (if I recall correctly)
the PersistentID was introduced as a more Persistent identifier. - vCenter 5.* - PersistentID was changed to InstanceUuid. Therefore, the InstanceUuID is, as of vCenter and ESXi version 5.0, 5.1, and 5.5 is unique. Duplicates for UUID and MOREF may still occur due to replication, copy, or cloning processes.
The InstanceUuid, formerly known as PersistentID before it was deprecated, is best known method for unique identification of a virtual machine within a vCenter or a collection of vCenters.
The InstanceUuid is not visible through the vCenter Client, but it is visible through the vCenter API (SDK) or through PowerCLI.
Example
If connected to a vCenter or ESXi host through PowerCLI, here's a code snippet to view both the UuID and the PersistentID:
VM Example 2 - Virtual Machine List
This HTML LINK shows Virtual Machines with their InstanceUuid. The reports converts InstanceUuID to PersistentID for the support of legacy nomenclature:
Click column heading to SORT.
Name | PersistentID | Type | State |
---|---|---|---|
abbott | 5027322a-5e15-5a98-4c59-2927e9f9611c | VM | poweredOn |
acmeascpoc01 | 5027ded7-b8fa-8c39-f279-a258fb183992 | VM | poweredOn |
ESXi Physical Servers
VMware's ability to obtain Serial Numbers from Physical Servers is a bit more challenging because server hardware vendors expose those attributes differently.
The object hierarchy is as follows:
$VMhost.Summary.Hardware.OtherIdentifyingInfo.IdentifierType.Key["ServiceTag"].IdentifierValue
From a vCenter API perspective, the Powershell PowerCLI method is as follows, a simple method is as follows:
An code Example to get the data formatted in a nicer format follows:
Example - PowerCLI Example to get VMhost and Serial Number
As shown in the example above, the code returns 2 values. This occurs because the hardware vendor, Cisco, presents serial numbers per Processor.