-
Notifications
You must be signed in to change notification settings - Fork 225
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
SqlAGReplica: Support automatic seeding #487
Comments
I am unable to locate the seeding_mode property in SMO. So far the only place I've been able to locate it is in sys.availability_replicas. |
Maybe this can be used. "Enable automatic seeding on an existing availability group" and "Stop automatic seeding" in this documentation. I can't seem to find it in SMO either for SQL Server 2016. |
I think the resource xSQLServerAlwaysOnAvailabilityGroup also need to have this parameter? |
I also found this issue that could be good to know about when coding this |
For direct seeding, you must allow database creation on each secondary replica by calling ALTER AVAILABILITY GROUP with the GRANT CREATE ANY DATABASE option. Sorry for all the comments. Just dumping new knowledge from my research. :) I was curious when the property was missing from SMO. :) |
No worries! I've been collecting stuff for this in the back of my head. Once I finish up the AG database resource, I'll wrap back around to this. |
@johlju here is a nice little blog from Mike Fal on how to setup direct seeding. At the end of the blog he points out there is no Powershell or SMO support (like you've already discovered). He does have the T-SQL code to get Direct Seeding going. Hope this helps. http://www.mikefal.net/2016/06/14/tsql2sday-sql-2016-direct-seeding/ |
@randomnote1 Sounds great! Looking forward to both. 😄 @Zuldan Thanks for providing the blog article! |
As of SQL 2017, SMO now contains support for the Seeding mode properties and they work even against down-level managed servers. Since we try to import the SqlServer module, this should make it available even when running locally on down-level servers. The DSC resource should check if the "IsSeedingModeSupported" property exists and is set to $true, and if so set the .SeedingMode property to "Automatic" if it is specified in the resource configuration. Optionally, throw an error if the resource property is supplied as "Automatic" but either IsSeedingModeSupported does not exist or is equal to $false. |
Having this is still desirable.
So for setting up a new AG and adding in other AGs it will all work. For edge cases where SMO is out of date, or the server is unpatched, or down-level, that's not this resource's problem. |
when will this feature become available? |
As soon as someone in the community send in a PR I'm happy to review a change that supports this. This open for anyone in the community to pick up. |
- SqlAg - Added optional parameter `SeedingMode` that will set the SeedingMode for the SQL Server 2016 and higher. This parameter can only be used together with the module _SqlServer_ installed (tested v21.0.17099). The parameter will be ignored if SQLPS module will be used. - SqlAgReplica - Added optional parameter `SeedingMode` that will set the SeedingMode for the SQL Server 2016 and higher (issue #487). This parameter can only be used together with the module _SqlServer_ installed (tested v21.0.17099). The parameter will be ignored if SQLPS module will be used.
Details of the scenario you try and problem that is occurring:
xSQLServerAlwaysOnAvailabilityGroupReplica resource does not set the seeding_mode property in SQL 2016. This needs to be set to support automatic seeding.
The DSC configuration that is using the resource (as detailed as possible):
n/a
Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
all
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
dev
The text was updated successfully, but these errors were encountered: