Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 294344

Re: Use get-view to get datacenter of host

$
0
0

With the ExtensionData property we get access to the VirtualMachine object.

Most of the Managed vSphere objects has a property, called Parent, that points to the object to which our object is connected (the 'parent' in other words).

The contents of the Parent property is a MoRef (a pointer). To get at the actual object we use the Get-View cmdlet with this MoRef.

We repeat this process in a While loop till the parent object is a Datacenter object.

 

It's a bit like following the tree structure in the vSphere Client.

You start with the ESX(i) server and go up in the tree until you encounter a Datacenter.


Viewing all articles
Browse latest Browse all 294344

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>