VMware Cloud Community
BS7
Contributor
Contributor

Get VM, DataStore, Disk, Cluster, VMHost and NetworkAdapters objects UUID through PowerCLI

Hello,

Does anyone know if the objects of type NetworkAdapters and Clusters also have an UUID?

We can get the UUID for the objects below through PowerCLI but it doesn't look that they exist for the other two types of objects.

  1. VM


$vm.ExtensionData.Config.Uuid

 

2. DataStore


$datastore.ExtensionData.Info.Vmfs.Uuid

 

3. Disk


$disk.ExtensionData.backing.uuid

 

4. Cluster


Looking for

 

5. VMHost


$vmHost.ExtensionData.Hardware.SystemInfo.Uuid

 

6. NetworkAdapters


Looking for

 

Best regards

0 Kudos
6 Replies
scott28tt
VMware Employee
VMware Employee

There is an area of VMTN dedicated to PowerCLI, I've asked moderators to move your thread there - the {code} area is for SDK matters.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
BS7
Contributor
Contributor

Thank you

0 Kudos
LucD
Leadership
Leadership

I'm not sure if this is really a PowerCLI question.
All the properties you list are accessed via ExtensionData, and thus in the realm of the SDK imho.
In fact, the API Reference contains all that info.

On a side note, why would you need a UUID for a cluster or a network adapter (btw, do you mean a vNIC or a pNIC )?
The unique identifiers for objects in a vCenter are the MoRefs of these objects.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
BS7
Contributor
Contributor

Hi LucD,

Thank you for your answer.

 

We are looking for the UUIDs because we have various vCenters and the MoRefs are unique whitin each vCenter so we do have similar MoRefs when we merge all the data.

 

The idea is to use out of the box data if available without a manipulation/transformation of it.

The goal of all this is to consolidate our CMDB and a primary key is needed to sync the data.

0 Kudos
LucD
Leadership
Leadership

Afik, there is no such unique identifier for a Cluster that stays unique across vCenters.

For the network adapter you didn't reply if that is for a vNIC or a pNIC.
In any case, you could consider the MAC address, which in theory should be unique, although I'm not sure if that holds true cross-vCenter for vNICs.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
BS7
Contributor
Contributor

Hi Luc,

Thank you for your answer and for your time.

Sorry about the NICs.
For now, we will only sync the vNic data.

0 Kudos