SqlServerDsc icon indicating copy to clipboard operation
SqlServerDsc copied to clipboard

SqlSetup: Missing Configuration Feature/Options Telemetry

Open kattaleb opened this issue 4 years ago • 5 comments

Details of the scenario you tried and the problem that is occurring

We are trying to install anew SQL 2017 SERVER with the SqlSetup dsc resource.

Verbose logs showing the problem

+             SQLTELSVCACCT  = "NT Service\SQLTELEMETRY$SQLTEST05"
+             ~~~~~~~~~~~~~
The member 'SQLTELSVCACCT' is not valid. Valid members are
'Action', 'AgtSvcAccount', 'AgtSvcStartupType', 'ASBackupDir', 'ASCollation', 'ASConfigDir', 'ASDataDir', 'ASLogDir', 'ASServerMode', 'ASSvcAccount', 'AsSvcStartupType', 'ASSysAdminAccounts', 'ASTempDir', 'BrowserSvcStartupType', 'DependsOn', 
'ErrorReporting', 'FailoverClusterGroupName', 'FailoverClusterIPAddress', 'FailoverClusterNetworkName', 'FeatureFlag', 'Features', 'ForceReboot', 'FTSvcAccount', 'InstallSharedDir', 'InstallSharedWOWDir', 'InstallSQLDataDir', 'InstanceDir', 'InstanceID', 
'InstanceName', 'ISSvcAccount', 'IsSvcStartupType', 'ProductKey', 'PsDscRunAsCredential', 'RSSvcAccount', 'RSSVCStartupType', 'SAPwd', 'SecurityMode', 'SetupProcessTimeout', 'SourceCredential', 'SourcePath', 'SQLBackupDir', 'SQLCollation', 'SQLSvcAccount', 
'SqlSvcStartupType', 'SQLSysAdminAccounts', 'SQLTempDBDir', 'SqlTempdbFileCount', 'SqlTempdbFileGrowth', 'SqlTempdbFileSize', 'SQLTempDBLogDir', 'SqlTempdbLogFileGrowth', 'SqlTempdbLogFileSize', 'SQLUserDBDir', 'SQLUserDBLogDir', 'SQMReporting', 
'SuppressReboot', 'UpdateEnabled', 'UpdateSource'.
At C:\Users\operator-attaleb\Documents\PowScripts\06_InstallSqlServer.ps1:82 char:13
+             SQLTELSVCSTARTUPTYPE = "Disabled"
+             ~~~~~~~~~~~~~~~~~~~~
The member 'SQLTELSVCSTARTUPTYPE' is not valid. Valid members are
'Action', 'AgtSvcAccount', 'AgtSvcStartupType', 'ASBackupDir', 'ASCollation', 'ASConfigDir', 'ASDataDir', 'ASLogDir', 'ASServerMode', 'ASSvcAccount', 'AsSvcStartupType', 'ASSysAdminAccounts', 'ASTempDir', 'BrowserSvcStartupType', 'DependsOn', 
'ErrorReporting', 'FailoverClusterGroupName', 'FailoverClusterIPAddress', 'FailoverClusterNetworkName', 'FeatureFlag', 'Features', 'ForceReboot', 'FTSvcAccount', 'InstallSharedDir', 'InstallSharedWOWDir', 'InstallSQLDataDir', 'InstanceDir', 'InstanceID', 
'InstanceName', 'ISSvcAccount', 'IsSvcStartupType', 'ProductKey', 'PsDscRunAsCredential', 'RSSvcAccount', 'RSSVCStartupType', 'SAPwd', 'SecurityMode', 'SetupProcessTimeout', 'SourceCredential', 'SourcePath', 'SQLBackupDir', 'SQLCollation', 'SQLSvcAccount', 
'SqlSvcStartupType', 'SQLSysAdminAccounts', 'SQLTempDBDir', 'SqlTempdbFileCount', 'SqlTempdbFileGrowth', 'SqlTempdbFileSize', 'SQLTempDBLogDir', 'SqlTempdbLogFileGrowth', 'SqlTempdbLogFileSize', 'SQLUserDBDir', 'SQLUserDBLogDir', 'SQMReporting', 
'SuppressReboot', 'UpdateEnabled', 'UpdateSource'.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidInstanceProperty

Suggested solution to the issue

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

        SqlSetup InstallSql {
            InstanceName        =  $InstanceName
            InstanceDir         = 'E:\Microsoft SQL Server' 
            INSTALLSHAREDDIR    = 'E:\Program Files\Microsoft SQL Server'
            INSTALLSHAREDWOWDIR = 'E:\Program Files (x86)\Microsoft SQL Server'
            SourcePath          = '\\fs-sunarchive\dbasoftware$\SQL2017\SQL 2017 Standard Edition'
            SourceCredential    = $Cred
            Features            = 'SQLENGINE,REPLICATION,FULLTEXT'
            SQLSysAdminAccounts = 'AVI-DC\GN-BRU-DatabaseAdministrators'
            BROWSERSVCSTARTUPTYPE='Automatic'
            SQLUserDBDir        = $ConfigurationData.NonNodeData.DataDir
            SQLUserDBLogDir     = $ConfigurationData.NonNodeData.LogDir
            SQLTempDBDir        = $ConfigurationData.NonNodeData.TempDataDir
            SQLBackupDir        = $ConfigurationData.NonNodeData.BackupDir
            SqlTempdbFileCount  = 4
            SqlTempdbFileGrowth = 1024
            SqlTempdbFileSize   = 1024
            SQLTempDBLogDir     = $ConfigurationData.NonNodeData.TempLogDir 
            SqlTempdbLogFileGrowth = 1024 
            SqlTempdbLogFileSize   = 1024
            SQLCollation           = 'SQL_Latin1_General_CP1_CI_AS'
            SecurityMode           = 'SQL'
            SAPwd                  = $saCred#(Get-Credential -Credential sa)
            UpdateEnabled          = 'True'
            UpdateSource           = '.\Updates'
            PsDscRunAsCredential   = $Cred#(Get-Credential -Credential avi-dc\operator-attaleb)
            SuppressReboot = $True
            SQLTELSVCACCT  = "NT Service\SQLTELEMETRY$SQLTEST05"
            SQLTELSVCSTARTUPTYPE = "Disabled"
            FTSvcAccount ="NT Service\MSSQLFDLauncher$SQLTEST05"

        }

SQL Server edition and version the target node is running

Microsoft SQL Server 2017 (RTM-CU16) (KB4508218) - 14.0.3223.3 (X64) Jul 12 2019 17:43:08 Copyright (C) 2017 Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Standard 10.0 <X64> (Build 14393: ) (Hypervisor)

SQL Server PowerShell modules present on the target node

Name Version Path


SQLPS 1.0 E:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\SQLPS\SQLPS.psd1

The operating system the target node is running

OsName : Microsoft Windows Server 2016 Standard OsOperatingSystemSKU : StandardServerEdition OsArchitecture : 64-bit WindowsBuildLabEx : 14393.3143.amd64fre.rs1_release.190725-1725 OsLanguage : en-US OsMuiLanguages : {en-US}

Version and build of PowerShell the target node is running

Name Value


PSVersion 5.1.14393.3053 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14393.3053 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

Name Version Path


SqlServerDsc 12.5.0.0 C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\SqlServerDsc.psd1

kattaleb avatar Sep 24 '19 11:09 kattaleb

Those arguments for setup.exe are yet to be added. But should be relatively easy for someone to add those.

Running setup.exe /? shows three arguments.

image

So these parameters should be supported in the resource.

  • TelSvcAccount
  • TelSvcStartupType

johlju avatar Sep 25 '19 15:09 johlju

I am willing to contribute and add those... Can you please point me to some documentation on how to start?

kattaleb avatar Sep 25 '19 15:09 kattaleb

I updated my previous comment with the correct parameter names.

A good source would be here: https://github.com/PowerShell/SqlServerDsc/blob/dev/CONTRIBUTING.md

If you are new to git and GitHub then this is a good starting point: https://github.com/PowerShell/DscResources/blob/master/GettingStartedWithGitHub.md

And if you are new to writing tests then look at this: https://github.com/PowerShell/DscResources/blob/master/GettingStartedWithPester.md

If you get stuck at any point, tag me either here in the issue or in the Slack channel: https://dsccommunity.org/community/contact/

For this change I would suggest looking at the existing parameters that are similar to these new parameters, like

https://github.com/PowerShell/SqlServerDsc/blob/da8ebe4539018c059bfb6ddbb4cf2bd9ca0ffc9d/DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1#L857-L859

https://github.com/PowerShell/SqlServerDsc/blob/da8ebe4539018c059bfb6ddbb4cf2bd9ca0ffc9d/DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1#L961-L964

On top of that we should add a Read-only property too in the schema.mof similar to this which is set in the Get-TargetResource function.

https://github.com/PowerShell/SqlServerDsc/blob/da8ebe4539018c059bfb6ddbb4cf2bd9ca0ffc9d/DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.schema.mof#L23

johlju avatar Sep 25 '19 16:09 johlju

Did this ever happen?

theonesmitty avatar May 02 '22 18:05 theonesmitty

No, there have not been a PR for this yet. Happy to review one though. 🙂

johlju avatar May 02 '22 19:05 johlju