Hi All,
I'm hoping someone will have some words of wisdom for me regarding MS
Clustering on Windows 2003.
I have a service that runs on a cluster. During invocation it's
supposed to determine from the cluster which node is active (this is a
active/standby configuration) and either proceed or sleep depending on
the status. The interface to the cluster is that advertised by the
standard interop layer built by Visual Studio for the Microsoft Cluster
Service Automation Classes (MSClusterLib)
The problem is that when the service runs under the Local System
context the call to the open the cluster object fails with an Access
Denied exception being reported from the underlying COM interface.
System.UnauthorizedAccessException: Access is denied. (Exception from
HRESULT: 0x80070005 (E_ACCESSDENIED)) at
MSClusterLib.ClusterClass.Open(String bstrClusterName)
Strangely, when running under a domain account (granted, one that is a
member of the local administators group) it works fine (either as a
service, or from a console based app that invokes the same clustering
wrapper that I wrote). A low privileged, local account account also
fails. According to the cluster adminstator application, SYSTEM has
Full Control granted for the cluster. I've also verified that I am
actually running under the correct context after setting
AppDomain.CurrentDomain.SetSecurityPrincipal(Princ ipalPolicy.WindowsPrincipal)
I guess what I'm looking for are some ideas of where to start looking.
The infuriating this is that this *has* worked previously, and the fact
that I can get success when executing under my own account context at
least proves that the code is not fundamentally flawed.
Hopefully someone has some thoughts that they'd care to share. I'm
enclosing a sample (vb rather than C#) so you can see what I'm talking
about (and how there's not a lot that I can actually mess up here)
Public Sub New(ByVal cluster As String)
clusterToQuery = cluster
clusterIntf = New MSClusterLib.Cluster
Try
If Not clusterIntf Is Nothing Then
clusterIntf.Open(cluster) <------ the
exception is raised here.
Else
Throw New ClusterOpenFailException(cluster, "Cannot
open cluster")
End If
Catch ex As System.Runtime.InteropServices.COMException
Throw New ClusterOpenFailNoRPC("Cluster", ex)
Catch ex As Exception
Throw New ClusterOpenFailException(cluster, "Cannot
open cluster", ex)
End Try
End Sub
Regards
Simon