Correct use of sourcepath parameter in xSQLServerSetup resource

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Daniel Krebs Daniel Krebs 2 months, 3 weeks ago.

  • Author
    Posts
  • #70249
    Profile photo of Jim Bendtsen
    Jim Bendtsen
    Participant

    I currently am able to do a DSC setup of SQL 2016 by specifically copying a configuration.ini and sql2016.iso from a UNC location to the destination node using File resources, then using a Script resource to mount the .iso and run setup. The get/test in the script resource is only for "is the SQL Service installed or not". This gets the job done, but doesn't give me much granularity in my test/set/get for subsequent checks. I'm trying to change the DSC script to use the xSQLServerSetup resource, so I can gain the tests for more of the configuration options available in the resource, as below.

    xSQLServerSetup 'InstallNamedInstance_IN01'
    {
    InstanceName = 'IN01'
    Features = 'SQLENGINE,TOOLS'
    SQLCollation = 'SQL_Latin1_General_CP1_CI_AS'
    SQLSVCACCOUNT = "NT Service\MSSQL$IN01"
    AGTSVCACCOUNT = "NT Service\SQLAgent$IN01"
    SQLSYSADMINACCOUNTS = "MyDomain\Server_Local_Admins" "MyDomain\MSSQL_Admins"
    SetupCredential = $SqlInstallCredential
    SECURITYMODE = "SQL"
    InstallSharedDir = 'F:\Program Files\Microsoft SQL Server'
    InstallSharedWOWDir = 'F:\Program Files (x86)\Microsoft SQL Server'
    InstanceDir = 'F:\Program Files\Microsoft SQL Server'
    InstallSQLDataDir = 'F:\Program Files\Microsoft SQL Server\MSSQL13.INST2016\MSSQL\Data'
    SourcePath = "\\myPSDSCServer\dsc\sql_installs\SW_DVD9_NTRL_SQL_Svr_Ent_Core_2016_64Bit_English_OEM_VL_X20-97253.ISO"
    SourceCredential = $SqlInstallCredential
    UpdateEnabled = 'False'
    ForceReboot = $false
    BrowserSvcStartupType = 'Automatic'
    DependsOn = "[WindowsFeature]NET-Framework-Core"
    }
    The documentation online says

    [String] SourcePath (Write): The path to the root of the source files for installation. I.e and UNC path to a shared resource. Environment variables can be used in the path.

    [PSCredential] SourceCredential (Write): Credentials used to access the path set in the parameter SourcePath. Using this parameter will trigger a copy of the installation media to a temp folder on the target node. Setup will then be started from the temp folder on the target node. For any subsequent calls to the resource, the parameter SourceCredential is used to evaluate what major version the file 'setup.exe' has in the path set, again, by the parameter SourcePath. To know how the temp folder is evaluated please read the online documentation for System.IO.Path.GetTempPath(). If the path, that is assigned to parameter SourcePath, contains a leaf folder, for example '\server\share\folder', then that leaf folder will be used as the name of the temporary folder. If the path, that is assigned to parameter SourcePath, does not have a leaf folder, for example '\server\share', then a unique GUID will be used as the name of the temporary folder.

    My question is about the "sourcepath" parameter. What is expected to be in this line:

    SourcePath = "\\myPSDSCServer\dsc\sql_installs\SW_DVD9_NTRL_SQL_Svr_Ent_Core_2016_64Bit_English_OEM_VL_X20-97253.ISO"
    or
    SourcePath = "\\myPSDSCServer\dsc\sql_installs\" (with only the .iso in this directory?)
    or
    SourcePath = "\\myPSDSCServer\dsc\sql_installs\" (with the expanded setup directory contents from the .iso?)

    03/23/2017 11:02 AM 1033_ENU_LP
    02/09/2016 10:38 PM 45 autorun.inf
    04/30/2016 11:13 PM 542 MediaInfo.xml
    03/23/2017 11:26 AM redist
    03/23/2017 11:28 AM resources
    04/30/2016 11:12 AM 109,248 setup.exe
    02/09/2016 10:34 PM 344 setup.exe.config
    04/30/2016 11:12 AM 239,296 SqlSetupBootstrapper.dll
    04/30/2016 11:12 AM 150,216 sqmapi.dll
    03/23/2017 11:18 AM Tools
    03/23/2017 12:08 PM x64

  • #70262
    Profile photo of Daniel Krebs
    Daniel Krebs
    Moderator

    Hi Jim,

    The resource expects the expanded iso contents. It will append setup.exe to the source path you specify (e.g. \\myPSDSCServer\dsc\sql_installs\setup.exe).

    – Daniel

You must be logged in to reply to this topic.