Summary
When I call Get-Cluster
powershell returns the name of my cluster. For simplicity sake, lets call it Cluster1
. If I call Get-Cluster -Name Cluster1
it fails with an error.
Error:
Get-Cluster : Check the spelling of the cluster name. Otherwise, there might be a problem with your network. Make sure
the cluster nodes are turned on and connected to the network or contact your network administrator.
The RPC server is unavailable
At line:1 char:1
+ Get-Cluster -Name Cluster1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ConnectionError: (:) [Get-Cluster], ClusterCmdletException
+ FullyQualifiedErrorId : ClusterRpcConnection,Microsoft.FailoverClusters.PowerShell.GetClusterCommand
Detail
My first thought is that I'm using the cmdlet wrong or winrm isn't working (it is). I also thought that maybe there's a difference in the way it's called that's causing the failure. Following that logic I reviewed the following technet page on the cmdlet:
Research: http://technet.microsoft.com/en-US/library/hh847254(v=wps.630).aspx
Based on the writing there, I couldn't discern an obvious user error. So I've tried a few things to figure it out. First I thought maybe I'm just constantly screwing up the typing so I did this:
$Cluster = Get-Cluster
($cluster.Name -like "Cluster1")
The conditional returns True
so I'm not a cluster f at typing. Next I tried the following:
Get-Cluster | Where-Object{$_.Name -like "Cluster1"}
Which of course returns the cluster object. So, what's going on here? What's different with Get-Cluster -Name "Cluster1"
?
Edit
Version info from Powershell:
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.34209
BuildVersion 6.3.9600.17090
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
Based on my observation of running
Get-Cluster
against a few of the clusters I have at work, it seemed to me that-Name
uses name resolution, so if there's anything that causes a problem resolving names, it will fail even if the name you give it is the local machine.I tried it with cluster names and cluster service names as well as names of the individual nodes in the cluster.
I also added an entry in my HOSTS file pointing a fake name to one of the clusters, and was able to successfully use that name with
Get-Cluster
.To me this strongly suggests that the use of
-Name
relies entirely on standard name resolution in the OS.The case where
Get-Cluster
without name would work whereasGet-Cluster -Name localhost
(or the actual hostname of the current machine) would not work, suggests to me that without a name parameter,Get-Cluster
attempts to communicate with the cluster service directly on the current machine, which would not require any name resolution.In addition to name resolution, I believe that an RPC connection is made to the destination server when using
-Name
(even if it's the local machine), so even if name resolution works, the RPC service actually being unavailable, or a firewall being on could actually block that connection and cause the error you saw.I was not able to test this, as I don't currently have a cluster in our test environment and I can't intentionally break name resolution or RPC on a production cluster!
Unfortunately, I could not back up this hypothesis with any kind of authoritative source (I couldn't find a definitive description of this behavior).