VMware Cloud Community
gboskin
Enthusiast
Enthusiast

PowerShell Script to find out Primary Node

Can anyone assist in a powershell scripts to

list the hosts in a cluster and identify which ones are primary and which ones are secondary nodes ??

Cheers

0 Kudos
8 Replies
alanrenouf
VMware Employee
VMware Employee

Are you talking about a VI Toolkit version of cat /var/log/vmware/aam/aam_config_util_listnodes.log

If you found this information useful, please consider awarding points for Correct or Helpful.

Alan Renouf

VMware, Citrix, Microsoft Consultant

UK

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos
gboskin
Enthusiast
Enthusiast

yes thats what i mean Alan...

0 Kudos
LucD
Leadership
Leadership

There is nothing in the SDK objects that shows which node is primary/secondary.

But I was looking at using psexec to execute the ftcli command on a cluster node.

That lists the nodes.


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

0 Kudos
CITITECHS
Contributor
Contributor

I was thinking the same thing when I saw the article on yellow-bricks about primary nodes for blades.

How to do it with Powershell.

0 Kudos
depping
Leadership
Leadership

I've been searching for this myself but it's not in the SDK unfortunately,

Duncan

Blogging:

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
LucD
Leadership
Leadership

Nope, the only solution I came up with is to use plink, launch the ftcli command, capture and analyse the output with PowerShell.


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

0 Kudos
RobMokkink
Expert
Expert

What is do to get ouput of the plink command is use teh | out-string method.

When i call a plink command like:



$STRCMD1 = $PLINK + " " + $USER + " " + "-pw" + " " + $PASSWORD + " " + $ESXHOST + " df -h"
$CHECKFS = invoke-expression $STRCMD1 | out-string


You can then use the output again in your powershell script.

0 Kudos
gboskin
Enthusiast
Enthusiast

Very intresting article .. Identifying a single point of failure !!!!

At the moment we are having to read the logs and joggle the servers into maintance mode daily to get the primary nodes spilt across two Chasis.

The Option for 8 servers in a cluster is not a solution for us as we will be losing overhead resources...

Does anyone know if the number of allowed primary node would be increased in ESX4???

Looks like we need to move this thread to another forum???

0 Kudos