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

Comments

Projects
None yet
2 participants
@johlju
Contributor

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 self-assigned this Apr 30, 2017

@johlju johlju added help wanted and removed in progress labels Apr 30, 2017

@johlju

This comment has been minimized.

Show comment
Hide comment
@johlju

johlju Apr 30, 2017

Contributor

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.

Contributor

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 from xSQLServerNetwork: Currently does not support to set static port when instance was using dynamic ports to 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

Changes to xSQLServerNetwork
Now the resource allows to set the parameter TcpDynamicPorts to a blank value (partly fixes issue PowerShell#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 PowerShell#537).
Updated example 1-EnableTcpIpOnCustomStaticPort.
Added unit tests (issue PowerShell#294).

johlju added a commit to johlju/SqlServerDsc that referenced this issue May 1, 2017

Changes to xSQLServerNetwork
Now the resource allows to set the parameter TcpDynamicPorts to a blank value (partly fixes issue PowerShell#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 PowerShell#537).
Updated example 1-EnableTcpIpOnCustomStaticPort.
Added unit tests (issue PowerShell#294).

johlju added a commit to johlju/SqlServerDsc that referenced this issue May 20, 2017

Changes to xSQLServerNetwork
Now the resource allows to set the parameter TcpDynamicPorts to a blank value (partly fixes issue PowerShell#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 PowerShell#537).
Updated example 1-EnableTcpIpOnCustomStaticPort.
Added unit tests (issue PowerShell#294).

johlju added a commit that referenced this issue May 21, 2017

xSQLServerNetwork: Refactored this resource and added tests (#538)
- 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

Blankf pushed a commit to Blankf/xSQLServer that referenced this issue May 30, 2017

xSQLServerNetwork: Refactored this resource and added tests (PowerShe…
…ll#538)

- Changes to xSQLServerNetwork
  - Added optional parameter SQLServer with default value of $env:COMPUTERNAME (issue PowerShell#528).
  - Added optional parameter RestartTimeout with default value of 120 seconds.
  - Now the resource supports restarting a sql server in a cluster (issue PowerShell#527 and issue PowerShell#455).
  - Now the resource allows to set the parameter TcpDynamicPorts to a blank value (partly fixes issue PowerShell#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 PowerShell#537).
  - Updated example 1-EnableTcpIpOnCustomStaticPort.
  - Added unit tests (issue PowerShell#294).
  - Refactored some of the code, cleaned up the rest and fixed PSSA rules warnings (issue PowerShell#261).
  - If parameter TcpDynamicPort is set to '0' at the same time as TcpPort is set the resource will now throw an error (issue PowerShell#535).
  - Added examples (issue PowerShell#536).
  - When TcpDynamicPorts is set to '0' the Test-TargetResource function will no longer fail each time (issue PowerShell#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

This comment has been minimized.

Show comment
Hide comment
@johlju

johlju Oct 5, 2017

Contributor

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

Contributor

johlju commented Oct 5, 2017

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

@nabrond

This comment has been minimized.

Show comment
Hide comment
@nabrond

nabrond Oct 10, 2017

Contributor

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

Contributor

nabrond commented Oct 10, 2017

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

@johlju

This comment has been minimized.

Show comment
Hide comment
@johlju

johlju Oct 10, 2017

Contributor

Awesome! Labeling it as in progress. Thanks! 😄

Contributor

johlju commented Oct 10, 2017

Awesome! Labeling it as in progress. Thanks! 😄

@johlju johlju added in progress and removed help wanted labels Oct 10, 2017

@johlju johlju closed this in #887 Oct 17, 2017

@johlju johlju removed the in progress label Oct 17, 2017

johlju added a commit that referenced this issue Oct 17, 2017

BREAKING CHANGE: xSQLServerNetwork: Support for configuring SQL Serve…
…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