Recently I was trying to help a customer who was deploying AlwaysOn Availability Group in Microsoft Azure via template deployment.
The template was failing with below error
StatusMessage
{
“status”: “Failed”,
“error”: {
“code”: “ResourceDeploymentFailure”,
“message”: “The resource operation completed with terminal provisioning state ‘Failed’.”,
“details”: [
{
“code”: “DeploymentFailed”,
“message”: “At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.”,
“details”: [
{
“code”: “Conflict”,
“message”: “{\r\n \”status\”: \”Failed\”,\r\n \”error\”: {\r\n \”code\”: \”ResourceDeploymentFailure\”,\r\n \”message\”: \”The resource operation completed with terminal provisioning state ‘Failed’.\”,\r\n \”details\”: [\r\n {\r\n \”code\”: \”VMExtensionProvisioningError\”,\r\n \”message\”: \”VM has reported a failure when processing extension ‘configuringAlwaysOn’. Error message: \\\”DSC Configuration ‘CreateFailoverCluster’ completed with error(s). Following are the first few: PowerShell DSC resource MicrosoftAzure_xSqlAvailabilityGroupListener failed to execute Set-TargetResource functionality with error message: The running command stopped because the preference variable \\\”ErrorActionPreference\\\” or common parameter is set to Stop: An error occurred while attempting to bring the resource ‘SQLAUTHORITY-AG’ online.\\n The cluster resource could not be brought online by the resource monitor The SendConfigurationApply function did not succeed.\\\”.\”\r\n }\r\n ]\r\n }\r\n}”
}
]
}
]
}
The message looks very ugly, but it’s a direct copy paste from Azure. Here is the relevant message:
An error occurred while attempting to bring the resource ‘SQLAUTHORITY-AG’ online. The cluster resource could not be brought online by the resource monitor
I looked further into Event log into the node and found below interesting error.
Log Name: System
Source: Microsoft-Windows-FailoverClustering
Date: 7/26/2016 6:11:45 PM
Event ID: 1193
Task Category: Network Name Resource
Level: Error
Keywords:
User: SYSTEM
Computer: demo.sqlauthority.local
Description:
Cluster network name resource ‘alwayson-ag-sqlauth-listener01’ failed to create its associated computer object in domain ‘sqlauthority.local’ for the following reason: Resource online.
The associated error code is: -1073741790
Please work with your domain administrator to ensure that:
– The cluster identity ‘win-cluster$’ can create computer objects. By default all computer objects are created in the ‘Computers’ container; consult the domain administrator if this location has been changed.
– The quota for computer objects has not been reached.
– If there is an existing computer object, verify the Cluster Identity ‘win-cluster$’ has ‘Full Control’ permission to that computer object using the Active Directory Users and Computers tool.
Interesting thing was that the deployment worked first time but failed second time and all subsequent attempts.
Initially I thought it’s a well-known permission issue of CNO and VCO so I went to pre-stage it. (Prestage Cluster Computer Objects in Active Directory Domain Services)
Later, we found that listener name was created in AD as “alwayson-ag-sq” due to 15 characters’ limit. When we deployed again, it was still creating same name even though I gave ‘alwayson-ag-sqlauth-listener01’ in template.
Solution: Make sure we are keeping computer names within the limit of 15 characters. (Naming conventions in Active Directory for computers, domains, sites, and OUs)
Reference: Pinal Dave (http://blog.sqlauthority.com)
First appeared on SQL SERVER – Unable to Create Listener for AlwaysOn Availability Group in Azure via Template Deployment