StarWind Resource Library

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Published: August 5, 2015

INTRODUCTION

A SQL Server failover clustered instance is a configuration where all of the nodes of the cluster are connected to the same shared storage. However, when deployed on an Azure virtual machine, the underlying Windows Server Failover Cluster (WSFC) must use Azure hosted storage with one of the following options, as per Microsoft KB 2721672:

• Application-level replication for non-shared storage
• Volume-level replication for non-shared storage
• ExpressRoute for remote iSCSI Target shared block storage
• Azure Files for shared file storage.

The Azure hosted storage that will be used for building a WSFC will leverage StarWind Virtual SAN for the implementation of volume-level replication. This guide is intended for experienced Windows system administrators, IT professionals and SQL Server database administrators who would like to install and configure a 2-node Windows Server 2012 R2 Failover Cluster that will host a SQL Server failover clustered instance (FCI) on Azure virtual machines.

Assumptions

When using this guide, a few assumptions have been made:

• An Azure subscription is available to create the required resources.
• Windows Server 2012 R2 virtual machines with at least 2 network adapters are provisioned for the cluster nodes and that they are joined to the same Active Directory domain on Azure.
• Configuration of the StarWind Virtual SAN used for the cluster is outside the scope of this document. However, the software will be installed on the cluster nodes.
• Understanding of basic Azure concepts.
• Familiarity with Windows PowerShell scripting and Azure PowerShell Modules.

Network Architecture Design

Proper network architecture design is key to successfully implementing a SQL Server failover clustered instance on Azure. Enlist the help of your network engineers to make sure that your design complies with your corporate standards and is done appropriately. Below is the network diagram that will be used to implement the SQL Server failover clustered instance.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

There are at least two virtual network adapters (vNICs) for the WSFC nodes – one for production traffic and one for cluster heartbeat and storage volume replication. It is recommended to have more than two (2) vNICs to achieve quality of service (QoS) and fault tolerance for both the cluster and storage replication. However, there are certain considerations when creating Azure
virtual machines with more than one (1) vNIC:

• All Azure virtual machines in the same cloud service should have the same number of vNICs.
• Azure virtual machines with multiple vNICs must be created in Azure virtual networks (VNets).
• As of the time of writing, creation of Azure virtual machines with multiple vNICs can only be accomplished via the Azure PowerShell modules. The Azure Portal does not support creating virtual machines with multiple vNICs.
• Creation of Azure virtual machines with multiple vNICs is bound by the limitations of the standard VM sizes (SKUs) and existing Azure subscription. For more information on the different SKUs and the maximum number of vNICs per SKU, refer to Create a VM with Multiple NICs.

The domain controller has two (2) vNICs mainly because it is in the same cloud service as the cluster nodes. A breakdown of the servers, virtual network names and IP addresses is shown in the table below.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Active Directory Domain Name: TESTDOMAIN.COM
Cluster Nodes: SQLNODE1 & SQLNODE2
Cluster Disks: J:\ & L:\

Windows Server Failover Cluster Name and IP Address: WINCLUSAZURE (10.1.0.250)
SQL Server Failover Cluster Name and IP Address: SQLCLUSAZURE (10.1.0.180)
SQL Server Service Account: TESTDOMAIN\sqlservice

The log structuring uses Redirect-on-Write for snapshotting, writes, etc. That means every new data block is written to the next available place on the disk organizing the data blocks sequentially. No matter which access pattern is used underlying storage always receives 4 MB blocks. LSFS coalesces.

At a high-level, below are the following steps for that need to be taken for installing and configuring a SQL Server failover clustered instance on Azure virtual machines.

1. Creating an Azure cloud-only virtual network (VNet)
2. Creating an Azure cloud service
3. Creating an Azure storage account
4. Creating and Configuring Azure virtual machines
5. Adding an Azure hosted data disk to the virtual machines used for the WSFC nodes
6. Installing and Configuring an Active Directory Domain Controller
7. Configuring the WSFC Nodes
8. Installing and Configuring StarWind Virtual SAN
9. Discovering iSCSI Target Portals
10. Connecting iSCSI Targets and Configuring Multi-pathing
11. Initializing and Formatting the Disks
12. Running the Failover Cluster Validation Wizard
13. Creating the Windows Server 2012 R2 Failover Cluster
14. Fixing the Windows Server Failover Cluster Client Access Point
15. Configuring Cluster Quorum Settings
16. Install SQL Server on a Windows Server 2012 R2 Failover Cluster
17. Adding a Node on a SQL Server Failover Clustered Instance
18. Creating an Azure Internal Load Balancer
19. Updating the SQL Server Failover Clustered Instance Virtual Network Name

Creating an Azure Cloud-Only Virtual Network (VNet)

An Azure Virtual Network (VNet) allows you to provision and manage virtual private networks (VPNs) in Azure and link the VPNs with your on-premises network. This also allows network administrators to create solutions and control network topology, including configuration of DNS and IP address ranges.

In this section, we will create an Azure cloud-only virtual network with two subnets – one for regular network traffic and another for cluster heartbeat and storage volume replication:

1. Login to the Azure Management portal using your credentials

2. In the lower left-hand corner of the screen, click New > Network Services > Virtual Network, and click the Custom Create link. This will initiate the configuration wizard.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. In the Virtual Network Details page, enter the following information:

Name – this is the name you want to use in your virtual network. In this example, we will use Public-Azure-East
• Region – this is the location of the data center where the virtual network gets created. It is recommended to select the region where you will place all of your Azure resources. In this example, we will use East US

Click the Next arrow.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. In the DNS Servers and VPN Connectivity page, click the next arrow on the lower right. This will assign an internet-based Azure DNS server to resources that are added to this virtual network, allowing them to access the internet.

5. In the Virtual Network Address Spaces page, configure the following:

• In the Address Space section,
o In the Starting IP field, type 10.1.0.0
o In CIDR (ADDRESS COUNT), select /16 (65535)
• In the Subnets section,
o In the first row, type Production over the existing name and 10.1.0.0 for the Starting IP, then select /24 (256) in CIDR (ADDRESS COUNT)
o Click the add subnet link, type Heartbeat-iSCSI for the name and 10.1.1.0 for the starting IP.
• Click the Check icon to create the Azure cloud-only virtual network

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Creating an Azure Storage Account

An Azure storage account provides the owner access to services in Azure Storage. Your storage account provides the unique namespace for your Azure Storage data objects. Billing for Azure Storage usage is based on storage capacity, replication scheme, storage transactions, and data flow.

In this section, we will create an Azure storage account to store all of the virtual machines that we will create and the storage volume that we will attach to them:

1. Login to the Azure Management portal using your credentials
2. In the lower left-hand corner of the screen, click New > Data Services > Storage, and click the Quick Create link. Enter the following information
• In the URL field, type SQLFailover. This will be the public DNS name that you will use to connect to the Azure storage account in the form URL.core.windows.net
• In the Region or Affinity Group drop-down box, select East US
• In the Replication drop-down box, select Geo-Redundant to provide maximum durability for your data.

Click the Create Storage Account link to create the Azure storage account.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Creating and Configuring the Azure Virtual Machines

Since creation of Azure virtual machines with multiple vNICs is only currently supported via Windows PowerShell and the Azure PowerShell modules, it is important to download and install the Azure PowerShell modules on your workstation. Also, you would need to import the publish settings file for your Azure subscription to establish connectivity and authentication as you create the virtual machines and run PowerShell cmdlets. Refer to this article on Introduction to Azure PowerShell Modules for the SQL Server DBA Part 1 to perform these tasks.

In this section, we will create Azure virtual machines via Windows PowerShell and Azure PowerShell modules. It is assumed that the Azure PowerShell modules have been installed and your Azure publish settings file imported on your workstation. We will also set the default storage account name for all of the commands that we will be running.

We will create three (3) Azure virtual machines – one for the domain controller and two (2) for the nodes of the SQL Server failover clustered instance. All of the virtual machines will have 2 vNICs and will use the virtual network (VNet,) cloud service and storage account that we created in the previous sections. All of the Azure virtual machines will use the latest Windows Server 2012 R2 image available. While the IP addresses appear to be statically assigned, they are DHCPrequested from the Azure VNet subnet. This ensures that the Azure virtual machine will be assigned a specific IP address at provisioning time. However, it is not a guarantee. A more detailed description of static IP addresses in Microsoft Azure is described in Static IP, Reserved IP and Instance Level IP in Azure.

Example PowerShell Script

Use the example PowerShell script below to create the Azure virtual machines. Parameters used in the example are commented on how they are used. All code is written as single-lines. Format appropriately in code/script editor.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Adding an Azure HOSTED DATA DISK to the Virtual Machines Used for the WSFC Nodes

Once the Azure virtual machines have been created, we can add the Azure hosted data disks that will be used to store the StarWind virtual disks. Only the virtual machines that will be used to build the WSFC will need the disks.

To add an Azure hosted data disk and attach them to the virtual machines:

3. Login to the Azure Management portal using your credentials

4. Click the Virtual Machines link, and then select SQLNODE1

5. On the command bar, click Attach, and then click Attach Empty Disk

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

6. In the Attach an Empty Disk dialog box,

• In the File Name field, accept the default value or type an appropriate name
• In the Size (GB) field, type the size of the data disk that you want

Click the Check icon to create the Azure hosted data disk and attach it to the virtual machine.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Repeat the process to add an Azure hosted data disk to the SQLNODE2 virtual machine. Alternatively, you can use the example PowerShell script below to create and add the Azure hosted data disks to the virtual machines. Parameters used in the example are commented on how they are used. All code is written as single-lines. Format appropriately in code/script editor.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Install and Configure an Active Directory Domain Controller

In this section, we will install and configure an Active Directory domain controller in Microsoft Azure.

While this document is not designed as a guide for Active Directory domain services, it is important to have an Active Directory domain to create a SQL Server failover clustered instance running on top of a Windows Server Failover Cluster. For this purpose, we will simply run a Windows PowerShell script inside the virtual machine to install and configure an Active Directory domain controller.

To install and configure an Active Directory Domain Controller:

1. Login to the Azure Management portal using your credentials

2. Click the Virtual Machines link, and then select AD-DC1

3. On the command bar, click Connect. This will prompt you to download a Remote Desktop connection file.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. Login to the virtual machine using the credentials that you used as per Example PowerShell script.

5. Run the PowerShell script below to install and configure an Active Directory domain controller. Provide a password when prompted for the SafeModeAdministratorPassword.
The virtual machine will reboot as part of the configuration.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

6. After the script finishes, run the PowerShell script below to remove the forwarder from the DNS server that was created as part of the installation of an Active Directory domain controller. This is because the virtual machine originally uses the standard Azure DNS. Configuring it as a DNS server for the Active Directory domain configured limits DNS name resolution.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Configure the Windows Server Failover Cluster Nodes

In this section, we will configure the Windows Server Failover Cluster (WSFC) nodes.

Once the Active Directory domain controller is available, we can now configure the WSFC nodes. A high-level overview of the following tasks is listed below.

• Add and install the Failover Clustering, Multi-Path IO and .NET Framework 3.5 features
• Assign the IP address of the Active Directory-integrated DNS server to the Production subnet of the Public-Azure-East Azure VNet. This is to make sure that the virtual machine can join to the domain via the appropriate IP address
• Format the attached Azure hosted data disk
• Join the virtual machine to the domain

To configure the WSFC Nodes:

1. Login to the Azure Management portal using your credentials

2. Click the Virtual Machines link, and then select SQLNODE1

3. On the command bar, click Connect. This will prompt you to download a Remote Desktop connection file.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. Login to the virtual machine using the credentials that you used as per Example PowerShell script.

5. Run the PowerShell script below to perform the tasks listed in the high-level overview. Provide the domain administrator credentials that you used when creating the Active Directory domain controller. The virtual machine will reboot as part of the configuration.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Repeat the process to configure the Windows Server Failover Cluster node SQLNODE2 virtual machine.

Installing and Configuring StarWind Virtual SAN

Installation and configuration of StarWind Virtual SAN is similar to the process outlined in the StarWind Virtual SAN Hyper-Converged 2 Nodes Scenario with Hyper-V Cluster documentation. Download the latest version of StarWind Virtual SAN on the Azure virtual machines and proceed with the installation.

Installing StarWind Virtual SAN

The process outlined below should be performed on both SQLNODE1 and SQLNODE2. To install StarWind Virtual SAN on SQLNODE1, run the setup file.

1. In the Welcome to the StarWind Virtual SAN Setup Wizard dialog box, click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

2. In the License Agreement dialog box, select I accept the agreement and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. In the Information dialog box, click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. In the Select Destination Location dialog box, provide the file system path where you want to store the StarWind Virtual SAN binaries and executables. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. In the Select Components dialog box, verify that Full is selected in the drop down list and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

6. In the Select Start Menu Folder dialog box, verify the location of the shortcut to launch StarWind Virtual SAN. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

7. In the Select Additional Tasks dialog box, validate the selection by checking the Create a desktop icon check box. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

8. In the License Key dialog box, provide the appropriate license key. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

9. In the Ready to Install dialog box, verify that all of the configuration settings you’ve provided are correct. Click Install.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

10. In the Completing the StarWInd Virtual SAN Setup Wizard dialog box, click Finish. This completes the installation of StarWind Virtual SAN and will also launch the StarWind Management Console.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

After completing the installation, repeat all of the steps to install StarWind Virtual SAN on SQLNODE2.

Configuring StarWind Virtual SAN

After StarWind Virtual SAN has been installed on both SQLNODE1 and SQLNODE2, we will proceed to configure a hyper-converged storage for the Windows Server Failover Cluster. These steps can be performed on any of the virtual machines that we’ve installed StarWind Virtual SAN on. We will perform these steps on SQLNODE1.

1. Open the StarWind Management Console. It will ask you to specify the default storage pool on the server you’re connecting to for the first time. Click the Choose path… button.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

In the Open dialog box, select drive G and click Open. This is the Azure Data Disk that we added in the section Adding an Azure hosted data disk to the virtual machines used for the WSFC nodes.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

2. In the StarWind Management Console, select the Clusters link and click the Create new Cluster link. This will open the New Custer wizard. We will create a new StarWind Virtual SAN cluster that consists of SQLNODE1 and SQLNODE2.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. In the New Cluster dialog box, type the name of the StarWind Virtual SAN cluster and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. In the Specify next Step dialog box, select the Add server to cluster option and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. In the Add Server dialog box, click Next. This will add SQLNODE1 as a node to the StarWind Virtual SAN hyper-converged cluster.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

6. In the following dialog box, select the network interfaces for synchronization and heartbeat. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

7. In the Specify next Step dialog box, select the Add server to cluster option and click Add Server. We will add SQLNODE2 to the StarWind Virtual SAN hyper-converged cluster.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

8. In the Add Server dialog box, type the IP address of SQLNODE2 that is dedicated to the iSCSI traffic – 10.1.1.202. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Because SQLNODE2 has not been configured as an iSCSI target, it will ask you to specify the default storage pool on the server you’re connecting to for the first time. Click the Choose path… button.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

In the Open dialog box, select drive G and click Open. This is the Azure Data Disk that we added in the section Adding an Azure hosted data disk to the virtual machines used for the WSFC nodes.

9. In the Specify next Step dialog box, select the Finish option and click Finish. This completes the process of creating a StarWind Virtual SAN hyper-converged cluster and adding SQLNODE1 and SQLNODE2 to it.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Creating iSCSI Storage Devices

Once the StarWind Virtual SAN hyper-converged cluster has been created, we can start creating replicated iSCSI storage devices.

1. Open the StarWind Management Console. Expand the Clusters section, the name of the StarWind Virtual SAN hyper-converged cluster and select Devices. Right-click on Devices and select Create Clustered Storage. This will open the Create Clustered Storage wizard.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

2. In the Specify Storage Alias and Size dialog box, specify the name and size and size of the new storage device. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. In the Specify Storage Options dialog box, verify that the Thick-provisioned option is selected. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. In the Select Servers to use for Storage dialog box, make sure that both SQLNODE1 and SQLNODE2 are added in the list of selected servers. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. In the Summary dialog box, review the created storage device.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Repeat the process to create additional iSCSI storage devices. The storage devices created will be replicated between SQLNODE1 and SQLNODE2.

Discovering Target Portals

In this section, we will connect the iSCSI storage to the servers that will be added to the cluster.

NOTE: Windows Server 2012 R2 comes with iSCSI Initiator software that enables connection of a Windows host to an iSCSI storage array using network adapters. In this example, the iSCSI target is the same as the WSFC nodes. You can launch the tool from the Server Manager dashboard, under Tools and select iSCSI Initiator.

Also, make sure that the Windows Firewall is configured to allow iSCSI traffic on both SQLNODE1 and SQLNODE2.

The steps below are performed initially on SQLNODE1.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

You will get a message saying that the Microsoft iSCSI service is not running. Simply click Yes to continue.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

1. In the iSCSI Initiator Properties window, select the Discovery tab.

2. Click the Discover Portal… button. The Discover Target Portal dialog box appears.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. Type in the first IP address of the partner node you will use to connect to the highly available iSCSI devices. For this example, the IP address of SQLNODE1 is 10.1.1.201.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Click Advanced.

4. Select Microsoft ISCSI Initiator as your Local adapter. Select the Initiator IP in the same subnet as the IP address from the previous step. For this example, the first IP address of SQLNODE1 that communicates to the Initiator IP (SQLNODE1 is the same as the initiator and the target) is 10.1.1.201.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Click OK. Then click OK again to close the Discover Target Portal dialog box.

5. Click the Discover Portal button once again. The Discover Target Portal dialog appears.

6. Type in the second IP address of the partner node you will use to connect to the HA iSCSI devices. For this example, the IP address of SQLNODE2 is 10.1.1.202.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Click Advanced.

7. Select Microsoft ISCSI Initiator as your Local adapter. Select the Initiator IP in the same subnet as the IP address from the previous step. For this example, the second IP address of SQLNODE1 that communicates to the Initiator IP is 10.1.1.201.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Click OK. Then click OK again to close the Discover Target Portal dialog box.

SQLNODE1 should be connected to both iSCSI Targets via the following target portals.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

8. Repeat the same steps (steps #1 to #7) for the second node SQLNODE2 until all the target portals have been added. Note the following:

• 10.1.1.201 and 10.1.1.202 (IP addresses of iSCSI Targets)

SQLNODE2 should also be connected to both iSCSI Targets via the following target portals.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Connecting Targets and Configuring Multi-Pathing

In this section, we will connect the servers to the iSCSI targets and configure multi-pathing:

NOTE: The steps below are performed initially on SQLNODE1.

1. In the iSCSI Initiator Properties window, select the Targets tab. The iSCSI targets configured should be listed in the Discovered Targets section.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

2. Select the first target in the list and click Connect.

3. Enable both checkboxes. Click Advanced…

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. Select Microsoft iSCSI Initiator in the Local adapter drop down list.

In the Initiator IP drop down list, select the IP address of the server that connects to the corresponding initiator.

In the Target portal IP drop down list, select the IP address of the iSCSI Target where the Initiator IP address is mapped to.

NOTE: The selection for Initiator IP and Target portal IP addresses depend on the iSCSI target selected in Step #2. In this example, the target

iqn.2008-08.com.starwindsoftware:10.1.0.201-sql-disk-j

was selected. This corresponds to the iSCSI Qualified Name (IQN) of SQLNODE1. The Initiator IP address for SQLNODE2 (10.1.1.202) is used to connect to SQLNODE1.

Click OK.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. Select the partner target from the other iSCSI target node and click Connect. For the iSCSI target selected in Step #2, the partner target is

iqn.2008-08.com.starwindsoftware:10.1.0.202-sql-disk-j

6. Enable both checkboxes. Click Advanced…

7. Select Microsoft iSCSI Initiator in the Local adapter drop down list.

In the Initiator IP drop down list, select the IP address of the server that connects to the corresponding initiator.

In the Target portal IP drop down list, select the IP address of the iSCSI Target where the Initiator IP address is mapped to.

NOTE: The selection for Initiator IP and Target portal IP addresses depend on the iSCSI target selected in Step #5. In this example, the target

iqn.2008-08.com.starwindsoftware:10.1.0.202-sql-disk-j

was selected. This corresponds to the iSCSI Qualified Name (IQN) of SQLNODE2. The Initiator IP address for SQLNODE2 (10.1.1.202) is used to connect to SQLNODE1.

Click OK.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

8. Repeat the Steps #1 to #7 with the Initiator and Target portal IPs of the remaining iSCSI targets together with their corresponding partner targets. The server should now be connected to all provisioned highly available, fault tolerant iSCSI targets. The result should look similar to the one below.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

9. Repeat the Steps #1 to #8 on SQLNODE2.

10. Once all targets are connected, launch the MPIO manager from the Server Manager dashboard, under Tools and select MPIO

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

11. In the MPIO Properties dialog box, select the Discover Multi-Paths tab and enable the Add support for iSCSI devices checkbox.

12. Click the Add button and click OK.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Reboot the server to apply the changes. Repeat Step #10 to #12 on SQLNODE2.

Initialize and Format the Disks

In this section, we will initialize and format the iSCSI disks. You can launch the tool from the Server Manager dashboard, under Tools and select Computer Management.

NOTE: Going thru the disk initialization process is a great way to validate whether or not the storage replication process works as per vendor specification. Disk configuration changes made on one of the cluster nodes should be replicated over to the other nodes within the cluster. These steps have to be performed on both of the servers that will act as nodes in your failover cluster. The steps below are performed on SQLNODE1.

1. Expand Storage and select Disk Management.

2. When the Initialize Disk dialog box appears, make sure that all iSCSI disks previously configured are selected. Click OK.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. Right-click any of the disks that you want to configure and select Online.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. To create a disk partition, right-click on the unallocated space and select New Simple Volume.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. In the Welcome to the New Simple Volume Wizard dialog box, click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

6. In the Specify Volume Size dialog box, enter the volume size and click Next.

7. In the Assign Drive Letter or Path dialog box, specify the drive letter you would like to use and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

8. In the Format Partition dialog box,

• Make sure that the file system selected is NTFS.

• To follow Microsoft best practices on allocation unit size, select 64K.

• In the Volume label: text box, enter the appropriate name. For this example, SQL_DATA is used. Take note of this volume label because this will be used to verify the configuration on the other cluster node.

Click Next

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

9. In the Completing the New Simple Volume Wizard dialog box, review the settings you have made and click Finish.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

10. Repeat Steps #3 to #11 on all of the iSCSI disks that you want to configure as part of your cluster.

11. Repeat Step #2 on SQLNODE2. No need to initialize the iSCSI disks.

Verify the Storage Replication Process

In this section, we will verify the storage replication process. In order to verify this process, simply bring all of the disks on the other cluster nodes online, as per Step #2 in the previous section. If the storage replication works, the volume names will be propagated on all of the cluster nodes. In this example, the clustered disks have been named SQL_DATA, and SQL_LOG on SQLNODE1. After bringing the disks online on SQLNODE2, the same volume properties will appear. The drive letters will not be the same because Windows will assign them from the available drive letters on the server. The drive letters will be removed since they will be defined from within the Windows Server Failover Cluster.

This is just a simple way to verify if the storage replication works as expected. Make sure that this verification step has been done and that all potential issues have been addressed prior to moving to the next step.

Running the Failover Cluster Validation Wizard

In this section we will run the Failover Cluster Validation Wizard from the Failover Cluster Management console. You can launch the tool from the Server Manager dashboard, under Tools and select Failover Cluster Manager.

NOTE: These steps can be performed on any of the servers that will act as WSFC nodes. The steps below are performed on SQLNODE1.

1. In the Failover Cluster Management console, under the Management section, click the Validate Configuration link. This will run the Validate a Configuration Wizard.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

2. In the Select Servers or a Cluster dialog box, enter the hostnames of the nodes that you want to add as members of your cluster. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. In the Testing Options dialog box, click Next to run all the necessary tests to validate whether or not the nodes are OK for clustering.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. In the Confirmation dialog box, click Next. This will run all the necessary validation tests.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. In the Summary dialog box, verify that all the report returns successfully. Click Finish to create the Windows Server Failover Cluster.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

NOTE: The Cluster Validation Wizard may report Warning messages pertaining to storage. You can ignore these warnings since we are using replicated storage instead of shared disks. In general, resolve all errors prior to proceeding with the next steps.

Creating the Windows Server 2012 R2 Failover Cluster

In this section we will create a Windows Server 2012 R2 Failover Cluster from the Failover Cluster Management console. You can launch the tool from the Server Manager dashboard, under Tools and select Failover Cluster Manager. Alternatively, the Create Cluster Wizard will automatically run after the Failover Cluster Validation Wizard runs the first time.

NOTE: These steps can be performed on any of the servers that will act as WSFC nodes. The steps below are performed on SQLNODE1.

1. Under the Management section, click the Create a Cluster link. This will run the Create Cluster Wizard.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

2. In the Select Servers dialog box, enter the hostnames of the nodes that you want to add as members of your cluster. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. In the Access Point for Administering the Cluster dialog box, enter the WSFC virtual hostname/client access point that you will use to administer the cluster. The WSFC will use a DHCP-assigned IP address for the virtual hostname since both SQLNODE1 and SQLNODE2 use DHCP-requested IP addresses, not statically assigned. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. In the Confirmation dialog box, click Next. This will configure Failover Clustering on both nodes of the cluster, add the configured replicated storage, add Active Directory and DNS entries for the WSFC virtual hostname/client access point.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. In the Summary dialog box, verify that the report returns successful results.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

NOTE: You will need to configure the virtual IP address of the WSFC virtual hostname/client access point. Since we have two (2) vNICs, the cluster will assign a virtual IP address for both. We only need one virtual IP address for the WSFC. Also, Azure will attempt to assign an IP address that is currently used by one of the virtual machines. This makes one of the virtual machines inaccessible via Remote Desktop or any other services running on it like the StarWind Virtual SAN. We will need to assign an unused IP address to the WSFC client access point to resolve this conflict.

As a best practice, rename all of the clustered storage and networks for ease of identification during the installation of the SQL Server failover clustered instance.

Fixing the Windows Server Failover Cluster Client Access Point

In this section, we will fix the Windows Server Failover Cluster virtual host name/client access point. Since Azure assigned a duplicate IP address for the WSFC virtual host name/client access point, we need to re-assign a new IP address from the address pool of the Production subnet of the Public-Azure-East Azure VNet. This task is performed using the Failover Cluster Manager console.

NOTE: These steps can be performed on any of the servers that will act as WSFC nodes. The steps below are performed on SQLNODE1.

1. Open the Failover Cluster Manager console in Administrator mode.

2. In the Cluster Core Resources section, select the name of the WSFC virtual host name/client access point.

3. Right-click and select Properties.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. In the Name: WINCLUSAZURE Properties dialog box,

• In the General tab, under the IP Addresses section, select the IP address corresponding to the Heartbeat-iSCSI subnet of the Public-Azure-East Azure VNet – 10.1.1.0/24. Click Remove. This will remove the virtual IP address assigned on the Heartbeat-iSCSI vNIC.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

• Click OK.

• When prompted to confirm action, click Yes. This will take the WSFC offline since the remaining virtual IP address is a duplicate IP address from one of the virtual machines.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. In the Cluster Core Resources section, select the remaining virtual IP address of the WSFC virtual host name/client access point.

6. Right-click and select Properties.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

7. In the IP Address: 10.1.0.20x Properties dialog box,

• In the General tab, under the IP Address section, select the Static IP address option button and type 10.1.0.250 in the Address text box. The IP address could be anything within the range of the Production subnet of the Public-Azure-East Azure VNet so long as it is available.

• Click OK. This will assign the new static IP address to the WSFC virtual host name/client access point.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

8. In the Cluster Core Resources section, select the name of the WSFC virtual host name/client access point.

9. Right-click and select Bring Online. This will bring the WSFC virtual host name/client access point online together with the newly assigned static IP address.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Because the WSFC virtual host name/client access point now has a different IP address from the ones used by the virtual machines, all of the services on both of the virtual machines will now become available.

Configuring Cluster Quorum Settings

In order for the WSFC to maintain quorum, we need to add another vote in the form of a file share witness. In this section, we will configure the cluster quorum setting using a file share witness. We need to create a file share on the domain controller for this purpose and grant the Windows Failover Cluster virtual server name Read/Write permissions to it.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

NOTE: These steps can be performed on any of the servers that will act as WSFC nodes. The steps below are performed on SQLNODE1.

1. Open the Failover Cluster Manager console in Administrator mode.

2. Select the name of the WSFC virtual host name/client access point.

3. Right-click, select More Actions, and click Configure Cluster Quorum Settings… This will open up the Configure Cluster Quorum Wizard.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. In the Select Quorum Configuration dialog box, choose the Select the quorum witness option. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. In the Select Quorum Witness dialog box, choose the Configure a file share witness option. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

6. In the Configure File Share Witness dialog box, type the path of the file share witness.
Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

7. In the Confirmation dialog box, review the configuration settings and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

8. In the Summary dialog box, verify that the entire configuration is successful.

Installing SQL Server 2014 on a Failover Cluster

In this section, we will install SQL Server 2014 failover clustered default instance on a Windows Server Failover Cluster in Microsoft Azure. We will run the installation process on the first node of our cluster, SQLNODE1.

1. Run setup.exe from the SQL Server 2014 installation media to launch SQL Server Installation Center. Click on the Installation link on the left side.

2. Click the New SQL Server failover cluster installation link. This will run the SQL Server 2014 Setup wizard.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. In the Product Key dialog box, enter the product key that came with your installation media and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

4. In the License Terms dialog box, click the I accept the license terms check box and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

5. In the Global Rules dialog box, validate that the checks return successful results and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

6. In the Microsoft Update dialog box, click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

7. In the Install Failover Cluster Rules dialog box, validate that the checks return successful results. If the checks returned a few warnings, make sure you fix them before proceeding with the installation. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

8. In the Setup Role dialog box, select the SQL Server Feature Installation option and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

9. In the Feature Selection dialog box, select the following components – Database Engine Services and Management Tools. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

10. In the Feature Rules dialog box, verify that all the rules have passed. If the rules returned a few warnings, make sure you fix them before proceeding with the installation.
Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

11. In the Instance Configuration dialog box, enter the following details:

SQL Server Network Name: SQLCLUSAZURE

Instance ID: MSSQLSERVER

Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

12. In the Cluster Resource Group dialog box, check the resources available on your Windows Server Failover Cluster. This tells you that a new Resource Group will be created on your cluster for the SQL Server instance. To specify the SQL Server cluster resource group name, you can either use the drop-down box to specify an existing group to use or type the name of a new group to create it. Accept all the defaults and click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

13. In the Cluster Disk Selection dialog box, select the available disk groups that are on the cluster for SQL Server 2014 to use. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

14. In the Cluster Network Configuration dialog box, enter the virtual IP address that the SQL Server 2014 failover clustered instance will use. Select the checkbox beside the IPv4 column as a static IP addresses will be used instead of DHCP-assigned. Click Next.

• Address: 10.1.0.180 (similar to virtual IP address for the WSFC virtual host name/client access point, the IP address could be anything within the range of the Production subnet of the Public-Azure-East Azure VNet so long as it is available).

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

NOTE: The network adapter settings that will be displayed in this dialog box will depend on how the cluster network adapters are configured. Be sure to configure the Heartbeat-iSCSI network adapters with the Do not allow cluster network communication on this network option.

15. In the Server Configuration dialog box, use the following credentials for the SQL Server service accounts in the Service Accounts tab. Make sure that both the SQL Server Agent and SQL Server Database Engine services have a Startup Type of Manual. The Windows Server Failover Cluster will take care of stopping and starting the service. Also, set the Collation property for the instance according to your application requirement.

• SQL Server Agent: TESTDOMAIN\sqlservice

• SQL Server Database Engine: TESTDOMAIN\sqlservice

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Click Next.

16. In the Database Engine Configuration dialog box, select the appropriate Authentication Mode in the Server Authentication tab. If you want to add the currently logged on user to be a part of the SQL Server administrators group, click the Add Current User button. Otherwise, you can add the appropriate domain accounts or security groups.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

In the Data Directories tab, enter the following based on the available clustered disks

Data root directory: J:\
User database directory: J:\MSSQL12.MSSQLSERVER\MSSQL\Data
User database log directory: L:\MSSQL12.MSSQLSERVER\MSSQL\Data
Temp DB directory: J:\MSSQL12.MSSQLSERVER\MSSQL\Data
Temp DB log directory: L:\MSSQL12.MSSQLSERVER\MSSQL\Data
Backup directory: J:\MSSQL12.MSSQLSERVER\MSSQL\Backup

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

NOTE: Introduced in SQL Server 2012 is the option to store the tempdb database on a local drive instead of a clustered drive. For a WSFC in Microsoft Azure, it is recommended to store the tempdb database on a local drive instead of the replicated storage. Make sure that all of the nodes in the cluster contain the same directory structure and that the SQL Server service account has read/write permissions on those folders.

17. In the Feature Configuration Rules dialog box, click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

18. In the Ready to Install dialog box, verify that all configurations are correct. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

19. Once the installation finishes, in the Complete dialog box, click Close.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Adding a Node on a SQL Server 2014 Failover Cluster

In this section, we will add a node to the SQL Server 2014 failover clustered default instance on a Windows Server Failover Cluster. We will run the installation process on the second node of the cluster, SQLNODE2.

To add a node to a SQL Server 2014 failover clustered instance:

1. Run setup.exe from the installation media to launch SQL Server Installation Center.

2. Click on the Installation link on the left side. Click the Add node to a SQL Server failover cluster link. This will run the SQL Server 2014 Setup wizard.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

3. In the Product Key dialog box, enter the product key that came with your installation media and click Next.

4. In the License Terms dialog box, click the I accept the license terms check box and click Next.

5. In the Global Rules dialog box, validate that the checks return successful results and click Next.

6. In the Microsoft Update dialog box, click Next.

7. In the Add Node Rules dialog box, validate that the checks return successful results. If the checks returned a few warnings, make sure you fix them before proceeding with the installation. Click Next.

8. In the Cluster Node Configuration dialog box, validate that the information for the existing SQL Server 2014 failover clustered instance is correct. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

9. In the Cluster Node Configuration dialog box, validate that the information for the existing SQL Server 2014 failover clustered instance is correct. Click Next.

10. In the Service Accounts dialog box, verify that the information is the same as what was used to configure the first node. Provide the appropriate password for the SQL Server service accounts. Click Next.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

11. In the Feature Rules dialog box, click Next.

12. In the Ready to Add Node dialog box, verify that all configurations are correct and click Install.

13. Once the installation finishes, in the Complete dialog box, click Close. This concludes adding a node to a SQL Server 2014 Failover Cluster.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

NOTE: When storing the tempdb database in a local drive instead of a replicated drive, be sure that:

• The same drive letter and folder structure exists in all of the nodes in the cluster

• The SQL Server service account has the appropriate permissions on the folder where tempdb will be created

Creating an Azure Internal Load Balancer

In this section, we will create an Azure internal load balancer to forward traffic from the Azure VNet to the virtual machines. Client applications that connect to the SQL Server failover clustered instance will need to connect to the internal load balancer instead of connecting directly to the virtual IP address. An Azure internal load balancer consist of the Azure cloud service IP address and a port number that the client applications will connect to.

We will use Windows PowerShell with the Azure PowerShell modules to perform the following tasks.

NOTE: The process for creating an Azure load balancer will be different depending on where the client applications will access the SQL Server failover clustered instance. For this example, we will assume that the client applications will also be running on Microsoft Azure but reside on a different Azure cloud service than the one that contains the SQL Server failover clustered instance. A more detailed coverage of Azure load balancers is described in Load Balancing for Azure Infrastructure Services.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

NOTE: The endpoint port number of the Azure internal load balancer (1433), the probe port number (59999) and port number 1434 (used by the SQL Browser service) should be opened on the Windows Firewall of both the WSFC nodes.

Updating the SQL Server Failover Clustered Instance Virtual Network Name

In this section, we will update the SQL Server Failover Clustered Instance virtual network name and assign the IP address of the Azure internal load balancer together with the probe port number. We will also take the cluster resource group offline and back up online for the changes to take effect. We will use Windows PowerShell to accomplish this task.

NOTE: These steps can be performed on any of the servers that will act as WSFC nodes. The steps below are performed on SQLNODE1.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Testing Application Connectivity

In this section, we will test application connectivity for SQL Server 2014 failover clustered instance running on Microsoft Azure. We will use SQL Server 2014 Management Studio to perform the following tasks.

NOTE: For client connectivity using the Azure internal load balancer, client connections to the SQL Server failover clustered instance virtual network name must come from machines that reside in a different Azure cloud service than the one that hosts the WSFC nodes. In the example below, the virtual machine named SQLClient is on the SQLFailover-client.cloudapp.net cloud service. However, it is using the Production subnet of the Public-Azure-East Azure VNet, configured with an internal IP address of 10.1.0.211 and uses AD-DC1 as the internal DNS server.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines

To connect to the SQL Server failover clustered instance, we can use the SQL Server virtual network name in SQL Server Management Studio.

Installing and Configuring a SQL Server Failover Clustered Instance on Microsoft Azure Virtual Machines