Cannot create Domain Independent Availability Group - Error Code : 5018, Cannot bring the Windows Server Failover Clustering resource on line

Doug Arnold 26 Reputation points
2020-11-11T21:02:33.067+00:00

I'm trying to create a Basic Availability Group for a customer on their server pair. This is SQL Server 2017 Standard running on Windows 2016 Data center.

The two servers are NOT part of a domain and are physically separated in different parts of the country.

Following the online instructions here: https://learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/domain-independent-availability-groups?view=sql-server-ver15

Looking in the WSFC Configuration Manager, the WSFC seems to be up and running successfully however when trying to run the Availability Group Wizard I'm getting the message below. I've tried a number of things including giving all of the built-in SYSTEM and MSSQLSERVER accounts sysadmin rights on both SQL Servers.

Thanks for any help anyone can provide! Here is the full error message appearing in the AG Wizard results:

Cannot bring the Windows Server Failover Clustering (WSFC) resource (ID '957d80c2-bfd4-4ea1-8f31-bba024bdb61a') online (Error code 5018). If this is a WSFC availability group, the WSFC service may not be running or may not be accessible in its current state, or the WSFC resource may not be in a state that could accept the request. Otherwise, contact your primary support provider. For information about this error code, see "System Error Codes" in the Windows Development documentation.
Failed to designate the local availability replica of availability group TestSQL_AG' as the primary replica. The operation encountered SQL Server error 41066 and has been terminated. Check the preceding error and the SQL Server error log for more details about the error and corrective actions.
Failed to create availability group 'TestSQL_AG'. The operation encountered SQL Server error 41160 and has been rolled back. Check the SQL Server error log for more details. When the cause of the error has been resolved, retry CREATE AVAILABILITY GROUP command. (.Net SqlClient Data Provider)

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,664 questions
0 comments No comments
{count} votes

Accepted answer
  1. Cris Zhan-MSFT 6,626 Reputation points
    2020-11-12T03:35:26.527+00:00

    Hi @Doug Arnold ,

    >Cannot bring the Windows Server Failover Clustering (WSFC) resource (ID ‘ ‘) online (Error code 5018).

    Please add start up account of cluster service to SQL Server login and grant sysadmin role.Usually you need to set the 'NT AUTHORITY\SYSTEM' " as a member of the sysadmin server role on both instances.. Just in case, also check the Netbios name of your servers is less than 15 characters. more details check this similar post.

    In addition, please refer to the following articles.
    Domain Independent Cluster and Availability Group
    https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/domain-independent-cluster-and-availability-group/ba-p/371462

    Configure a workgroup availability group
    https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/availability-group-clusterless-workgroup-configure


1 additional answer

Sort by: Most helpful
  1. Doug Arnold 26 Reputation points
    2020-11-12T21:56:49.97+00:00

    Thank you for your help! In this case the issue was that the server names were greater that 15 characters. The servers were renamed to something less than the 15 characters and things started working! I will mark your response as the answer.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.