Skip navigation
VMware

This Question is Not Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
560 Views 8 Replies Last post: Feb 16, 2009 3:23 AM by gboskin RSS
gboskin Hot Shot 223 posts since
Nov 19, 2008
Currently Being Moderated

Feb 11, 2009 4:47 AM

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

 

 

 

 

 

 

 

 

 

 

 

alanrenouf Master VMware Employees vExpert 769 posts since
Feb 28, 2006
Currently Being Moderated
1. Feb 11, 2009 6:21 AM in response to: gboskin
Re: PowerShell Script to find out Primary Node

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
LucD Guru User Moderators vExpert 8,981 posts since
Oct 31, 2005
Currently Being Moderated
3. Feb 11, 2009 6:44 AM in response to: gboskin
Re: PowerShell Script to find out Primary Node

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: http://lucd.info | Twitter: @LucD22 | Book co-author: http://powerclibook.com
CITITECHS Enthusiast 41 posts since
Feb 4, 2008
Currently Being Moderated
4. Feb 11, 2009 9:06 AM in response to: gboskin
Re: PowerShell Script to find out Primary Node

 

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

 

 

 

 

 

http://www.yellow-bricks.com/2009/02/09/blades-and-ha-cluster-design/

 

 

 

 

 

How to do it with Powershell.

 

 

depping Champion VMware Employees User Moderators vExpert 4,238 posts since
Jan 17, 2005
Currently Being Moderated
5. Feb 13, 2009 4:44 AM in response to: CITITECHS
Re: PowerShell Script to find out Primary Node

 

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

 

 

 

Duncan

Blogging: http://www.yellow-bricks.com

 

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

Duncan | Yellow-Bricks.com | Author of the vSphere 5.0 Clustering Deepdive
LucD Guru User Moderators vExpert 8,981 posts since
Oct 31, 2005
Currently Being Moderated
6. Feb 13, 2009 4:47 AM in response to: depping
Re: PowerShell Script to find out Primary Node

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

Blog: http://lucd.info | Twitter: @LucD22 | Book co-author: http://powerclibook.com
RobMokkink Expert 811 posts since
Jun 7, 2005
Currently Being Moderated
7. Feb 15, 2009 11:13 PM in response to: LucD
Re: PowerShell Script to find out Primary Node

 

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.

 

 

 

 

 

 

 

 

Bookmarked By (0)

Share This Page

Communities