Search This Blog

Thursday, September 4, 2014

Unique IDs for VMware virtual machines and ESXi Hosts

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 InstanceUuidTherefore, 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:

PowerCLI InstanceUuid Access Method
PowerCLI C:\> get-vm VirtualMachineName | get-view | % { $_.config } | Format-Table -a *uuid
 
 
Uuid                                 InstanceUuid
----                                 ------------
421b4187-bcb4-3dc1-e7d7-c9496d3fdcb9 501b3ae4-16b3-2d7a-4492-553852f45e62

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. 

NamePersistentID TypeState
abbott5027322a-5e15-5a98-4c59-2927e9f9611c VMpoweredOn
acmeascpoc015027ded7-b8fa-8c39-f279-a258fb183992 VMpoweredOn

  

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:

PowerCLI VMhost Serial Number
$VMhost = Get-VMhost HostName | Get-View
 
$VMhost.Summary.Hardware.OtherIdentifyingInfowhere {$_.IdentifierType.Key -eq "ServiceTag" } | % { $_.IdentifierValue }
 
[Output Values:]
FOX1605G9YF
FCH17307L8U
 

 

An code Example to get the data formatted in a nicer format follows:

Example - PowerCLI Example to get VMhost and Serial Number

PowerCLI Example to get VMhost and Serial Number
PowerCLI C:\> Get-VMhost  LabServer01 | Get-View select name, @{N="Serial" ; E= { $_.Summar
y.Hardware.OtherIdentifyingInfowhere {$_.IdentifierType.Key -eq "ServiceTag" } | % { $_.IdentifierValu
e }  } }
 
Name           Serial
----           ------
LabServer01   {FOX1605G9YF, FCH17307L8U}

 

As shown in the example above, the code returns 2 values. This occurs because the hardware vendor, Cisco, presents serial numbers per Processor.

Tuesday, September 2, 2014

ALERT - BOB A. Is a secret fan of Mark Knopfler

An anonymous source stated today that Bob Apo. is a longtime fan of Mark Knopfler. Mr. Knopfler is best known for leading astray tens of millions of youth who grew up in the 70's and 80's. 

  https://duckduckgo.com/?q="mark+knopfler"