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'
All cluster:
./listHAClusterNodes.pl --server reflex.primp-industries.com
Your output should be much more defined ... my development environment is under construction still

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