How to print hosts in a vSphere cluster using vcli

Posting this because it was way simpler than I thought, and I don’t need to write any perl!
You can just run one of the commands that is included with the vSphere Command-Line Interface (vCLI) and grep out the hosts to your heart’s content.
The command is :

/usr/bin/vicfg-hostops --config [config file] -c [cluster name] -d [datacenter name - optional] -o info

Gotta love a quick win on a Monday morning.

This entry was posted in howto and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *