7

I need to be able to identify which cluster or vCenter instance some ESX servers are part of, but need to get this information directly from the ESX server itself. Is this information available in the vSphere API on the host system?

Background: I want to assign a unique identifier to each VM in a large estate managed by multiple vCenters, but VMware do no understand what the UU in UUID stands for - their 'universally unique' identifier can be duplicated when you copy a VM. The instanceUuid attribute is better, but only unique in the scope of the managing vCenter instance. To create a unique identity I need the ID of the vCenter as well as the ESX or VM ID.

Also does anyone know what happens to the instanceUuid if an ESX host is not managed by vCenter - is it still set? What happens if a stand-alone ESX is added to vCenter - does it change the instanceUuid of the host and all the guests? The official docs are silent on this matter. Can the instanceUuid be relied on as a stable identity?

Dave Kirby
  • 171
  • 3
  • How about generating your own UUIDs instead? When you create your VM, you may either allocate it from a central server, or, you could generate it from the name of your ESX server (assuming it's unique) and the current (high-precision) time. – Laszlo Valko Feb 11 '16 at 19:15
  • @GregL. I currently use the VM.config.uuid since VMware recommend that the identity should be changed when cloning a system. However In an estate of 18000 VMs over 13000 of them have duplicate uuids. – Dave Kirby Feb 12 '16 at 09:58
  • @LaszloValko I do not have write permission on the ESX hosts or VMs - this is for a program that monitors existing servers. – Dave Kirby Feb 12 '16 at 10:42
  • Then how would you like to change those IDs, if you have permission to neither the host nor the VM configuration? – Laszlo Valko Feb 12 '16 at 15:11
  • I don't want to change the IDs, I want to track their identities in a stand-alone program that monitors servers on the network. I need to identify the relationships between VMs, ESX servers and any vCenters that are managing them. And I need to do this from looking at the ESX servers rather than the vCenters. – Dave Kirby Feb 12 '16 at 16:20

2 Answers2

2

You can find this information from the ESXi host directly by examining the serverIp parameter in /etc/vmware/vpxa/vpxa.cfg.

grep serverIp /etc/vmware/vpxa/vpxa.cfg

This should also be available via API.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
0

Actually if you just log into the host it'll tell you - with the .net client you get a pop-out window with a warning, with the host web-client it says at the top of the screen.

Chopper3
  • 100,240
  • 9
  • 106
  • 238