-
Notifications
You must be signed in to change notification settings - Fork 224
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
SqlSetup: Sets a lot of settings on the sql resource but doesn't enforce consistency #37
Comments
From discussions in different issues in this repository, the conclusion seems to have come to consensus (but not written in stone) that SqlSetup will go against normal DSC resource praxis in the sense it will not enforce consistency of properties set during setup. SqlSetup will only make sure that each component is installed. It will not validate that the component is installed correctly (but I can see the resource being extended to do that). Neither will it validate it the component is working correctly, because if it doesn't, then there are more serious problems, which might only be resolved by reinstall (from the perspective of the resource). That could lead to even worse problems like loss of data. Properties set by SqlSetup resource should be considered as default values, regardless if they were set by the user or by setup.exe, and will be managed by separate resources in this module. Those other resources will enforce consistency. We should reflect this in the documentation. |
I @johlju . I would like to ask you about an issue that I have with consistency in setting my SQL with DSC, and, based on what you said in this post, I would like to know how you think we can get rid of this issue the "right way". Actually, it is pretty easy to "get DSC to crash" for SQL Server. Here's the steps : Next, I tried it with the SQL service stopped, but Disabled: In terms of consistency, is SqlSetup ressource should set the service to Manual or Automatic and restart it? (the information about the services startup type should be in the configuration data, and are currently in process to be added to the SqlSetup ressource (issue #1165) Same thing if the service is Paused. Nothing work because when a service is paused, it can not be started. It should be resumed. The only way that I have right now to face this issue is to start the services a Service ressource before launching SqlSetup, but I causes me another issue when SQL is not installed. So right now the real only way I have is to have a SetScript checking if the services are present, and if they are, start them. That's... not cool. Do you think they're real issues and that SqlSetup should be ajusted to face them? |
I wonder if we can use Service resource in PSDSCResources or xService in xPSDesiredStateConfiguration to set the state of the service prior to running SqlSetup (or any other SqlServerDsc resources). But if the service does not exist Service resource will probably fail 🤔 So I could see that optional parameters to control the state of the services could be added to SqlSetup, or a SqlService resource that will not fail if the services does not exist yet. 🤔 After discussions in their repo it was concluded that SqlSetup should only do what setup.exe can do. So to continue with that approach then we should create a new resource like SqlService. But this could be an exception to the rule, to have a ServiceState optional parameter in the SqlSetup resources. |
Fyi, I am indeed working on the issue #1165 . I am at the testing step and I encountered the error you are reporting with the new parameters SqlSvcStartupType and AsSvcStartuptype when set to "Disabled" (still have to test other combinations though). I have decided to not allow the "Disabled" value for the two parameters. only "Manual" and "Automatic" are allowed. |
I @mdaniou I totally agree with you. The issue #1165 you are working on have not the goal of addressing this flaw. I also agree that you do not permit "Disabled" state as it does not make sense to me to have a SQL Server disabled by DSC. I @johlju I can already answer to you about the Service from PSDSCResources resource because I tried it and here are the issues that I see with it 👍 Based on that, I think that a new resource like SqlService should be created, with the possibility of do the work on a cluster (like SqlServiceAccount resource with ServerName property) (maybe this can be added to the project or do you want me to create a new issue for this one?) This New SqlService feature should handle all parameters of a service (State, Start Mode, User Logon.) |
@mdaniou Totally forgot about you were working on this, sorry! 🙂 I suggest that you allow to use the Disabled startup type in SqlSetup, and then we create a new resource that handle the consistency of that property (like all other properties that SqlSetup (setup.exe) sets). In the meantime, until the new resource exist, using 'Disable' will have the same effects as if one would use it with setup.exe, or if someone manually disables a service after it is installed regardless of startup type on the setup.exe argument. Is this inline with what you are thinking, and will that work with what you working on now? @Francois-Rousseau Could you please add a new issue for a resource proposal for SqlService? |
@johlju I am afraid that this new resource wouldn't created anytime soon. |
@mdaniou and add a unit tests for the option too, but as you say, not to difficult. We can add Disabled later - we should add a separate issue for that though, so it's tracked. |
@johlju Now that I am going forward with testing my changes, it appears that the dsc is failing (well, obviously ...) to performed the final check as long as the SQLENGINE is not on "Automatic" ... Same for AS. So now it doesn't make sense to have SqlSvcStartupType and AsSvcStartupType available for configuration and have for only choice Automatic. What do you think ? |
It’s enough that SqlSetup add the argument to setup.exe with the value the user set in the configuration of SqlSetup, either if that is Disabled, Manual or Automatic. Agree that a new resource should handle the consistency of that property. Since SqlSetup should only do what setup.exe is able to do. |
Thanks for your answer ! |
xSqlSetup sets a lot of settings on the sql resource but doesn't enforce consistency. In test, it checks if all the features are there and if they are it says it's good.
The text was updated successfully, but these errors were encountered: