Skip to content

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

Closed

Description

@cnilak
    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'
}

Activity

  1. johlju commented on Jul 14, 2018

    @johlju
    Member

    You must enable AG with SqlAlwaysOnService resource.

  2. stale commented on Aug 13, 2018

    @stale

    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.

  3. added
    staleThe issue or pull request was marked as stale because there hasn't been activity from the community.
    on Aug 13, 2018
  4. SphenicPaul commented on Aug 23, 2018

    @SphenicPaul
    Contributor

    I ran into this issue today.

    Is it not worth adding this to the example here ?

  5. removed
    staleThe issue or pull request was marked as stale because there hasn't been activity from the community.
    on Aug 23, 2018
  6. johlju commented on Aug 24, 2018

    @johlju
    Member

    @SphenicPaul absolutely, great suggestion! 😃

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

  7. added
    help wantedThe issue is up for grabs for anyone in the community.
    documentationThe issue is related to documentation only.
    good first issueThe issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub
    and removed
    questionThe issue is a question.
    on Aug 24, 2018
  8. self-assigned this
    on Sep 6, 2018
  9. removed
    help wantedThe issue is up for grabs for anyone in the community.
    on Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationThe issue is related to documentation only.good first issueThe issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions