VMware Cloud Community
markdjones82
Expert
Expert

Extension data?

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.

http://www.twitter.com/markdjones82 | http://nutzandbolts.wordpress.com
0 Kudos
2 Replies
LucD
Leadership
Leadership

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:

  • The ExtensionData property maps directly to the vSphere object. So for example

$vm = Get-VM -Name MyVM

$vm.ExtensionData

The last line will show an actual VirtualMachine object

  • And no, you can change any of these directly. Use a PowerCLI cmdlet or a SDK method, and don't forget to do an UpdateViewData to get the new values.

I hope this clarified it somewhat (and didn't add to the confusion)


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

0 Kudos
markdjones82
Expert
Expert

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

http://www.twitter.com/markdjones82 | http://nutzandbolts.wordpress.com
0 Kudos