-
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
xSQLServerSetup: Add support for clustered installations (Fixes #227) #326
Conversation
@nabrond Awesome! Waited for this one. 😄 I'm gonna review this one during the weekend. |
Like the way you improved the tests! 👍 Reviewed 3 of 6 files at r1, 1 of 3 files at r3. README.md, line 754 at r3 (raw file):
Missing the Action parameter here. Please see the parameter 'BrowserSvcStartupType' for format. README.md, line 796 at r3 (raw file):
Please add the type qualifier (Write) for all these new parameters. See format on the previous. Also, please end the sentences with a full stop ('.'). DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.schema.mof, line 4 at r3 (raw file):
There is an extra white space between ] and 'String Action' DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.schema.mof, line 51 at r3 (raw file):
Please end the sentence with a full stop ('.'). DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.schema.mof, line 52 at r3 (raw file):
Please end the sentence with a full stop ('.'). Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 102 at r3 (raw file):
This row should not be needed any more. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 702 at r3 (raw file):
Single hastag and start chnage to 'Break' (upper 'B') Comments from Reviewable |
Thanks for the feedback on the test changes @johlju! I wanted to convert the setup arguments array to a hashtable and needed a reliable method for testing command line arguments since there was no guaranteed order. I took care of the comments you have made so far and went ahead and cleaned up some of the stylistic problems across all files. If you can get through the rest of the code this weekend, I hope we can close this PR out this week and move on! Review status: 4 of 6 files reviewed at latest revision, 7 unresolved discussions. README.md, line 754 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 796 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.schema.mof, line 4 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.schema.mof, line 51 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.schema.mof, line 52 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 102 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 702 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. This will be an issue all over my code. The double hash is a habit I cannot seem to break! Comments from Reviewable |
I will make sure to get thru the review today. That is my plan at least. 😄 A few comments to get things started. Reviewed 2 of 4 files at r4. README.md, line 754 at r3 (raw file): Previously, nabrond (Brandon) wrote…
The tests faild on the README.md. Please resolve these errors. README.md: 754: MD022 Headers should be surrounded by blank lines README.md, line 755 at r4 (raw file):
Please add white space after { and before } I make an issue to get this format into the specific contribution guidelines. Comments from Reviewable |
Review status: 4 of 6 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. README.md, line 754 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 755 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Comments from Reviewable |
This is awesome! I like the way you improved the code! I found just small thing, nothing big. Would you be so kind to add examples for each installation option? At least with the minimum required parameters. Then we can improve those examples later. I'm gonna review the tests next. I will take a little break first. A question. have you ran this code in a lab to verify? I do not have cluster disks in my lab at the moment, so can't actually test the cluster bits. I'm hoping you have done that. If not I will install a storage server so I can get some cluster disks. Reviewed 1 of 4 files at r4. README.md, line 414 at r4 (raw file):
Could you add to the description that this resource is deprecated and will be removed at a later time and will be replaced by xSQLServerSetup. README.md, line 796 at r4 (raw file):
Could we call this parameter FailOverClusterGroupName instead? README.md, line 797 at r4 (raw file):
Type is wrong, should be String[] Please add to the description the format of these IP addresses. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 27 at r4 (raw file):
These should not be here, since they are (correctly) not parameters in the Get-method :) DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 169 at r4 (raw file):
We should also check for resource "Analysis Services (INSTANCENAME)" if Analysis Services is installed in a Cluster Group without Database Engine. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 172 at r4 (raw file):
It shouldn't throw error here? It it should be clustered but there are no resources? DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 636 at r4 (raw file):
Does ParameterSetName fill any purpose other than to visualize (to Group) the parameters for Cluster together? DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 788 at r4 (raw file):
Please change the variable $setupArgs to $setupArguments. Let's avoid abbreviations. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 792 at r4 (raw file):
DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 803 at r4 (raw file): Could this be used on the pipeline instead? Then you don't have to trim, and Select-Object -Unique is case-sensitive (C: and c: is not the same).
DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 807 at r4 (raw file):
Could we make use of the cmdlet Get-ClusterAvailableDisk? Then we don't have to make sure we keep up with all edge case that this will fail? At a minimum you should only return Resource Type 'Physical Disk' (?). DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 826 at r4 (raw file):
Same issue with case-sensitivity here? Use Sort-Object instead? DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 829 at r4 (raw file):
Thought. Do you really need Measure-Object? DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 830 at r4 (raw file):
Same thought about Measure-Object as above. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 841 at r4 (raw file):
Typo here 'Determine' DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 846 at r4 (raw file):
Please add to the parameter description in the README (and comment-based help) that this is the case, when not specified it uses DHCP on the first client network. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 847 at r4 (raw file):
Same thought about Measure-Object as above. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 872 at r4 (raw file):
Same thought about Measure-Object as above. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 873 at r4 (raw file):
Same thought about Measure-Object as above. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 875 at r4 (raw file):
Add to the comment DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1004 at r4 (raw file):
Please change $setupArg to $currentSetupArgument so it is easily distinguished from $setupArguments. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1007 at r4 (raw file):
Brace has moved one indent to far. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1012 at r4 (raw file):
Write out the variable name '$setupArgumentValue' DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1060 at r4 (raw file):
Add a new row above this row? Then Trim() can be remove from this and the one below. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1410 at r4 (raw file):
Maybe "is not in desired state for this cluster."? DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1582 at r4 (raw file):
Please add an output type. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1662 at r4 (raw file):
Comment-based help says 'AccountType', parameter says 'ServiceType'. I'd like 'AccountType' if I may choose ;) Comments from Reviewable |
Reviewed 1 of 1 files at r5. Comments from Reviewable |
Reviewed 1 of 4 files at r4. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 577 at r5 (raw file):
Please change @mockInstanceName to $mockCurrentInstancename so it is more clear it is dynamically set. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 579 at r5 (raw file):
Please change @mockInstanceName to $mockCurrentInstancename so it is more clear it is dynamically set. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 594 at r5 (raw file):
Remove this blank line Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 707 at r5 (raw file):
Minor: It think this method is faster $null = $argumentHashTable.Add($key, $value) Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 711 at r5 (raw file):
You should also test so there are not to many or to few arguments in the $ArgumentHashTable than $mockStartWin32ProcessExpectedArgument. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 1752 at r5 (raw file):
Please change @mockInstanceName to $mockCurrentInstancename so it is more clear it is dynamically set. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 1769 at r5 (raw file):
This description seems wrong. Maybe it should be "Should collect cluster information for a standalone instance"? Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2259 at r5 (raw file):
Maybe 'Should return that the desired state is present when the correct clustered instance was found'? Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2260 at r5 (raw file):
Please change @mockInstanceName to $mockCurrentInstancename so it is more clear it is dynamically set. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2521 at r5 (raw file):
This needs to be in the new format? Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2584 at r5 (raw file):
This needs to be in the new format? Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2628 at r5 (raw file):
This needs to be in the new format? Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2635 at r5 (raw file):
This needs to be in the new format? Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2643 at r5 (raw file):
This needs to be in the new format? Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2679 at r5 (raw file):
This needs to be in the new format? Comments from Reviewable |
Thanks! I am pretty happy with how it came out. I still need to run this code in my lab yet. I am hoping to get that done this week. Review status: all files reviewed at latest revision, 42 unresolved discussions. README.md, line 414 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 796 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 797 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 27 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 169 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
I will put this in as an issue to be handled in a later PR. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 172 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 636 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Not any more. Removed. Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 788 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 792 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Going to submit an issue on this one. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 803 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 807 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
The cmdlet Get-ClusterAvailableDisk gets disks that are accessible to all nodes in the cluster, but have not yet been registered within the cluster. I believe this task is outside the scope of this resource. I have only ever seen registered, unassigned storage resources (disks, volume groups, etc.) show in "Available Storage". This code is heavily dependent on the class structure within WMI to ensure that resources are not incorrectly associated. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 826 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 829 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. This is another old habit pattern that I need to shake. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 830 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 841 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 846 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 847 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 872 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 873 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 875 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1004 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1007 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1012 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1060 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1410 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1582 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 1662 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 577 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 579 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 594 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 707 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 711 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 1752 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 1769 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
I agree, this is worded incorrectly. Changed to "Should collection information for a clustered instance." Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2259 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2260 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2521 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2584 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2628 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2635 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2643 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2679 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Comments from Reviewable |
You should be happy! Great work! 😄 👍 Reviewed 6 of 6 files at r6. README.md, line 797 at r4 (raw file): Previously, nabrond (Brandon) wrote…
Missing the format of how to provide the IP address. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 169 at r4 (raw file): Previously, nabrond (Brandon) wrote…
That will be fine. Write Done on this comment when you have created an issue. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 792 at r4 (raw file): Previously, nabrond (Brandon) wrote…
That will be fine. Write Done on this comment when you have created an issue. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 807 at r4 (raw file): Previously, nabrond (Brandon) wrote…
Great! Then we leave it as-is. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2628 at r5 (raw file): Previously, nabrond (Brandon) wrote…
This wasn't changed? Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2635 at r5 (raw file): Previously, nabrond (Brandon) wrote…
This neither? :) Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 1749 at r6 (raw file):
On all of these throughout, could we use Comments from Reviewable |
Review status: all files reviewed at latest revision, 7 unresolved discussions. README.md, line 797 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Added a note to use dotted-decimal formatting. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2628 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Nothing to change for this test. Set-TargetResource should throw an exception before StartWin32Process is called and the hashtable compared. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 2635 at r5 (raw file): Previously, johlju (Johan Ljunggren) wrote…
See previous comment. Tests/Unit/MSFT_xSQLServerSetup.Tests.ps1, line 1749 at r6 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Comments from Reviewable |
…imal and Test-IPAddress for validating clustered network configuration.
…ique list; Added check to ensure all drives have been mapped.
…mand line argument string for setup.
…ic. Corrected typo on function.
…imal and Test-IPAddress for validating clustered network configuration.
…mand line argument string for setup.
…ic. Corrected typo on function.
…nd per PSSA; Uncommented setup block for unit testing.
…tResource and all references.
… verbose messages. Capture return values from parameter hashtable additions. Corrected logic issue in Test-TargetResource to properly check cluster values.
…ue "SourceFolder"; Changed FailoverClusterIPAddress to type String.
Review status: all files reviewed at latest revision, 7 unresolved discussions. DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 169 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. (Issue #334) DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1, line 792 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Issue #335. Comments from Reviewable |
Reviewed 1 of 2 files at r7, 2 of 2 files at r8. Comments from Reviewable |
I will do a install in my lab with two single instances, if that still works then I merge this one. Then there is no change to the previous functionality. |
Added support to xSQLServerSetup for clustered installations. Ported code from existing xSQLServerFailoverCluster resource and updated to correct issues and add additional functionality.
This Pull Request (PR) fixes the following issues:
Fixes #227
This change is