Skip to content

Latest commit

 

History

History
161 lines (126 loc) · 4.04 KB

File metadata and controls

161 lines (126 loc) · 4.04 KB

DSC Resource 'SqlAGListeners'

SqlAGListeners configures listeners for SQL Server Always On Availability Groups, providing client connection endpoints.

When to use 'SqlAGListeners'

Use this resource when you need to create the client-facing network endpoint for an Availability Group. The listener provides a virtual network name and IP address that clients use to connect to the AG, enabling transparent failover. The AG must be created first with SqlAGs.

Source

DSC Resource

Documentation

Requirements
  • Target machine must be running Windows Server 2012 or later.

  • Target machine must be running SQL Server Database Engine 2012 or later.

  • Target machine must have access to the SQLPS PowerShell module or the SqlServer PowerShell module.

  • Requires that the Cluster name Object (CNO) has been delegated the right Create Computer Object in the organizational unit (OU) in which the Cluster Name Object (CNO) resides.

Table 1. Attributes of category 'SqlAGListeners'
Parameter Attribute DataType Description Allowed Values

DefaultInstanceName

String

Default SQL InstanceName
If the InstanceName of a value is not explicitly set, the DefaultInstanceName will be used.

Default: MSSQLSERVER

Values

Mandatory

Hashtable[]

List of SQL availability groups listeners.

Table 2. Attributes of category 'SqlAGListeners'
Parameter Attribute DataType Description Allowed Values

InstanceName

Key

String

The SQL Server instance name of the primary replica.

ServerName

Required

String

The host name or fully qualified domain name (FQDN) of the primary replica.

Name

Required

String

The name of the availability group listener, max 15 characters.

This name will be used as the Virtual Computer Object (VCO).

Ensure

String

Determines whether the availability group listener should be added (Present) or removed (Absent).

  • Present (default)

  • Absent

AvailabilityGroup

Key

String

The name of the availability group to which the availability group listener is or will be connected.

IpAddress

String[]

The IP address used for the availability group listener, in the format 192.168.10.45/255.255.252.0.

If using DHCP, set to the first IP-address of the DHCP subnet, in the format 192.168.8.1/255.255.252.0. Must be valid in the cluster-allowed IP range.

Port

UInt16

The port used for the availability group listener.

DHCP

Bool

If DHCP should be used for the availability group listener instead of static IP address.

  • True

  • False

Example
SqlAGListeners:
  Values:
    - Name: AGTestListener1
      InstanceName: INSTANCE1
      AvailabilityGroup: AGTest1
      ServerName: SQL1
      IpAddress: 192.168.10.240
      Port: 1433
    - Name: AGTestListener2
      InstanceName: INSTANCE2
      AvailabilityGroup: AGTest2
      ServerName: SQL1
      IpAddress: 192.168.10.241
      Port: 4000