ESXiCLI: Is it possible to list VMs with Virtual Machine Port Groups which they are using?

Hi,

I'm trying to write simple script in Bash under vMA which will list (like in topic) all running VMs with virtual machine Port Groups which they they are attached to. Is it possible?

I've try to find solution to this problem for last couple hours.

Kind regards
Greg

(Please excuse my English it isn't my first language)
Greg_UAsked:
Who is Participating?
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
there are esxcli network commands to list vSwitchs, vmnics, portgroups, but they cannot map back to VMs.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
esxtop can list VMs against portgroups and vmnics.

I would recommend using the following, also VMware recommends the use of PowerCLI, which is PowerShell interface with vSphere-specific additions.

http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli

One of the simplest PowerCLI examples, and something which is actually extremely useful on its own, is the Get-VM cmdlet. Which lists VMs.

PowerCLI can be a bit overwhelming to use,  But it can be enhanced with a nice toolset and a library of preconfigured scripts to jump-start your mass changes, which is possible with PowerGUI

http://powergui.org/index.jspa

and

VMware Community Pack

http://www.virtu-al.net/featured-scripts/vmware-powerpack/
0
 
BWXTCommented:
Ditto, would recommend hanccocka's recommendation... ;)
0
 
Greg_UAuthor Commented:
Thank you for your answers.

I know about PowerCLI and if I could I would use it, but due to nature of environment I can use only Linux environment.
So I'm force to use ESXCli.

I'm guessing it cannot be done in ESXCli?

Kind regards
Greg
0
 
Greg_UAuthor Commented:
One more time thank you for your answers.

Kind regards
Greg
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.