So, is the extension data just like a read only view into the objects or can you actually modify those pieces using SDK calls? Also how exactly do you correlate something in the ExtensionData path to the manged objects in the SDK? I supposed I am slightly confused on how the information is presented between the 2.
The ExtensionData property maps a dynamic read-only copy of the actual vSphere objects.
The "dynamic" in there means that the guys (and girls) who write the PowerCLI cmdlets, introduced intelligency that will only get the properties under ExtensionData when you actually access them.
This is a huge time-saver. Some of these vSphere objects are huge.
To come back to your questions:
$vm = Get-VM -Name MyVM
$vm.ExtensionData
The last line will show an actual VirtualMachine object
I hope this clarified it somewhat (and didn't add to the confusion)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Makes sense, having to dust off my old C++ knowledge from college days . The hard time I washaving is like for my DVswtich function I wrote where I access the host network system object below, to then match it up to what they call it in the API. I see it is called "HostNetworkSystem". I am starting to get it, the project Onyx stuff really helps
#Get esxi object
$VMHostobj = Get-VMHost $VMHost
#Get Network ID
$networkid = $VMHostObj.ExtenSionData.Configmanager.NetworkSystem