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: Unable to map disks when adding a feature to cluster install #433

Closed
johlju opened this issue Mar 10, 2017 · 2 comments · Fixed by #438
Closed

xSQLServerSetup: Unable to map disks when adding a feature to cluster install #433

johlju opened this issue Mar 10, 2017 · 2 comments · Fixed by #438
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented Mar 10, 2017

Details of the scenario you try and problem that is occurring:
When adding SSAS to a already installed instance, and at the same time using the same disks for the paths for SSAS. Then the resource can not map the paths to the correct drives.

PowerShell DSC resource MSFT_xSQLServerSetup  failed to execute Set-TargetResource functionality with error message: Unable to map the specified paths to valid cluster storage. Drives mapped:  
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure

This is because it only looks at available storage, not storage already being used (if any).
https://github.com/PowerShell/xSQLServer/blob/dev/DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1#L954

It should also evaluate at any existing disks in the cluster group $FailoverClusterNetworkName. For example using the below code.

if( Get-CimInstance -Namespace 'root/MSCluster' -ClassName 'MSCluster_ResourceGroup' -Filter "Name = '$FailoverClusterNetworkName'" )
{
	$availableStorage += Get-CimInstance -Namespace 'root/MSCluster' -ClassName 'MSCluster_ResourceGroup' -Filter "Name = 'TESTCLU01A'" | `
                            Get-CimAssociatedInstance -Association MSCluster_ResourceGroupToResource -ResultClassName MSCluster_Resource | Where-Object -FilterScript {$_.Type -eq 'Physical Disk'} | `
                            Add-Member -MemberType NoteProperty -Name 'IsPossibleOwner' -Value $false -PassThru
}

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

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 johlju added enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone. labels Mar 10, 2017
@johlju
Copy link
Member Author

johlju commented Mar 10, 2017

Okay, so I tried to fix the above, that did not work. Seems I need new disk for adding the SSAS feature. I thought I could leverage the same disks which are used by the same instance. Or does it think I want to install "a new instance" with the same name. 🤔

Exception type: Microsoft.SqlServer.Chainer.Infrastructure.InputSettingValidationException
    Message: 
        The specified disk resource 'SQL2016-DATA' cannot be used as a failover cluster disk.  Reason: The disk resource 'SQL2016-DATA' is already in use by resource 'SQL Server (SQL2014)'. To use a disk in a new SQL Server failover cluster instance, the disk must not have any dependencies that reference it.
    HResult : 0x84b40002
        FacilityCode : 1204 (4b4)
        ErrorCode : 2 (0002)
    Data: 
      SQL.Setup.FailureCategory = InputSettingValidationFailure
      DisableWatson = true
    Stack: 
        at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.LogAllValidationErrorsAndThrowFirstOne(ValidationState vs)
        at Microsoft.SqlServer.Configuration.SetupExtension.ValidateFeatureSettingsAction.ExecuteAction(String actionId)
        at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
        at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.<>c__DisplayClasse.<ExecuteActionWithRetryHelper>b__b()
        at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(ActionWorker workerDelegate)

@johlju
Copy link
Member Author

johlju commented Mar 10, 2017

Well, this article answers the question... You cannot add or remove features to a SQL Server 2008, SQL Server 2008 R2, or SQL Server 2012 failover cluster

Guess that goes for SQL 2014 and 2016 as well.

@johlju johlju closed this as completed Mar 10, 2017
johlju added a commit to johlju/SqlServerDsc that referenced this issue Mar 11, 2017
Added a note to the README.md saying that it is not possible to add or remove features from a SQL Server failover cluster (issue dsccommunity#433).
Changed so that it reports false if the desired state is not correct (issue dsccommunity#432).
johlju added a commit to johlju/SqlServerDsc that referenced this issue Mar 13, 2017
Added a note to the README.md saying that it is not possible to add or remove features from a SQL Server failover cluster (issue dsccommunity#433).
Changed so that it reports false if the desired state is not correct (issue dsccommunity#432).
johlju added a commit to johlju/SqlServerDsc that referenced this issue Mar 25, 2017
Added a note to the README.md saying that it is not possible to add or remove features from a SQL Server failover cluster (issue dsccommunity#433).
Changed so that it reports false if the desired state is not correct (issue dsccommunity#432).
johlju added a commit that referenced this issue Mar 25, 2017
#438)

- Changes to xSQLServerSetup
  - Added a note to the README.md saying that it is not possible to add or remove features from a SQL Server failover cluster (issue #433).
  - Changed so that it reports false if the desired state is not correct (issue #432).
    - Added a test to make sure we always return false if a SQL Server failover cluster is missing features.
  - Helper function Connect-SQLAnalysis
    - Now has correct error handling, and throw does not used the unknown named parameter '-Message' (issue #436)
    - Added tests for Connect-SQLAnalysis
    - Changed to localized error messages.
    - Minor changes to error handling.
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Mar 25, 2017
@johlju johlju removed their assignment Mar 25, 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant