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

MSFT_SqlAGReplica failed to execute Set-TargetResource functionality with error message: HADR is not enabled #1182

Closed
cnilak opened this issue Jul 12, 2018 · 4 comments · Fixed by #1208
Assignees
Labels
documentation The issue is related to documentation only. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub

Comments

@cnilak
Copy link

cnilak commented Jul 12, 2018

    SqlServerLogin AddNTServiceClusSvc
    {
        Ensure               = 'Present'
        Name                 = 'NT SERVICE\ClusSvc'
        LoginType            = 'WindowsUser'
        ServerName           = $SqlNode
        InstanceName         = "MSSQLSERVER"
        PsDscRunAsCredential = $SqlInstallCredential
    }

    # Add the required permissions to the cluster service login
    SqlServerPermission AddNTServiceClusSvcPermissions
    {
        DependsOn            = '[SqlServerLogin]AddNTServiceClusSvc'
        Ensure               = 'Present'
        ServerName           = $SqlNode
        InstanceName         = "MSSQLSERVER"
        Principal            = 'NT SERVICE\ClusSvc'
        Permission           = 'AlterAnyAvailabilityGroup', 'ViewServerState'
        PsDscRunAsCredential = $SqlInstallCredential
    }

    SqlServerEndpoint HADREndpoint
    {
        EndPointName         = 'HADR'
        Ensure               = 'Present'
        Port                 = $portNumber
        ServerName           = $SqlNode
        InstanceName         = "MSSQLSERVER"
        PsDscRunAsCredential = $SqlInstallCredential
    }

SqlAGReplica AddReplica
{
Ensure = 'Present'
Name = $SqlNode
AvailabilityGroupName = $avgGroupName
ServerName = $SqlNode
InstanceName = "MSSQLSERVER"
PrimaryReplicaServerName = $SqlPrimaryReplicaNode
PrimaryReplicaInstanceName = "MSSQLSERVER"
PsDscRunAsCredential = $SqlInstallCredential
DependsOn = '[SqlSetup]InstallDefaultInstance'
}

@johlju
Copy link
Member

johlju commented Jul 14, 2018

You must enable AG with SqlAlwaysOnService resource.

@johlju johlju added the question The issue is a question. label Jul 14, 2018
@stale
Copy link

stale bot commented Aug 13, 2018

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.

@stale stale bot added the stale The issue or pull request was marked as stale because there hasn't been activity from the community. label Aug 13, 2018
@SphenicPaul
Copy link
Contributor

I ran into this issue today.

Is it not worth adding this to the example here ?

@stale stale bot removed the stale The issue or pull request was marked as stale because there hasn't been activity from the community. label Aug 23, 2018
@johlju
Copy link
Member

johlju commented Aug 24, 2018

@SphenicPaul absolutely, great suggestion! 😃

If someone wants to send in a PR for that, I'm happy to review it.

@johlju johlju added help wanted The issue is up for grabs for anyone in the community. documentation The issue is related to documentation only. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub and removed question The issue is a question. labels Aug 24, 2018
@johlju johlju self-assigned this Sep 6, 2018
johlju pushed a commit that referenced this issue Sep 6, 2018
- Changes to SqlAg, SqlAGDatabase, and SqlAGReplica examples
  - Included configuration for SqlAlwaysOnService to enable
    HADR on each node to avoid confusion (issue #1182).
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue is related to documentation only. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub
Projects
None yet
3 participants