VMware Cloud Community
justinsmith
Enthusiast
Enthusiast

Script esxcfg-vswitch -l info

Is there a powercli equivalent script to the esxcfg-vswitch -l command? Since Im using a 1000v, the CDP info doesnt really help the ports connected to the 1000v.

I can run that command (esxcfg-vswitch -l) manually on each host and get the info Im looking for, but I'd like a script that will pull the info from that command against all the hosts in a vCenter. Preferably outputted to a CSV file.

0 Kudos
6 Replies
RvdNieuwendijk
Leadership
Leadership

The PowerCLI equivalent of the 'esxcfg-vswitch -l' command is Get-VirtualSwitch. I have no experience with the Cisco Nexus 1000v switch, so I don't know what the Get-VirtualSwitch cmdlet does with the 1000v.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
LucD
Leadership
Leadership

Have a look at VDS and 3rd Party VDS Info

Does this produce the info you're after ?


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

0 Kudos
justinsmith
Enthusiast
Enthusiast

This is the output I get when I run the esxcfg-vswitch-l command. While the script you mentioned will be helpful, Im just looking for the MTU setting on the 1000v and that script doesnt seem to grab it.

pastedImage_0.png

0 Kudos
RvdNieuwendijk
Leadership
Leadership

You can try the Get-VDSwitch cmdlet. That will show the MTU size in the default output.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
justinsmith
Enthusiast
Enthusiast

Seemed to work, but the MTU value is blank...

0 Kudos
RvdNieuwendijk
Leadership
Leadership

In this case you might need to revert to a solution using plink.exe to run the 'esxcfg-vswitch -l' command on the hosts.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos