VMware

listHAClusterNodes.pl

VERSION 2 Published

Created on: Oct 28, 2009 10:34 AM by lamw - Last Modified:  Oct 28, 2009 10:47 AM by lamw

Motivated by c_shanklin twitter message about http://www.hypervisor.fr/?p=1320 this morning about listing primary HA nodes within vCenter cluster using PowerCLI, I thought I provide an equivalent snippet of vSphere SDK for Perl script. In additional to listing the primary nodes, I'm also outputting the configuration and run state of each node in the cluster.

Unfortunately, the vSphere API does not provide information about the secondary nodes

Requirements:
vCenter 4.0
vSphere SDK for Perl or vMA 4.0

Operations:
  • Specific cluster (user --cluster)
  • All cluster (default)

Sample Execution:

Specific cluster:

./listHAClusterNodes.pl --server reflex.primp-industries.com --cluster 'R&D'

Picture 1.png

All cluster:

./listHAClusterNodes.pl --server reflex.primp-industries.com

Picture 2.png

Your output should be much more defined ... my development environment is under construction still ;) hence the uninitialized and error messages

Attachments:
Average User Rating
(1 rating)




Comments

Oct 28, 2009 11:02 AM RS_1  says:

And here is the equivalent in psh : ((Get-View -ViewType ClusterComputeResource -filter @{"name" = "clustername"}).RetrieveDasAdvancedRuntimeInfo()).DasHostInfo.HostDasState | select Name,ConfigState,RuntimeState

Thanks for linking ;)

 

Incoming Links

Developer Social Media

Communities