The Managed Object Browser or MOB is a tool that is bundled with vCenter and ESXi, and it can be used to visually explore the structure of various vSphere related objects, such as Virtual Machines, Datastores and Clusters. This becomes invaluable when developing automation or reporting on infrastructure.
Each object within the MOB contains an array of data, from common information such as the objects name, configured CPU & Memory or its overall status, to less explored data such hardware device keys, VMX file paths and snapshot tree structure.
Not only can the MOB be used to explore this information, but it can also be used to invoke various methods against the various objects. For example, when viewing a Virtual Machine object you can invoke
vm.namewould return the
nameof the virtual machine object you are working with.
number, or another
object. When the value of a property is another object, the path can continue to be walked.
https://<vcenter-server-IP-or-FQDN>/mob/?moid=vm-725&doPath=guest- including the moRef of the vCenter object (e.g.
To connect to your vCenter MOB, navigate to
https://<vcenter-server-IP-or-FQDN>/mob and login with valid credentials.
At the top of your page you should see a table, the first column is the property/attribute name, followed by its type, and then the value. This structure will be used throughout the MOB.
This second page shows us various Service Managers that vCenter provides, such as
OvfManager, these provide various actions and functions, but for now we are only interested in consuming existing information.
rootFolder, the value should be
At the top of this next page you will see a
childEntity property, you should see some familiar values here - your Datacenters, their names will be shown within brackets ( ).
Within the Datacenter object screen you will see a lot of familiar information, this is the real start of what you would see within vCenter. On this page you will see links to your Datastores and Networks. At the bottom you will also see
You might have noticed that Datastores start with
datastore- and Networks start with
network-. As you browse the MOB you will see that various vSphere related objects have a naming prefix to them. (
vm- for VMs,
host- for Hosts etc).
Inside the top level VM folder, which has the name
vm (find the
name property), you will find all child folders as well as any virtual machines that have not been organised in to a folder. This is the root, or top level, vm folder - some applications such as
govc rely on this when providing the path to an object, for example if you wanted to move a vm in to a folder:
govc object.mv /dc1/vm/vm-foo-* /dc1/vm/folder-foo.
Take some time to look through this object, take note of the values against the
network properties. Now compare these to what you see within the vCenter UI, they should match.
We are now looking at the
guest information for our Virtual Machine. Take a look at the
hostname properties. Once again, these should match what you see within vCenter - is the VM powered on or off? What is the hostname shown on the summary tab?
Take note of the
Property Path at the top of the page, this currently shows
Property Path again, you should now see that we are in
summary.config. The path shows us where we are within an object, so at the moment we are within
Take a look at some of the properties listed here, such as the
guestFullName, check it against vCenter. The full path to this property would be
Install-Module -Name VMware.PowerCLI.
Connect-VIServer -Server "vcenter.domain.com" -User "username" -Password "password".
$vm = Get-VM -Name "vm-name".
To access the data we would normally see on an object within the MOB, via PowerCLI, we need to use the
Ignoring the ExtensionData property, we can see in the two simple examples above that the path we have gone down to get our data through PowerCLI matches the same path we went down to get the data from MOB.
vmwith the type