Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xSQLServerSetup: Install SQL Server 2012 on Windows Server 2008 R2, please help. #653

Closed
ptoluganti opened this issue Jun 21, 2017 · 18 comments

Comments

@ptoluganti
Copy link

ptoluganti commented Jun 21, 2017

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

Trying to Install SQL server 2012 on Windows Server 2008 R2 SP1. Below are the exception details i am getting.

PowerShell DSC resource MSFT_xSQLServerSetup failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after calling set.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost

The term 'Get-ScheduledTask' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
+ CategoryInfo : ObjectNotFound: (Get-ScheduledTask:) [], CimException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost

The DSC configuration that is using the resource (as detailed as possible):

 xSQLServerSetup 'InstallNamedInstance-INST1'
        {
            InstanceName = 'INST1'
            Features = "SQLENGINE,BIDS,CONN,IS,SSMS,ADV_SSMS"            
            SQLSvcAccount = $SqlServiceCredential
            AgtSvcAccount = $SqlServiceCredential
            SQLSysAdminAccounts = $SqlInstallCredential.UserName,
            
            SourcePath = 'F:\SQL2012_x64_ENU'            
            UpdateEnabled = 'False'
            ForceReboot = $false
            BrowserSvcStartupType = 'Automatic'

            PsDscRunAsCredential = $SqlInstallCredential
            SetupCredential = $SqlInstallCredential
            
            SuppressReboot = $False      
        }

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
OS : Windows Server 2008 r2
SQL Server 2012 with SP3

Powershell : 5

What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:

XSQLServer module version : 7.1.0.0

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

@johlju
Copy link
Member

johlju commented Jun 21, 2017

Usually that error message mean that setup was run, but when Test-TargetResource function is verifying if all features are installed it does not find all features installed.
In this case it is BIDS when is unfortunately not yet supported.

Please see issue #69. If you know how we can detect if BIDS is installed on SQL Server 2008 R2 then please comment on issue #69 and we will get the that functionality in sooner. Or better yet, if you like to contribute that change, you are more than welcome. 😄

@johlju johlju added the question The issue is a question. label Jun 21, 2017
@ptoluganti
Copy link
Author

Thank you, very useful.

xSQLServer version 7.1.0.0, Get-ScheduledTask cmdlet is used in xPDT module. In Windows server 2008 r2 Get-ScheduledTask cmdlet could not found. Which is shown in exception, may be this is know issue and DEV version of xSQLServer does not have this problem.

The term 'Get-ScheduledTask' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

  • CategoryInfo : ObjectNotFound: (Get-ScheduledTask:) [], CimException
  • FullyQualifiedErrorId : CommandNotFoundException
  • PSComputerName : localhost

@johlju
Copy link
Member

johlju commented Jun 22, 2017

Ah, I actually did not now that it was used in that module!

The module xPDT has been removed in the next release, so I you want to test it today, please download the dev version from here.

Please let me know if the Dev version solves your issue.

@ptoluganti
Copy link
Author

Yes, Dev version solved problem. Does Dev version support SNAC_SDK?

@johlju
Copy link
Member

johlju commented Jun 22, 2017

Happy that it solved the issue.

SDK is supported, but not SNAC_SDK. SNAC_SDK was discussed here, and I was under the expression that it could not be added in the feature list? See issue #516.

And I can't find it in this article Feature Parameters; https://technet.microsoft.com/en-US/library/ms144259(v=sql.105).aspx#Anchor_11

@ptoluganti
Copy link
Author

Thank youthe above link is for SQL Server 2008 r2.

Below is the link for SQL Server 2012,
SNAC_SDK
Installs SDK for Microsoft SQL Server Native Client
SDK
Installs the software development kit.

https://technet.microsoft.com/en-us/library/ms144259(v=sql.110).aspx#Feature Parameters

@ptoluganti
Copy link
Author

below code worked for me to check what FEATURES are installed, i have added below code in
MSFT_xSQLServerSetup -> Get-TargetResource.

i have installed "SQLENGINE,BIDS,CONN,IS,BOL,SSMS,ADV_SSMS,SNAC_SDK"

if(Test-Path "$env:programfiles\Microsoft SQL Server$($sqlVersion)0\Setup Bootstrap")
{
$file = Get-ChildItem -Path "$env:programfiles\Microsoft SQL Server$($sqlVersion)0\Setup Bootstrap\Log" -Filter ".ini" -Recurse | Select-String -pattern "INSTANCENAME="$InstanceName"" | select -Property Path
if($file -ne $null)
{
$features = (Select-String $file.Path -pattern "FEATURES=" -CaseSensitive).Line.Replace("FEATURES=", "")
}
}

@johlju
Copy link
Member

johlju commented Jun 22, 2017

My bad! I don't know what I was thinking looking at SQL Server 2008 R2. Sorry! 😄

I'm glad it worked out for you!

That logic might work the first time, but what happens if you would add a feature after installation? Would it still list all features in the FEATURES property of the ConfigurationFile.ini file?
It need to be a solution that is capable to see if the feature is installed each time it's tested for.

I will open a new issue for this.

@johlju
Copy link
Member

johlju commented Jun 22, 2017

I opened issue #655.

@johlju
Copy link
Member

johlju commented Jun 22, 2017

@ptoluganti I tested now, and that file is created as soon as the setup is started. Which means ii will detect that the feature is installed even when setup has failed. :/

@ptoluganti
Copy link
Author

ptoluganti commented Jun 23, 2017

@johlju , thank you very much helping. your are right looking at configurationfile.ini may only help if we are trying for fresh install. I think it is complicated to parse detail.txt and try to analyse if the installation is succeeded.
https://docs.microsoft.com/en-us/sql/database-engine/install-windows/view-and-read-sql-server-setup-log-files#detailtxt

also i was trying to sees if BIDS is installed the following way, i am still testing this.

Check if BIDS in installed

$BIDSRegistryPath = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server$($sqlVersion)0\BIDS\*"

$isBIDSInstalled = (Get-ItemProperty -Path $BIDSRegistryPath -ErrorAction SilentlyContinue)
if ($isBIDSInstalled)
{
$features += 'BIDS,'
}
else
{
"BIDS Not found"
}

@johlju
Copy link
Member

johlju commented Jun 23, 2017

A suggestion is to use a "registry compare":er (I use RegShot64 2.0.x.x). Then you can snapshot the registry prior of installing, then another snapshot after the install is finished, and then the tool compares what keys was changed, added or removed.

@johlju
Copy link
Member

johlju commented Jun 23, 2017

Let me know if you find a working solution and I can help verify it. 😄 Would be awesome if we could get support for BIDS.

Also, I had a suggestion for SNAC_SDK in the new issue I submitted (issue #655).

@ptoluganti
Copy link
Author

@johlju , below xSQLServerSetup worked for me. and BITS is installed.

VERBOSE: [TS-DB1]: [[xSQLServerSetup]InstallNamedInstance-INST1] Features found: SQLENGINE,BIDS

xSQLServerSetup 'InstallNamedInstance-INST1'
{
InstanceName = 'INST1'
Features = "SQLENGINE,BIDS"
SQLSvcAccount = $SqlServiceCredential
AgtSvcAccount = $SqlServiceCredential
ISSvcAccount = $SqlServiceCredential
SQLSysAdminAccounts = "BUILTIN\Administrators"

        SourcePath = "\\$env:COMPUTERNAME\SQL2012_x64_ENU"
        UpdateEnabled = 'False'
        ForceReboot = $false
        BrowserSvcStartupType = 'Automatic'

        PsDscRunAsCredential = $SqlInstallCredential
        
        SuppressReboot = $False
    }

@johlju
Copy link
Member

johlju commented Jun 23, 2017

So I guess that means that the registry path 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server$($sqlVersion)0\BIDS' is created when BIDS is installed?

@ptoluganti
Copy link
Author

Yes, below are the registry paths created.

HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\110\BIDS
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\110\BIDS\Setup
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\110\BIDS\Setup\SQL_BIDS_Full
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\110\BIDS\Setup\SQL_BIDS_Full\1033

Registry Key:
FeatureList has value SQL_BIDS_Full=3 SQL_WarehouseDevWorkbench_FNS=3

@johlju
Copy link
Member

johlju commented Jun 23, 2017

Thanks @ptoluganti! I updated the issue #69 with your code suggestion, so lets track it in issue #69.

Do you feel up to contributing and sending in a PR with the code change to this module? 😄 If so, update the issue #69 so I know you are working on it.

Can we close this issue now? Or is there any other problems? 😄

@ptoluganti
Copy link
Author

Yes, we can close the issue. thank you :)

@vors vors removed the question The issue is a question. label Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants