VMware {code} Community
tpcool
Enthusiast
Enthusiast
Jump to solution

How to see VSwitch and PortGroup properties in Managed Object Browser

Hi,

We have a lab running VI3 infrastructure, with one VC and few ESX servers.

Through Managed Object Browser I would like to see properties of some objects,

especially VSwitches and PortGroups.

How do I see VSwitch and PortGroups from the MOB. Following is my data:

ESX IP address: 192.188.0.228

VSwitch name: vSwitch0

Port Group name: VM_PG

I know that we can see these properties from VI Client, but I really want to see the values

returned for each of the attributes defined in the WSDL and the MOB precisely

allows me to do that. This will help me to do some modeling on our end.

I tried but I couldn't really get to vSwitch. Appreciate if anyone can give inputs.

Thanks

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

Try this:

https://A.B.C.D/mob/?moid=ha-host&doPath=config.network

and specifically this which will list out the portgroup's and vSwitches

https://A.B.C.D/mob/?moid=ha-host&doPath=config.network

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

View solution in original post

Reply
0 Kudos
8 Replies
lamw
Community Manager
Community Manager
Jump to solution

Take a look at: http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.host.NetworkInfo.html

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Reply
0 Kudos
jbruelasdgo
Virtuoso
Virtuoso
Jump to solution

you can take a look over here:

http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/index.html

look for HostNetworkConfig , HostNetworkInfo, HostPortGroup, HostPortGroupSpec

regards

Jose Ruelas

Jose B Ruelas http://aservir.wordpress.com
tpcool
Enthusiast
Enthusiast
Jump to solution

Right, I have the documentation with me and I have already gone through it. My question was more about how do I see the values returned for my deployment. For this, I need to connect to my VC, open the MOB, somehow get to the vSwitch and from then on look for value of the each attribute of the Data Object.

I had struggle getting to the vSwitch. I was able to progress to some extent though. First there is no way to simply say getVSwitch(host, switchname). We have to do this in a very indirect way.

1. First get a reference to the host of your choice (this is where I was stuck)

2. For vSwitch: Navigate in this fashion+ _HostSystem>HostConfigInfo>HostNetworkInfo>HostVirtualSwitch

_+

3. For PortGroup: Navigate in this fashion HostSystem>HostConfigInfo>HostNetworkInfo>HostPortGroup

In order to get to the ESX host, I used FindByIP and gave the IP address of my ESX host. Then I got the reference of the host. There I clicked on the HostSystem to complete the navigation path. Not sure if there is any other direct way to get to the vSwitch. I am open to take if anyone wants to propose a alternative/easy approach.

Thanks

Reply
0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Try this:

https://A.B.C.D/mob/?moid=ha-host&doPath=config.network

and specifically this which will list out the portgroup's and vSwitches

https://A.B.C.D/mob/?moid=ha-host&doPath=config.network

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Reply
0 Kudos
tpcool
Enthusiast
Enthusiast
Jump to solution

Thanks this is a good idea to directly navigate to the required page.

However, we need to to have the host-id to get it working.

For example, I used the following url

https://A.B.C.D./mob/?moid=host-2903&doPath=config.network

I needed to get the host-2903 to get the URL working. For that I depended on FindByIP to return the host id. I am ok with it, unless you have any other easier/alternative to get that directly (by specifying the IP address of the ESX host in the URL, for example, without needing to refer to the host-id)

Thanks

Reply
0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

I assume you're going through the vCenter MOB? I thought you were directly connecting to an individual host. I don't use the MOB too often, I think it can be used to explore the detail properties but I normally connect using the VI Perl Toolkit and depending at what level of vCenter you can just return all HostSystem and just map it to some user input by either name or IP. Good Luck

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Reply
0 Kudos
tpcool
Enthusiast
Enthusiast
Jump to solution

Thanks William for your detailed response. I need to connect to vCenter because the ESX hosts are in a different internal network that is not reachable by the client. I liked the URL idea to directly navigate to network. For now, I can live with finding the host with FindByIP and using the host ID to form the link. I haven't used the perl toolkit yet.I will use it soon.

thanks. I am resolving this question now.

Reply
0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

It's fine that you connect to vCenter, you have view of all your hosts within that vCenter environment. I'm not sure what other details you might be interested in, but you can take a look at this Health Script I wrote, you can connect directly to a vCenter and it'll pull out quite a bit of information about a given vCenter instance along with other options. You only need the VI Perl Toolkit (Windows/Linux) or you can use VMware VIMA vApp.

http://communities.vmware.com/docs/DOC-9420

There are some sample output that you can view to see what's available. If you're interested in the gory details regarding a host, you can use the option "--type detail-hosts" to get more configurations from each of the ESX/ESXi hosts.

You can also get quite a bit of information using the default utilities provided by the VI Perl Toolkit: http://www.vmware.com/support/developer/viperltoolkit/viperl15/doc/perl_toolkit_utilities_idx.html

Again, I think the MOB is really for exploring the properties and objects, you can also do something similar with the Dumper() function that will print out objects and their properties for you to explore and of course the VI API reference is a great place to go as well.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Reply
0 Kudos