pyvmomi icon indicating copy to clipboard operation
pyvmomi copied to clipboard

strange uuid permutations

Open briner opened this issue 8 years ago • 13 comments

Hello,

Since the version 6.5 of vcenter and 6.5 of ESX, I got some differences on how the uuid is represented.

From the guest I get the UUID (cat /sys/class/dmi/id/product_uuid) 5C241F42-A87F-FA60-6AF6-A46351CED0EB

From the vcenter through pyvmomi i get: 421F245C-7FA8-60FA-6AF6-A46351CED0EB

We see that the lasts pieces: 6AF6 and A46351CED0EB are the same. When the other had have some permutations:

  • FA 60 becomes 60 FA
  • A8 7F becomes 7F A8
  • 5C 24 1F 42 becomes 42 1F 24 5C

Any idea on what is the problem ?

briner avatar Jun 11 '18 11:06 briner

This is a endian problem, as the canonical UUID representation uses a uint32_t, then two uint16_t, then char[8].

For example, see:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa379358%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

jeking3 avatar Oct 17 '18 17:10 jeking3

Oh I see, thanks for the info.

But do you think that this could be solved within pyvmomi ?

briner avatar Oct 17 '18 19:10 briner

It would be important to first figure out which component is wrong, if any. It may very well be that something was corrected.

It may very well be that pyVmomi is at fault, so first I would go to the latest pyVmomi. If that does not change the behavior, try dmidecode -s system_uuid and see if it is different than your "cat proc..." - my experience tells me that what comes out of the dmidecode command matches what vSphere reports as the uuid for the VM.

A process of elimination is needed to isolate it. While it sounds like the only change in your environment at the time was the upgrade to ESXi 6.5 and/or vCenter 6.5, I don't know.

jeking3 avatar Oct 17 '18 23:10 jeking3

As of today I see this on ESXi 6.7 and I would consider this a regression on VMware's side if indeed the behavior changed from ESX 6.0 to 6.5.

from the vCenter 6.7 MOB for a given VM:

uuid    string  "42348510-53d2-d870-d6b0-61f1173123d2"

from inside the VM:

PS C:\Users\Administrator> get-wmiobject Win32_ComputerSystemProduct  | Select-Object -ExpandProperty UUID
10853442-D253-70D8-D6B0-61F1173123D2

from the VMX file:

uuid.bios = "42 34 85 10 53 d2 d8 70-d6 b0 61 f1 17 31 23 d2"

The UUID is a series of bytes, however those bytes are typically interpreted using the canonical form I described earlier. So I would say the issue lies inside vCenter, specifically the SOAP API should be normalizing the UUID to the endianness of the platform and it is not. This issue can be seen both from pyVmomi and from the MOB. Reporting it to VMware as a defect would be a good idea.

jeking3 avatar Oct 19 '18 14:10 jeking3

@hartsock any chance you could raise this as an internal issue at VMware? It looks like the uuid being reported in the vSphere MOB and through pyVmomi does not match the UUID that the guests are receiving; the UUID is being read in from the VMX and delivered verbatim to the guest (which is correct) however the MOB and pyVmomi interface should be performing an endian conversion on the UUID in order to correctly convert it to a string to display it in a format that matches what the guests believe it to be.

jeking3 avatar Oct 19 '18 14:10 jeking3

@tianhao64 please see issue described above - any chance you could raise this as an internal issue at VMware for this?

jeking3 avatar Oct 23 '18 20:10 jeking3

@jeking3 Thanks for the detailed analysis. I will file a bug against the VC team.

tianhao64 avatar Oct 24 '18 06:10 tianhao64

Bug has reported. Will share updates here.

tianhao64 avatar Oct 24 '18 08:10 tianhao64

Please check the following links for some information.

  • https://kb.vmware.com/s/article/1880
  • https://blogs.technet.microsoft.com/aaronczechowski/2012/01/04/using-smbios-guid-to-import-computer-information-for-vmware-guest/

Check the 'Pretty Print' order and 'Raw Byte order' sections in https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc978312(v=technet.10)

I think this has been there for a long time (atleast from ESX 5.5) and is not any regression since any specific release.

stanguturi avatar Oct 24 '18 16:10 stanguturi

In a windows VM, you can execute the following two commands.

C:> wmic csproduct get "IdentifyingNumber" This will show the raw byte order of UUID found in VMX file (uuid.bios key)

C:> wmic csproduct get "UUID" This will show the pretty print format. A little bit different from the raw byte order.

stanguturi avatar Oct 24 '18 16:10 stanguturi

Thanks @stanguturi. Closing as not a bug.

tianhao64 avatar Oct 25 '18 02:10 tianhao64

In my experience, dmidecode -s system-uuid in a Linux guest always matched the config.uuid string reported in vSphere. My Ubuntu Bionic system:

jking@dvm:~/$ sudo dmidecode -s system-uuid
A98D4D56-5289-DB71-6D60-DE84934CDCC8

From the MOB:

uuid | string | "564d8da9-8952-71db-6d60-de84934cdcc8"

It seems to me something did in fact change, perhaps since vSphere 6.5. I'm fairly sure (but don't have access to the older systems any more) that this was not the case. I guess folks that rely on the uuid need to take this into account then trying to match by the uuid. Thanks.

jeking3 avatar Oct 25 '18 11:10 jeking3

VMware vHW 13 / SMBIOS 2.7+ -- https://knowledge.broadcom.com/external/article/334165/dmidecode-uuid-dependency-on-hardware-ve.html

virtualjmills avatar May 23 '24 22:05 virtualjmills