Skip to content

Cluster: When using distinguished naming of cluster, second pass of DSC fails.  #256

Description

@IlleNilsson

I want to create the AD Cluster object in a specific OU

Verbose logs showing the problem

PSComputerName       : SRV70031
RunspaceId           : 83a68bc5-290c-46d9-8521-4b55093d7bb9
ConfigurationName    : QSClusterDsc
DependsOn            : {[WindowsFeature]WSCS}
ModuleName           : xFailoverCluster
ModuleVersion        : 1.16.0
PsDscRunAsCredential :
ResourceId           : [xCluster]PrepareCluster
SourceInfo           : \\tsclient\E\IGEL\Source\Platform\DSC\~Config\QSClusterDSC.ps1::223::13::xCluster
DurationInSeconds    : 9.353
Error                : {
                           "Exception":  {
                                             "Message":  "PowerShell DSC resource MSFT_xCluster  failed to execute
                       Set-TargetResource functionality with error message: There was an error adding node
                       \u0027SRV70031\u0027 to the cluster ",
                                             "Data":  {

                                                      },
                                             "InnerException":  {
                                                                    "SerializedRemoteException":
                       "Microsoft.FailoverClusters.PowerShell.ClusterCmdletException: T**here was an error adding node
                       \u0027SRV70031\u0027 to the cluster ---\u003e**
                       Microsoft.FailoverClusters.PowerShell.ClusterCmdletException: T**he computer
                       \u0027SRV70031.rd01.local\u0027 is joined to a cluster**.\r\n   --- End of inner exception stack
                       trace ---",
                                                                    "SerializedRemoteInvocationInfo":
                       "System.Management.Automation.InvocationInfo",
                                                                    "ErrorRecord":  "There was an error adding node
                       \u0027SRV70031\u0027 to the cluster\n    The computer \u0027SRV70031.rd01.local\u0027 is joined
                       to a cluster.",
                                                                    "WasThrownFromThrowStatement":  false,
                                                                    "Message":  "There was an error adding node
                       \u0027SRV70031\u0027 to the cluster",
                                                                    "Data":
                       "System.Collections.ListDictionaryInternal",
                                                                    "InnerException":  null,
                                                                    "TargetSite":  "Void EndInvoke()",
                                                                    "StackTrace":  "   at
                       System.Management.Automation.Runspaces.AsyncResult.EndInvoke()\r\n   at System.Management.Automa
                       tion.PowerShell.CoreInvokeRemoteHelper[TInput,TOutput](PSDataCollection`1 input,
                       PSDataCollection`1 output, PSInvocationSettings settings)\r\n   at
                       System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input,
                       PSDataCollection`1 output, PSInvocationSettings settings)\r\n   at
                       System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings
                       settings)\r\n   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapt
                       er.ExecuteCommand(PowerShell powerShell, ResourceModuleInfo resInfo, String operationCmd,
                       List`1 acceptedProperties, CimInstance nonResourcePropeties, CimInstance resourceConfiguration,
                       LCMDebugMode debugMode, PSInvocationSettings pSInvocationSettings, UInt32\u0026
                       resultStatusHandle, Collection`1\u0026 result, ErrorRecord\u0026 errorRecord, PSModuleInfo
                       localRunSpaceModuleInfo)",
                                                                    "HelpLink":  null,
                                                                    "Source":  "System.Management.Automation",
                                                                    "HResult":  -2146233087
                                                                },
                                             "TargetSite":  null,
                                             "StackTrace":  null,
                                             "HelpLink":  null,
                                             "Source":  null,
                                             "HResult":  -2146233079
                                         },
                           "TargetObject":  null,
                           "CategoryInfo":  {
                                                "Category":  7,
                                                "Activity":  "",
                                                "Reason":  "InvalidOperationException",
                                                "TargetName":  "",
                                                "TargetType":  ""
                                            },
                           "FullyQualifiedErrorId":  "ProviderOperationExecutionFailure",
                           "ErrorDetails":  null,
                           "InvocationInfo":  null,
                           "ScriptStackTrace":  null,
                           "PipelineIterationInfo":  [

                                                     ]
                       }
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : PrepareCluster
RebootRequested      : False
ResourceName         : xCluster
StartDate            : 4/12/2021 11:58:00 AM
StateChanged         : False

Suggested solution to the issue

The DSC configuration that is used to reproduce the issue (as detailed as possible)

        if ($Node.Replica -eq 'Primary') {
            xCluster 'PrepareCluster' {
                PsDscRunAsCredential = $SetupCredential
                DomainAdministratorCredential = $SetupCredential
                Name = $Node.FailoverClusterName
                StaticIPAddress = $Node.FailoverClusterIPAddress
                IgnoreNetwork = $Node.FailoverClusterIgnoreNetwork
                DependsOn = @('[WindowsFeature]WSCS')
            }
         } else {
            $FailoverClusterName = ((($Node.FailoverClusterName -split ',')[0]) -split '=')[1]
            xCluster 'PrepareCluster' {
                PsDscRunAsCredential = $SetupCredential
                DomainAdministratorCredential = $SetupCredential
                Name = $FailoverClusterName
                StaticIPAddress = $Node.FailoverClusterIPAddress
                IgnoreNetwork = $Node.FailoverClusterIgnoreNetwork
                DependsOn = @('[xWaitForCluster]WaitForCluster')
            }
            xWaitForCluster 'WaitForCluster' {
                PsDscRunAsCredential = $SetupCredential
                Name = $FailoverClusterName
                RetryIntervalSec = 5
                RetryCount = 15
                DependsOn = @('[WindowsFeature]WSCS')
            }

--First Nodes MOF

instance of MSFT_xCluster as $MSFT_xCluster1ref
{
ResourceID = "[xCluster]PrepareCluster";
 PsDscRunAsCredential = $MSFT_Credential1ref;
 IgnoreNetwork = {
    "10.50.0.0/16"
};
 StaticIPAddress = "192.168.1.20";
 DomainAdministratorCredential = $MSFT_Credential2ref;
 SourceInfo = "\\\\tsclient\\E\\IGEL\\Source\\Platform\\DSC\\~Config\\QSClusterDSC.ps1::223::13::xCluster";
 Name = "CN=SRV70CLU,OU=Computers,OU=Admin,OU=Resources,DC=rd01,DC=local";
 ModuleName = "xFailoverCluster";
 ModuleVersion = "1.16.0";

DependsOn = {

    "[WindowsFeature]WSCS"};

 ConfigurationName = "QSClusterDsc";

};

--Second Nodes MOF

instance of MSFT_xCluster as $MSFT_xCluster1ref
{
ResourceID = "[xCluster]PrepareCluster";
 PsDscRunAsCredential = $MSFT_Credential1ref;
 IgnoreNetwork = {
    "10.50.0.0/16"
};
 StaticIPAddress = "192.168.1.20";
 DomainAdministratorCredential = $MSFT_Credential2ref;
 SourceInfo = "\\\\tsclient\\E\\IGEL\\Source\\Platform\\DSC\\~Config\\QSClusterDSC.ps1::233::13::xCluster";
 Name = "SRV70CLU";
 ModuleName = "xFailoverCluster";
 ModuleVersion = "1.16.0";

DependsOn = {

    "[xWaitForCluster]WaitForCluster"};

 ConfigurationName = "QSClusterDsc";

};

instance of MSFT_xWaitForCluster as $MSFT_xWaitForCluster1ref
{
ResourceID = "[xWaitForCluster]WaitForCluster";
 PsDscRunAsCredential = $MSFT_Credential3ref;
 RetryCount = 15;
 SourceInfo = "\\\\tsclient\\E\\IGEL\\Source\\Platform\\DSC\\~Config\\QSClusterDSC.ps1::241::13::xWaitForCluster";
 Name = "SRV70CLU";
 ModuleName = "xFailoverCluster";
 RetryIntervalSec = 5;
 ModuleVersion = "1.16.0";

DependsOn = {

    "[WindowsFeature]WSCS"};

 ConfigurationName = "QSClusterDsc";

};

The operating system the target node is running

OsName : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsVersion : 1809
WindowsBuildLabEx : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage : en-US
OsMuiLanguages : {en-US}

Version and build of PowerShell the target node is running

SVersion 5.1.17763.1490
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1490
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Version of the DSC module that was used

1.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug.help wantedThe issue is up for grabs for anyone in the community.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions