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

xSQLServerAlwaysOnAvailabilityGroup: Unable to create Availability Group on SQL Server 2014 when SqlServer module is present #772

Closed
johlju opened this issue Aug 18, 2017 · 2 comments
Labels
bug The issue is a bug. external The issue cannot be resolved within the DSC Resource Kit.

Comments

@johlju
Copy link
Member

johlju commented Aug 18, 2017

Details of the scenario you tried and the problem that is occurring:
When using the cmdlet New-SqlAvailabilityGroup, from the SqlServer PowerShell module, to create an availability group on SQL Server 2014, the command fails with the error.
The parameter BasicAvailabilityGroup is not used in the command. Even setting BasicAvailabilityGroup to $false generates this error.

Repro code:

$newReplicaParams = @{
    Name             = 'SQLTEST\SQL2014'
    Version          = 12
    AsTemplate       = $true
    AvailabilityMode = 'AsynchronousCommit'
    EndpointUrl      = "TCP://SQLTEST:5022"
    FailoverMode     = 'Manual'
    BackupPriority   = 50
}

$primaryReplica = New-SqlAvailabilityReplica @newReplicaParams -ErrorAction Stop

$sqlInstanceObject = Get-Item -Path 'SQLSERVER:\SQL\SQLTEST\SQL2014'

$newAvailabilityGroupParams = @{
    InputObject = $sqlInstanceObject
    Name = 'SQLTESTAG1'
    AvailabilityReplica = $primaryReplica
    AutomatedBackupPreference = 'None'
    HealthCheckTimeout = 30000
}

New-SqlAvailabilityGroup @newAvailabilityGroupParams -ErrorAction Stop

Error:

New-SqlAvailabilityGroup : Cannot write property BasicAvailabilityGroup.This property is not available onSQL Server 2014.
At line:1 char:21
+ ...             New-SqlAvailabilityGroup @newAvailabilityGroupParams -Err ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-SqlAvailabilityGroup], UnknownPropertyException
    + FullyQualifiedErrorId : ExecutionFailed,Microsoft.SqlServer.Management.PowerShell.Hadr.NewSqlAvailabilityGroupCommand

The DSC configuration that is using the resource (as detailed as possible):
Any configuration creating an availability group, on SQL Server 2014 with SqlServer PowerShell module installed.

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2012 R2, SQL Server 2014 SP2 CU6, PowerShell 5.0.

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

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

@johlju johlju added the bug The issue is a bug. label Aug 18, 2017
@johlju
Copy link
Member Author

johlju commented Aug 18, 2017

I submitted an issue to SQL Server "Connect"-site New-SqlAvailabilityGroup in SqlServer module fails on SQL Server 2014.

@johlju johlju added the external The issue cannot be resolved within the DSC Resource Kit. label Aug 24, 2017
@johlju
Copy link
Member Author

johlju commented Aug 29, 2017

We got this fixed in the upcoming release of SqlServer.

It's labeled as Resolved on the Connect-site: https://connect.microsoft.com/SQLServer/feedback/details/3139588/new-sqlavailabilitygroup-in-sqlserver-module-fails-on-sql-server-2014

And a comment from @Matteo-T about it in the comment section here; https://www.powershellgallery.com/packages/SqlServer/21.0.17152

Closing this issue since it has been resolved.

@johlju johlju closed this as completed Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. external The issue cannot be resolved within the DSC Resource Kit.
Projects
None yet
Development

No branches or pull requests

1 participant