Skip to content

Commit

Permalink
Merge pull request #1318 from PowerShell/dev
Browse files Browse the repository at this point in the history
Release of version 12.4.0.0 of SqlServerDsc
  • Loading branch information
kwirkykat authored Apr 3, 2019
2 parents c560f54 + dfd32b3 commit 13cc150
Show file tree
Hide file tree
Showing 118 changed files with 6,948 additions and 3,720 deletions.
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,84 @@

## Unreleased

## 12.4.0.0

- Changes to SqlServerDsc
- Added new resources.
- SqlRSSetup
- Added helper module DscResource.Common from the repository
DscResource.Template.
- Moved all helper functions from SqlServerDscHelper.psm1 to DscResource.Common.
- Renamed Test-SqlDscParameterState to Test-DscParameterState.
- New-TerminatingError error text for a missing localized message now matches
the output even if the "missing localized message" localized message is
also missing.
- Added helper module DscResource.LocalizationHelper from the repository
DscResource.Template, this replaces the helper module CommonResourceHelper.psm1.
- Cleaned up unit tests, mostly around loading cmdlet stubs and loading
classes stubs, but also some tests that were using some odd variants.
- Fix all integration tests according to issue [PowerShell/DscResource.Template#14](https://github.com/PowerShell/DscResource.Template/issues/14).
- Changes to SqlServerMemory
- Updated Cim Class to Win32_ComputerSystem (instead of Win32_PhysicalMemory)
because the correct memory size was not being detected correctly on Azure VMs
([issue #914](https://github.com/PowerShell/SqlServerDsc/issues/914)).
- Changes to SqlSetup
- Split integration tests into two jobs, one for running integration tests
for SQL Server 2016 and another for running integration test for
SQL Server 2017 ([issue #858](https://github.com/PowerShell/SqlServerDsc/issues/858)).
- Localized messages for Master Data Services no longer start and end with
single quote.
- When installing features a verbose message is written if a feature is found
to already be installed. It no longer quietly removes the feature from the
`/FEATURES` argument.
- Cleaned up a bit in the tests, removed excessive piping.
- Fixed minor typo in examples.
- A new optional parameter `FeatureFlag` parameter was added to control
breaking changes. Functionality added under a feature flag can be
toggled on or off, and could be changed later to be the default.
This way we can also make more of the new functionalities the default
in the same breaking change release ([issue #1105](https://github.com/PowerShell/SqlServerDsc/issues/1105)).
- Added a new way of detecting if the shared feature CONN (Client Tools
Connectivity, and SQL Client Connectivity SDK), BC (Client Tools
Backwards Compatibility), and SDK (Client Tools SDK) is installed or
not. The new functionality is used when the parameter `FeatureFlag`
is set to `'DetectionSharedFeatures'` ([issue #1105](https://github.com/PowerShell/SqlServerDsc/issues/1105)).
- Added a new helper function `Get-InstalledSharedFeatures` to move out
some of the code from the `Get-TargetResource` to make unit testing
easier and faster.
- Changed the logic of 'Build the argument string to be passed to setup' to
not quote the value if root directory is specified
([issue #1254](https://github.com/PowerShell/SqlServerDsc/issues/1254)).
- Moved some resource specific helper functions to the new helper module
DscResource.Common so they can be shared with the new resource SqlRSSetup.
- Improved verbose messages in Test-TargetResource function to more
clearly tell if features are already installed or not.
- Refactored unit tests for the functions Test-TargetResource and
Set-TargetResource to improve testing speed.
- Modified the Test-TargetResource and Set-TargetResource to not be
case-sensitive when comparing feature names. *This was handled
correctly in real-world scenarios, but failed when running the unit
tests (and testing casing).*
- Changes to SqlAGDatabase
- Fix MatchDatabaseOwner to check for CONTROL SERVER, IMPERSONATE LOGIN, or
CONTROL LOGIN permission in addition to IMPERSONATE ANY LOGIN.
- Update and fix MatchDatabaseOwner help text.
- Changes to SqlAG
- Updated documentation on the behaviour of defaults as they only apply when
creating a group.
- Changes to SqlAGReplica
- AvailabilityMode, BackupPriority, and FailoverMode defaults only apply when
creating a replica not when making changes to an existing replica. Explicit
parameters will still change existing replicas ([issue #1244](https://github.com/PowerShell/SqlServerDsc/issues/1244)).
- ReadOnlyRoutingList now gets updated without throwing an error on the first
run ([issue #518](https://github.com/PowerShell/SqlServerDsc/issues/518)).
- Test-Resource fixed to report whether ReadOnlyRoutingList desired state
has been reached correctly ([issue #1305](https://github.com/PowerShell/SqlServerDsc/issues/1305)).
- Changes to SqlDatabaseDefaultLocation
- No longer does the Test-TargetResource fail on the second test run
when the backup file path was changed, and the path was ending with
a backslash ([issue #1307](https://github.com/PowerShell/SqlServerDsc/issues/1307)).

## 12.3.0.0

- Changes to SqlServerDsc
Expand Down
49 changes: 30 additions & 19 deletions DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Import-Module -Name (Join-Path -Path (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) `
-ChildPath 'SqlServerDscHelper.psm1') `
-Force
$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules'

$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'DscResource.LocalizationHelper'
Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'DscResource.LocalizationHelper.psm1')

$script:resourceHelperModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'DscResource.Common'
Import-Module -Name (Join-Path -Path $script:resourceHelperModulePath -ChildPath 'DscResource.Common.psm1')

<#
.SYNOPSIS
Expand Down Expand Up @@ -108,13 +113,13 @@ function Get-TargetResource
Specifies if the availability group should be present or absent. Default is Present.
.PARAMETER AutomatedBackupPreference
Specifies the automated backup preference for the availability group.
Specifies the automated backup preference for the availability group. When creating a group the default is 'None'.
.PARAMETER AvailabilityMode
Specifies the replica availability mode. Default is 'AsynchronousCommit'.
Specifies the replica availability mode. When creating a group the default is 'AsynchronousCommit'.
.PARAMETER BackupPriority
Specifies the desired priority of the replicas in performing backups. The acceptable values for this parameter are integers from 0 through 100. Of the set of replicas which are online and available, the replica that has the highest priority performs the backup. Default is 50.
Specifies the desired priority of the replicas in performing backups. The acceptable values for this parameter are integers from 0 through 100. Of the set of replicas which are online and available, the replica that has the highest priority performs the backup. When creating a group the efault is 50.
.PARAMETER BasicAvailabilityGroup
Specifies the type of availability group is Basic. This is only available is SQL Server 2016 and later and is ignored when applied to previous versions.
Expand All @@ -132,13 +137,16 @@ function Get-TargetResource
Specifies how the availability replica handles connections when in the secondary role.
.PARAMETER EndpointHostName
Specifies the hostname or IP address of the availability group replica endpoint. Default is the instance network name.
Specifies the hostname or IP address of the availability group replica endpoint. When creating a group the default is the instance network name.
.PARAMETER FailureConditionLevel
Specifies the automatic failover behavior of the availability group.
.PARAMETER FailoverMode
Specifies the failover mode. When creating a group the default is 'Manual'.
.PARAMETER HealthCheckTimeout
Specifies the length of time, in milliseconds, after which AlwaysOn availability groups declare an unresponsive server to be unhealthy. Default is 30,000.
Specifies the length of time, in milliseconds, after which AlwaysOn availability groups declare an unresponsive server to be unhealthy. When creating a group the default is 30,000.
.PARAMETER ProcessOnlyOnActiveNode
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.
Expand Down Expand Up @@ -285,14 +293,14 @@ function Set-TargetResource
throw New-TerminatingError -ErrorType DatabaseMirroringEndpointNotFound -FormatArgs $ServerName, $InstanceName -ErrorCategory ObjectNotFound
}

if ( -not $EndpointHostName )
{
$EndpointHostName = $serverObject.NetName
}

# If the availability group does not exist, create it
if ( -not $availabilityGroup )
{
if ( -not $EndpointHostName )
{
$EndpointHostName = $serverObject.NetName
}

# Set up the parameters to create the AG Replica
$newReplicaParams = @{
Name = $serverObject.DomainInstanceName
Expand Down Expand Up @@ -485,13 +493,13 @@ function Set-TargetResource
Specifies if the availability group should be present or absent. Default is Present.
.PARAMETER AutomatedBackupPreference
Specifies the automated backup preference for the availability group.
Specifies the automated backup preference for the availability group. When creating a group the default is 'None'.
.PARAMETER AvailabilityMode
Specifies the replica availability mode. Default is 'AsynchronousCommit'.
Specifies the replica availability mode. When creating a group the default is 'AsynchronousCommit'.
.PARAMETER BackupPriority
Specifies the desired priority of the replicas in performing backups. The acceptable values for this parameter are integers from 0 through 100. Of the set of replicas which are online and available, the replica that has the highest priority performs the backup. Default is 50.
Specifies the desired priority of the replicas in performing backups. The acceptable values for this parameter are integers from 0 through 100. Of the set of replicas which are online and available, the replica that has the highest priority performs the backup. When creating a group the default is 50.
.PARAMETER BasicAvailabilityGroup
Specifies the type of availability group is Basic. This is only available is SQL Server 2016 and later and is ignored when applied to previous versions.
Expand All @@ -509,13 +517,16 @@ function Set-TargetResource
Specifies how the availability replica handles connections when in the secondary role.
.PARAMETER EndpointHostName
Specifies the hostname or IP address of the availability group replica endpoint. Default is the instance network name.
Specifies the hostname or IP address of the availability group replica endpoint. When creating a group the default is the instance network name.
.PARAMETER FailureConditionLevel
Specifies the automatic failover behavior of the availability group.
.PARAMETER FailoverMode
Specifies the failover mode. When creating a group the default is 'Manual'.
.PARAMETER HealthCheckTimeout
Specifies the length of time, in milliseconds, after which AlwaysOn availability groups declare an unresponsive server to be unhealthy. Default is 30,000.
Specifies the length of time, in milliseconds, after which AlwaysOn availability groups declare an unresponsive server to be unhealthy. When creating a group the default is 30,000.
.PARAMETER ProcessOnlyOnActiveNode
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.
Expand Down Expand Up @@ -689,7 +700,7 @@ function Test-TargetResource
{
New-VerboseMessage -Message "'$($parameterName)' should be '$($parameterValue)' but is '$($getTargetResourceResult.($parameterName))'"

$result = $False
$result = $false
}
}

Expand Down
12 changes: 6 additions & 6 deletions DSCResources/MSFT_SqlAG/MSFT_SqlAG.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ class MSFT_SqlAG : OMI_BaseResource
[Required, Description("Hostname of the SQL Server to be configured.")] String ServerName;
[Key, Description("Name of the SQL instance to be configured.")] String InstanceName;
[Write, Description("Specifies if the availability group should be present or absent. Default is Present."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Specifies the automated backup preference for the availability group. Default is None"), ValueMap{"Primary","SecondaryOnly","Secondary","None"}, Values{"Primary","SecondaryOnly","Secondary","None"}] String AutomatedBackupPreference;
[Write, Description("Specifies the replica availability mode. Default is 'AsynchronousCommit'."), ValueMap{"AsynchronousCommit","SynchronousCommit"}, Values{"AsynchronousCommit","SynchronousCommit"}] String AvailabilityMode;
[Write, Description("Specifies the desired priority of the replicas in performing backups. The acceptable values for this parameter are: integers from 0 through 100. Of the set of replicas which are online and available, the replica that has the highest priority performs the backup. Default is 50.")] UInt32 BackupPriority;
[Write, Description("Specifies the automated backup preference for the availability group. When creating a group the default is None"), ValueMap{"Primary","SecondaryOnly","Secondary","None"}, Values{"Primary","SecondaryOnly","Secondary","None"}] String AutomatedBackupPreference;
[Write, Description("Specifies the replica availability mode. When creating a group the default is 'AsynchronousCommit'."), ValueMap{"AsynchronousCommit","SynchronousCommit"}, Values{"AsynchronousCommit","SynchronousCommit"}] String AvailabilityMode;
[Write, Description("Specifies the desired priority of the replicas in performing backups. The acceptable values for this parameter are: integers from 0 through 100. Of the set of replicas which are online and available, the replica that has the highest priority performs the backup. When creating a group the default is 50.")] UInt32 BackupPriority;
[Write, Description("Specifies the type of availability group is Basic. This is only available is SQL Server 2016 and later and is ignored when applied to previous versions.")] Boolean BasicAvailabilityGroup;
[Write, Description("Specifies if the option Database Level Health Detection is enabled. This is only available is SQL Server 2016 and later and is ignored when applied to previous versions.")] Boolean DatabaseHealthTrigger;
[Write, Description("Specifies if the option Database DTC Support is enabled. This is only available is SQL Server 2016 and later and is ignored when applied to previous versions. This can't be altered once the Availability Group is created and is ignored if it is the case.")] Boolean DtcSupportEnabled;
[Write, Description("Specifies how the availability replica handles connections when in the primary role."), ValueMap{"AllowAllConnections","AllowReadWriteConnections"}, Values{"AllowAllConnections","AllowReadWriteConnections"}] String ConnectionModeInPrimaryRole;
[Write, Description("Specifies how the availability replica handles connections when in the secondary role."), ValueMap{"AllowNoConnections","AllowReadIntentConnectionsOnly","AllowAllConnections"}, Values{"AllowNoConnections","AllowReadIntentConnectionsOnly","AllowAllConnections"}] String ConnectionModeInSecondaryRole;
[Write, Description("Specifies the hostname or IP address of the availability group replica endpoint. Default is the instance network name.")] String EndpointHostName;
[Write, Description("Specifies the hostname or IP address of the availability group replica endpoint. When creating a group the default is the instance network name.")] String EndpointHostName;
[Write, Description("Specifies the automatic failover behavior of the availability group."), ValueMap{"OnServerDown","OnServerUnresponsive","OnCriticalServerErrors","OnModerateServerErrors","OnAnyQualifiedFailureCondition"}, Values{"OnServerDown","OnServerUnresponsive","OnCriticalServerErrors","OnModerateServerErrors","OnAnyQualifiedFailureCondition"}] String FailureConditionLevel;
[Write, Description("Specifies the failover mode. Default is 'Manual'."), ValueMap{"Automatic","Manual"}, Values{"Automatic","Manual"}] String FailoverMode;
[Write, Description("Specifies the length of time, in milliseconds, after which AlwaysOn availability groups declare an unresponsive server to be unhealthy. Default is 30000.")] UInt32 HealthCheckTimeout;
[Write, Description("Specifies the failover mode. When creating a group the default is 'Manual'."), ValueMap{"Automatic","Manual"}, Values{"Automatic","Manual"}] String FailoverMode;
[Write, Description("Specifies the length of time, in milliseconds, after which AlwaysOn availability groups declare an unresponsive server to be unhealthy. When creating a group the default is 30000.")] UInt32 HealthCheckTimeout;
[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;
Expand Down
Loading

0 comments on commit 13cc150

Please sign in to comment.