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

BREAKING CHANGE: xSQLServerNetwork: Currently does not support to set static port when instance was using dynamic ports #534

Closed
johlju opened this issue Apr 30, 2017 · 4 comments · Fixed by #887
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented Apr 30, 2017

Details of the scenario you tried and the problem that is occurring:
Currently to set a static port the dynamic ports must be set to blank. That is not possible today since parameter TcpDynamicPorts only allows to set '0' which means to use dynamic ports.

https://docs.microsoft.com/en-us/sql/tools/configuration-manager/tcp-ip-properties-ip-addresses-tab

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:
n/a

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

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

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Apr 30, 2017
@johlju johlju self-assigned this Apr 30, 2017
@johlju johlju added help wanted The issue is up for grabs for anyone in the community. and removed in progress The issue is being actively worked on by someone. labels Apr 30, 2017
@johlju
Copy link
Member Author

johlju commented Apr 30, 2017

I currently solved this by adding a blank value in the ValidateSet and the schema (it seems to work).

But I think parameter TcpDynamicPorts really should be a [System.Boolean] value parameter, for example UseDynamicPort. That will be a breaking change.

@johlju johlju changed the title xSQLServerNetwork: Currently does not support to set static port when instance was using dynamic ports BREAKING CHANGE: xSQLServerNetwork: Currently does not support to set static port when instance was using dynamic ports Apr 30, 2017
@johlju johlju removed their assignment Apr 30, 2017
johlju added a commit to johlju/SqlServerDsc that referenced this issue May 1, 2017
Now the resource allows to set the parameter TcpDynamicPorts to a blank value (partly fixes issue dsccommunity#534). Setting a blank value for parameter TcpDynamicPorts together with a value for parameter TcpPort means that static port will be used.
Now the resource will not call Alter() in the Set-TargetResource when there is no change necessary (issue dsccommunity#537).
Updated example 1-EnableTcpIpOnCustomStaticPort.
Added unit tests (issue dsccommunity#294).
@johlju johlju added the breaking change When used on an issue, the issue has been determined to be a breaking change. label May 1, 2017
johlju added a commit to johlju/SqlServerDsc that referenced this issue May 1, 2017
Now the resource allows to set the parameter TcpDynamicPorts to a blank value (partly fixes issue dsccommunity#534). Setting a blank value for parameter TcpDynamicPorts together with a value for parameter TcpPort means that static port will be used.
Now the resource will not call Alter() in the Set-TargetResource when there is no change necessary (issue dsccommunity#537).
Updated example 1-EnableTcpIpOnCustomStaticPort.
Added unit tests (issue dsccommunity#294).
johlju added a commit to johlju/SqlServerDsc that referenced this issue May 20, 2017
Now the resource allows to set the parameter TcpDynamicPorts to a blank value (partly fixes issue dsccommunity#534). Setting a blank value for parameter TcpDynamicPorts together with a value for parameter TcpPort means that static port will be used.
Now the resource will not call Alter() in the Set-TargetResource when there is no change necessary (issue dsccommunity#537).
Updated example 1-EnableTcpIpOnCustomStaticPort.
Added unit tests (issue dsccommunity#294).
johlju added a commit that referenced this issue May 21, 2017
- Changes to xSQLServerNetwork
  - Added optional parameter SQLServer with default value of $env:COMPUTERNAME (issue #528).
  - Added optional parameter RestartTimeout with default value of 120 seconds.
  - Now the resource supports restarting a sql server in a cluster (issue #527 and issue #455).
  - Now the resource allows to set the parameter TcpDynamicPorts to a blank value (partly fixes issue #534). Setting a blank value for parameter TcpDynamicPorts together with a value for parameter TcpPort means that static port will be used.
  - Now the resource will not call Alter() in the Set-TargetResource when there is no change necessary (issue #537).
  - Updated example 1-EnableTcpIpOnCustomStaticPort.
  - Added unit tests (issue #294).
  - Refactored some of the code, cleaned up the rest and fixed PSSA rules warnings (issue #261).
  - If parameter TcpDynamicPort is set to '0' at the same time as TcpPort is set the resource will now throw an error (issue #535).
  - Added examples (issue #536).
  - When TcpDynamicPorts is set to '0' the Test-TargetResource function will no longer fail each time (issue #564).
- Changes to xSQLServerHelper module
  - Added four new helper functions.
    - Register-SqlSmo, Register-SqlWmiManagement and Unregister-SqlAssemblies to handle the creation on the application domain and loading and unloading of the SMO and SqlWmiManagement assemblies.
    - Get-SqlInstanceMajorVersion to get the major SQL version for a specific instance.
  - Fixed typos in comment-based help
@johlju
Copy link
Member Author

johlju commented Oct 5, 2017

Should the parameter TcpDynamicPorts be renamed to TcpDynamicPort (singular) since we do a breaking change regardless?

@nabrond
Copy link
Contributor

nabrond commented Oct 10, 2017

@johlju I will take a stab at updating this resource.

@johlju
Copy link
Member Author

johlju commented Oct 10, 2017

Awesome! Labeling it as in progress. Thanks! 😄

@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Oct 10, 2017
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Oct 17, 2017
johlju pushed a commit that referenced this issue Oct 17, 2017
…r to use a static port (#887)

- Changes to xSQLServerNetwork
  - BREAKING CHANGE: Renamed parameter TcpDynamicPorts to TcpDynamicPort and
    changed type to Boolean (issue #534).
  - Resolved issue when switching from dynamic to static port.
    configuration (issue #534).
  - Added localization (en-US) for all strings in resource and unit tests
    (issue #618).
  - Updated examples to reflect new parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. enhancement The issue is an enhancement request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants