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: SqlAg & SqlReplica: Removes SQLServerNetName in favor of EndpointHostName #938

Merged
merged 5 commits into from
Dec 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- BREAKING CHANGE: The read-only property SQLServerNetName was removed in favor
of EndpointHostName ([issue #924](https://github.com/PowerShell/SqlServerDsc/issues/924)).
Get-TargetResource will now return the value of property [NetName](https://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.netname(v=sql.105).aspx)
for the property EndpointHostName.
- Changes to SqlAGDatabase
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
Expand All @@ -37,6 +41,10 @@
- BREAKING CHANGE: Parameters PrimaryReplicaSQLServer and PrimaryReplicaSQLInstanceName
has been renamed to PrimaryReplicaServerName and PrimaryReplicaInstanceName
respectively ([issue #922](https://github.com/PowerShell/SqlServerDsc/issues/922)).
- BREAKING CHANGE: The read-only property SQLServerNetName was removed in favor
of EndpointHostName ([issue #924](https://github.com/PowerShell/SqlServerDsc/issues/924)).
Get-TargetResource will now return the value of property [NetName](https://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.netname(v=sql.105).aspx)
for the property EndpointHostName.
- Changes to SqlAlwaysOnService
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
Expand Down
4 changes: 2 additions & 2 deletions DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function Get-TargetResource
$alwaysOnAvailabilityGroupResource.HealthCheckTimeout = $availabilityGroup.HealthCheckTimeout
$alwaysOnAvailabilityGroupResource.EndpointURL = $availabilityGroup.AvailabilityReplicas[$serverObject.DomainInstanceName].EndpointUrl
$alwaysOnAvailabilityGroupResource.EndpointPort = $endpointPort
$alwaysOnAvailabilityGroupResource.SQLServerNetName = $serverObject.NetName
$alwaysOnAvailabilityGroupResource.EndpointHostName = $serverObject.NetName
$alwaysOnAvailabilityGroupResource.Version = $sqlMajorVersion

# Add properties that are only present in SQL 2016 or newer
Expand Down Expand Up @@ -700,7 +700,7 @@ function Test-TargetResource

if ( -not $EndpointHostName )
{
$EndpointHostName = $getTargetResourceResult.SQLServerNetName
$EndpointHostName = $getTargetResourceResult.EndpointHostName
}

# Verify the hostname in the endpoint URL is correct
Expand Down
1 change: 0 additions & 1 deletion DSCResources/MSFT_SqlAG/MSFT_SqlAG.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class MSFT_SqlAG : OMI_BaseResource
[Write, Description("Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server Instance.")] Boolean ProcessOnlyOnActiveNode;
[Read, Description("Gets the Endpoint URL of the availability group replica endpoint.")] String EndpointUrl;
[Read, Description("Gets the port the database mirroring endpoint is listening on.")] UInt32 EndpointPort;
[Read, Description("Gets the hostname the SQL Server instance is listening on.")] String SQLServerNetName;
[Read, Description("Gets the major version of the SQL Server instance.")] UInt32 Version;
[Read, Description("Determines if the current node is actively hosting the SQL Server instance.")] Boolean IsActiveNode;
};
4 changes: 2 additions & 2 deletions DSCResources/MSFT_SqlAGReplica/MSFT_SqlAGReplica.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function Get-TargetResource
ServerName = $ServerName
InstanceName = $InstanceName
EndpointPort = $endpointPort
SQLServerNetName = $serverObject.NetName
EndpointHostName = $serverObject.NetName
}

# Get the availability group
Expand Down Expand Up @@ -672,7 +672,7 @@ function Test-TargetResource

if ( -not $EndpointHostName )
{
$EndpointHostName = $getTargetResourceResult.SQLServerNetName
$EndpointHostName = $getTargetResourceResult.EndpointHostName
}

# Verify the hostname in the endpoint URL is correct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ class MSFT_SqlAGReplica : OMI_BaseResource
[Write, Description("Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server instance.")] Boolean ProcessOnlyOnActiveNode;
[Read, Description("Output the network port the endpoint is listening on. Used by Get-TargetResource.")] Uint16 EndpointPort;
[Read, Description("Output the endpoint URL of the Availability Group Replica. Used by Get-TargetResource.")] String EndpointUrl;
[Read, Description("Output the NetName property from the SQL Server object. Used by Get-TargetResource.")] String SqlServerNetName;
[Read, Description("Determines if the current node is actively hosting the SQL Server instance.")] Boolean IsActiveNode;
};
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ It will also manage the Availability Group replica on the specified node.
availability group replica endpoint.
* **`[Uint32]` EndpointPort** _(Read)_: Gets the port the database mirroring
endpoint is listening on
* **`[String]` SQLServerNetName** _(Read)_: Gets the hostname the SQL Server
instance is listening on.
* **`[Uint32]` Version** _(Read)_: Gets the major version of the SQL Server
instance.
* **`[Boolean]` IsActiveNode** _(Read)_: Determines if the current node is
Expand Down Expand Up @@ -391,8 +389,6 @@ Always On Availability Group Replica.
listening on. Used by Get-TargetResource.
* **`[String]` EndpointUrl** _(Read)_: Output the endpoint URL of the
Availability Group Replica. Used by Get-TargetResource.
* **`[String]` SQLServerNetName** _(Read)_: Output the NetName property from the
SQL Server object.
* **`[Boolean]` IsActiveNode** _(Read)_: Determines if the current node is
actively hosting the SQL Server instance.

Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/MSFT_SqlAGReplica.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ try
$getTargetResourceResult.ReadOnlyRoutingList | Should -BeNullOrEmpty
$getTargetResourceResult.ServerName | Should -Be $mockServerName
$getTargetResourceResult.InstanceName | Should -Be $mockInstanceName
$getTargetResourceResult.SQLServerNetName | Should -Be $mockServerName
$getTargetResourceResult.EndpointHostName | Should -Be $mockServerName

Assert-MockCalled -CommandName Connect-SQL -Scope It -Times 1 -Exactly
}
Expand Down Expand Up @@ -595,7 +595,7 @@ try
$getTargetResourceResult.ReadOnlyRoutingList | Should -Be $mockServerName
$getTargetResourceResult.ServerName | Should -Be $mockServerName
$getTargetResourceResult.InstanceName | Should -Be $mockInstanceName
$getTargetResourceResult.SQLServerNetName | Should -Be $mockServerName
$getTargetResourceResult.EndpointHostName | Should -Be $mockServerName

Assert-MockCalled -CommandName Connect-SQL -Scope It -Times 1 -Exactly
}
Expand Down