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

SqlSetup: Problem doing cluster install when SourePath is an UNC path #408

Open
johlju opened this issue Feb 26, 2017 · 3 comments
Open
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.

Comments

@johlju
Copy link
Member

johlju commented Feb 26, 2017

Details of the scenario you try and problem that is occurring:
This is a problem when SourcePath is an UNC share when doing cluster install.

Three scenarios I tried to get cluster install. Credentials parameters involved SetupCredential, SourceCredential and PsDscRunAsCredential. Only Scenario 3 worked.

Scenario 1.

Using only parameter SetupCredential. It is not allow to access the UNC path becuase it is running as SYSTEM.

VERBOSE: [SQLTEST4]:                            [[xSQLServerSetup]InstallSQL2014Instance] 2017-02-26_10-27-07: Using path: \\fileserver.company.local\images\SQL2014SP1-ENT\setup.exe
Access is denied

Scenario 2.

Using both parameter PsDscRunAsCredential, to access the UNC share, and parameter SetupCredential, because the setup.exe process is started using these credentials. But those credential in PsDscRunAsCredential did not have rights (to impersonate) so the setup.exe process could start and failed with error "The process could not be created. Create process as user error #1314".

VERBOSE: [SQLTEST4]: LCM:  [ End    Set      ]  [[xSQLServerSetup]InstallSQL2014Instance]  in 2.2910 seconds.
PowerShell DSC resource MSFT_xSQLServerSetup  failed to execute Set-TargetResource functionality with error message: Exception calling "CreateProcessAsUser" with "4" argument(s): "The process could not be created. Create process as user error #1314" 
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure
    + PSComputerName        : sqltest4.company.local

It is a guess that is the rights that are the problem, but if it is there might be a workaround to give those permissions, see this article http://stackoverflow.com/questions/1475577/createprocessasuser-error-1314.

Scenario 3.

Using both parameter SourceCredential, to copy media locally, and parameter `SetupCredential, because the setup.exe process is started using these credentials.
This scenario worked!

VERBOSE: [SQLTEST4]:                            [[xSQLServerSetup]InstallSQL2014Instance] 2017-02-26_10-47-30: Process matching path 'C:\Windows\TEMP\SQL2014SP1-ENT\setup.exe' started in process ID 7024

The DSC configuration that is using the resource (as detailed as possible):
Configuration from working scenario 3.

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

    SourcePath = '\\fileserver.company.local\images\SQL2014SP1-ENT'
    UpdateEnabled = 'False'

    SetupCredential = $SqlInstallCredential
    SourceCredential = $SqlInstallCredential

    InstanceName = 'SQL2014'
    Features = 'SQLENGINE,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'

    FailoverClusterNetworkName = 'TESTCLU01'
    FailoverClusterIPAddress = '192.168.0.10'
    FailoverClusterGroupName = 'TESTCLU01A'

    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, PowerShell 5.0

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

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Feb 26, 2017
@johlju
Copy link
Member Author

johlju commented Feb 26, 2017

I hope when #405 is solved this will be solved as well.

@johlju
Copy link
Member Author

johlju commented May 25, 2017

Scenario 2 could have been resolved with higher rights.

If both PsDscRunAsCredential and SetupCredential is assigned credentials, then the credentials assigned to PsDscRunAsCredential must have the access right 'Replace a process level token'.

If this access right 'Replace a process level token' is not set, starting the process will fail with the following error message.

Exception calling "CreateProcessAsUser" with "5" argument(s): "Create process as user error #1314".

@johlju
Copy link
Member Author

johlju commented May 25, 2017

Now there is a new scenario with PR #578 that should be made to work.

Scenarion 4.

Using both parameters PsDscRunAsCredential and SourceCredential, if PsDscRunAsCredential doesn't have the permission directly to the UNC path, and other credentials must be used to access the UNC path, or the SYSTEM account is used to install, then SourceCredential should be able to work either running as system, or together with PsDscRunAsCredential.

@johlju johlju changed the title xSQLServerSetup: Problem doing cluster install when SourePath is an UNC path SqlSetup: Problem doing cluster install when SourePath is an UNC path Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

1 participant