dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
359 stars 224 forks source link

xSQLServerSetup: Unable to add feature to a cluster install #432

Closed johlju closed 7 years ago

johlju commented 7 years ago

Details of the scenario you try and problem that is occurring: When adding a feature to a cluster install Test-TargetResource reports $true even if the feature is reported missing. That is because this line sets the result back to $true https://github.com/PowerShell/xSQLServer/blob/dev/DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1#L1676

The DSC configuration that is using the resource (as detailed as possible): Trying to add AS to an existing cluster installation using this configuration

xSQLServerSetup $resourceConfigName
{
    Action = 'InstallFailoverCluster'
    ForceReboot = $false

    SourcePath = $Node."SourcePath$($currentSqlInstance)"
    UpdateEnabled = 'False'

    SetupCredential = $SqlInstallCredential
    SourceCredential = $SqlInstallCredential

    InstanceName = $Node."$($currentSqlInstance)InstanceName"
    Features = 'SQLENGINE,AS,SSMS,ADV_SSMS'

    InstallSharedDir = 'C:\Program Files\Microsoft SQL Server'
    InstallSharedWOWDir = 'C:\Program Files (x86)\Microsoft SQL Server'
    InstanceDir = 'C:\Program Files\Microsoft SQL Server'

    SQLCollation = 'Finnish_Swedish_CI_AS'
    SQLSvcAccount = $SqlServiceCredential
    AgtSvcAccount = $SqlAgentServiceCredential
    SQLSysAdminAccounts = 'COMPANY\SQL Administrators', $SqlAdministratorCredential.UserName

    InstallSQLDataDir = 'G:\MSSQL\Data'
    SQLUserDBDir = 'E:\MSSQL\Data'
    SQLUserDBLogDir = 'F:\MSSQL\Log'
    SQLTempDBDir = 'H:\MSSQL\Temp'
    SQLTempDBLogDir = 'H:\MSSQL\Temp'
    SQLBackupDir = 'I:\MSSQL\Backup'

    ASSvcAccount = $SqlServiceCredential
    ASSysAdminAccounts = 'COMPANY\SQL Administrators', $SqlAdministratorCredential.UserName

    ASConfigDir = 'G:\AS\Config'
    ASDataDir = 'E:\AS\Data'
    ASLogDir = 'F:\AS\Log'
    ASBackupDir = 'I:\AS\Backup'
    ASTempDir = 'H:\AS\Temp'

    FailoverClusterNetworkName = $Node.SqlClusterGroupFailoverClusterNetworkName
    FailoverClusterIPAddress = $Node.SqlClusterGroupFailoverClusterIPAddress
    FailoverClusterGroupName = $Node.SqlClusterGroupFailoverClusterGroupName

    DependsOn = '[WindowsFeature]NetFramework35','[WindowsFeature]NetFramework45'
}

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running: Windows Server 2016, SQL Server 2014, WMF5.0

Version of the DSC module you're using, or 'dev' if you're using current dev branch: Dev

johlju commented 7 years ago

It is not possible to add a feature to an already present SQL Server failover cluster. See issue #433. But I will add a note to that in the README.md. Also changed so that it actually reports $false if a feature is missing. Although, there is no way to fix it (to big of an impact for DSC to remove an reinstall the cluster). But atleast now it reports if the desired state is not present.