Share via


Cluster command output

Question

Wednesday, September 5, 2012 12:29 AM

I am looking for a method to detect the status of a cluster resource from command line. This will be used as part of a script on all cluster nodes to determine where a specific group / resource is online before issuing further resource related commands. Unfortunately I do not have access to a cluster to try some commands. Can someone please give me the outputs for following commands or recomend a better command? I prefer to use the command line.

cluster group <group name> /status

cluster resource <resource name> /status

cluster node /status

Thanks

All replies (17)

Wednesday, September 5, 2012 3:28 AM ✅Answered

Hello Rama, 

I suggest you can use cluster res command to know the status of all resources with corresponding groups & nodes. Moreover it is a single command to monitor cluster resources status.

BTW find the below info and your commands output will be like.

    • C:\cluster group "Clust Group" /stat
      Listing status for resource group 'Group':
      Group                Node            Status

      Clust Group         ABC           Online

    • C:\cluster res "resource-name" /stat
      Listing status for resource 'resource-name':
      Resource             Group                Node            Status

      resource-name    clust group        ABC           Online

    • C:\cluster node "ABC" /stat
      Listing status for node 'node-name':
      Node           Node ID Status

      ABC                2         Up

Regards, Ravikumar P


Wednesday, September 5, 2012 5:18 AM ✅Answered

It will work as long as the cluster service is running on this node.

C:\Documents and Settings\Administrator.WIN2K3CLUSTER>cluster resource /status

Listing status for all available resources:

 

Resource             Group                Node            Status

Disk Q:              Cluster Group        WIN2K3R2-1-SW   Online

Cluster IP Address   Cluster Group        WIN2K3R2-1-SW   Online

Cluster Name         Cluster Group        WIN2K3R2-1-SW   Online

Disk Q: (lost)       Cluster Group        WIN2K3R2-1-SW   Online

Private 2            Cluster Group        WIN2K3R2-1-SW   Online

 

 

C:\Documents and Settings\Administrator.WIN2K3CLUSTER>cluster node /status

Listing status for all available nodes:

 

Node           Node ID Status

WIN2K3R2-1-SW        2 Up

WIN2K3R2-2-SW        1 Up

 

 

C:\Documents and Settings\Administrator.WIN2K3CLUSTER>cluster group /status

Listing status for all available resource groups:

 

Group                Node            Status

Cluster Group test   WIN2K3R2-1-SW   Online

Cluster Group        WIN2K3R2-1-SW   Online

Leon Liu | Technical Lead


Wednesday, September 5, 2012 1:40 PM ✅Answered

If this is something you plan on using for a while, I would suggest that you look at PowerShell instead of cluster.exe.  Cluster.exe is deprecated in 2012.  PowerShell is available for both 2008 and 2012.

tim


Thursday, September 6, 2012 2:24 PM ✅Answered

Here is the output from the PowerShell Get-ClusterResource showing both online and offline resources.

PS C:\Users\timcerl> Get-ClusterResource -cluster "FT-Cluster"

Name                          State                         OwnerGroup                    ResourceType
                                                                      
Cluster Disk 1                Online                        Available Storage             Physical Disk
Cluster Disk 4                Online                        Cluster Group                 Physical Disk
Cluster IP Address            Online                        Cluster Group                 IP Address
Cluster Name                  Online                        Cluster Group                 Network Name
Virtual Machine Configurat... Online                        FT-001a                       Virtual Machine Configuration
Virtual Machine Configurat... Online                        FT-002a                       Virtual Machine Configuration
Virtual Machine Configurat... Online                        FT-iSCSI                      Virtual Machine Configuration
Virtual Machine Configurat... Online                        Template                      Virtual Machine Configuration
Virtual Machine Configurat... Online                        Trial5                        Virtual Machine Configuration
Virtual Machine FT-001        Online                        FT-001a                       Virtual Machine
Virtual Machine FT-002a       Offline                       FT-002a                       Virtual Machine
Virtual Machine FT-iSCSI      Offline                       FT-iSCSI                      Virtual Machine
Virtual Machine Template      Offline                       Template                      Virtual Machine
Virtual Machine Trial5        Offline                       Trial5                        Virtual Machine

tim


Wednesday, September 5, 2012 3:02 AM

Hi

http://technet.microsoft.com/en-us/library/cc723245.aspx

http://technet.microsoft.com/en-us/library/cc779044(v=ws.10).aspx

http://technet.microsoft.com/en-us/library/bb687324.aspx

Good Luck


Wednesday, September 5, 2012 3:23 AM

Thanks for your reply. But those links do not show the command output / format.


Wednesday, September 5, 2012 3:38 AM

Ramassh, consider using power shell.

http://blogs.msdn.com/b/clustering/archive/2008/12/20/9243367.aspx

http://blogs.msdn.com/b/clustering/archive/2009/05/21/9633316.aspx

http://blogs.msdn.com/b/clustering/archive/tags/powershell/

Regards, Vladimir Petter, Microsoft Corporation


Wednesday, September 5, 2012 3:43 AM

Thanks Ravi. Do these commands work on passive nodes too? I would like to see the result on a more than 2 node cluster too with 'Offline' nodes. Can you please help?


Wednesday, September 5, 2012 7:00 AM

Thanks Ravi. Do these commands work on passive nodes too? I would like to see the result on a more than 2 node cluster too with 'Offline' nodes. Can you please help?

Yes you can run from passive node but you can't run it from offline node.

Regards, Ravikumar P


Wednesday, September 5, 2012 8:56 AM

Thanks Leon. I believe this is a 2 node cluster.

I don't see the offline details reported in these outputs. So anything not reported here are considered 'Offline'? For example, if you run the follwoing command on both online and offline nodes will they show whether the group is offline on the passive node?

cluster group "Cluster Group" /status


Wednesday, September 5, 2012 1:13 PM

Hi Ramassh,

It will show as "Offline" if the group or resource is currently in offline status.

Both nodes will show the same result becasue they are in one cluster.

Thanks,
Leon

Leon Liu | Technical Lead


Wednesday, September 5, 2012 10:48 PM

Hi Leon, Ravi

Thanks for your replies, much appreciated. I am still not convinced that command reports offline groups. Do you have online/offline state group in a 2 node cluster? If so can you please run the following command on both nodes and paste the results?

cluster group <online/offline group name> /status

For me it looks like the offline group nodes are never reported. Only the online ones are reported, even from the offline group node.

Thanks :)


Wednesday, September 5, 2012 10:53 PM

Thanks Tim. Is there a replacement for cluster.exe in 2012? I need to use a command line as I may not have access to the file system to store a script. Is this info available in WMI?


Thursday, September 6, 2012 2:18 PM

PowerShell is the replacement, and it is a command line.  And, PowerShell V3 is remotable, so you can execute commands from a management system against a remote, managed system, such as a cluster.  That's the way I tend to do it a lot of the time.

My guess is that you can also find the information in WMI, but I am not a programmer, and trying to find what I need in WMI takes too long for me.  Since PowerShell exposes everything you need, it is much faster.  (Often, what a PowerShell cmdlet does is read the WMI information.)

tim


Friday, September 7, 2012 2:28 AM

Thanks Tim.


Wednesday, September 19, 2012 11:30 PM

Hi All,

I am trying to use WMI query check the status of the nodes in a cluster group.  Can you please give me the output of the following powershell commands? Please replace the groupname to suit a online/offline group in your system:

$Query = "select * from MSCluster_NodeToActiveGroup where PartComponent=`"MSCluster_ResourceGroup.Name='GroupName'`""
Get-WmiObject -namespace root\mscluster -query $Query

If that fails, please try:

$Query = "select * from MSCluster_NodeToActiveGroup"
Get-WmiObject -namespace root\mscluster -query $Query

I will be using a VB script to run this query. I need to know the output fields to read the node status. Please correct or suggest better commands!

Thanks


Thursday, September 20, 2012 1:54 AM

Hello Rama, 

I suggest you set-up a test lab for practice.This forum is dedicated for the issues occur in real time environment.

Alternatively use Technet virtual labs.

Thank you for understanding.

Regards, Ravikumar P