|
| 1 | +--- |
| 2 | +title: Create an FCI with Azure Elastic SAN (Preview) |
| 3 | +description: "Use Azure Elastic SAN to create a failover cluster instance (FCI) with SQL Server on Azure Virtual Machines." |
| 4 | +author: AbdullahMSFT |
| 5 | +ms.author: amamun |
| 6 | +ms.reviewer: mathoma |
| 7 | +ms.date: 08/05/2024 |
| 8 | +ms.service: virtual-machines-sql |
| 9 | +ms.subservice: hadr |
| 10 | +ms.topic: how-to |
| 11 | +ms.custom: |
| 12 | + - na |
| 13 | + - devx-track-azurepowershell |
| 14 | +editor: monicar |
| 15 | +tags: azure-service-management |
| 16 | +--- |
| 17 | + |
| 18 | +# Create an FCI with Azure Elastic SAN (Preview) - SQL Server on Azure VMs |
| 19 | +[!INCLUDE[appliesto-sqlvm](../../includes/appliesto-sqlvm.md)] |
| 20 | + |
| 21 | +This article explains how to create a failover cluster instance (FCI) by using an Azure Elastic SAN volume with SQL Server on Azure Virtual Machines (VMs). |
| 22 | + |
| 23 | +To learn more, see an overview of [FCI with SQL Server on Azure VMs](failover-cluster-instance-overview.md) and [cluster best practices](hadr-cluster-best-practices.md). |
| 24 | + |
| 25 | +> [!NOTE] |
| 26 | +> Configuring your failover cluster instance with an Azure Elastic SAN is currently in preview for SQL Server on Azure VMs. |
| 27 | +
|
| 28 | +## Prerequisites |
| 29 | + |
| 30 | +Before you complete the instructions in this article, you should already have: |
| 31 | + |
| 32 | +- An Azure subscription. Get started with a [free Azure account](https://azure.microsoft.com/free/). |
| 33 | +- [Two or more prepared Azure Windows virtual machines](failover-cluster-instance-prepare-vm.md) in the same availability zone. Since all VMs part of the FCI have to be in the same availability zone, the VM availability is only 99.9%. |
| 34 | +- An account that has permissions to create objects on both Azure virtual machines and in Active Directory. |
| 35 | + |
| 36 | +[!INCLUDE[tip-for-multi-subnet-ag](../../includes/virtual-machines-fci-multi-subnet.md)] |
| 37 | + |
| 38 | +## Create Azure Elastic SAN |
| 39 | + |
| 40 | +Follow the instructions to [Create an Azure Elastic SAN](/azure/storage/elastic-san/elastic-san-create). |
| 41 | + |
| 42 | +Your Elastic SAN should be: |
| 43 | + |
| 44 | +- In the same resource group as your SQL Server on Azure VM. |
| 45 | +- Configured for zone redundancy. |
| 46 | +- In the same availability zone as the primary SQL Server VM. |
| 47 | + |
| 48 | +## Connect Elastic SAN volumes to the VMs |
| 49 | + |
| 50 | +Follow the instructions to [Connect Elastic SAN volumes](/azure/storage/elastic-san/elastic-san-connect-windows) to both SQL Server VMs. |
| 51 | + |
| 52 | +Use [Disk Management](/windows-server/storage/disk-management/overview-of-disk-management) to format your Elastic SAN volume and bring it online. |
| 53 | + |
| 54 | + |
| 55 | +## Create Windows Failover Cluster |
| 56 | + |
| 57 | +The steps to create your Windows Server Failover Cluster differ between single subnet and multi-subnet environments. To create your cluster, follow the steps in the tutorial for either a [multi-subnet scenario](availability-group-manually-configure-tutorial-multi-subnet.md#add-failover-cluster-feature) or a [single subnet scenario](availability-group-manually-configure-tutorial-single-subnet.md#create-the-cluster). Though these tutorials create an availability group, the steps to create the cluster are the same for a failover cluster instance. |
| 58 | + |
| 59 | +## Configure quorum |
| 60 | + |
| 61 | +Since the disk witness is the most resilient quorum option, it's recommended to configure a disk witness as the quorum solution. Cloud witness isn't currently supported with Azure Elastic SAN. |
| 62 | + |
| 63 | +If you have an even number of votes in the cluster, configure the [quorum solution](hadr-cluster-quorum-configure-how-to.md) that best suits your business needs. For more information, see [Quorum with SQL Server VMs](hadr-windows-server-failover-cluster-overview.md#quorum). |
| 64 | + |
| 65 | +## Validate cluster |
| 66 | + |
| 67 | +Validate the cluster on one of the virtual machines by using the Failover Cluster Manager UI or PowerShell. |
| 68 | + |
| 69 | +Before you validate the cluster, take the Elastic SAN volume offline by following these steps: |
| 70 | + |
| 71 | +1. Under **Server Manager**, select **Tools**, and then select **Failover Cluster Manager**. |
| 72 | +1. Under the cluster, select **Disks** under **Storage**. |
| 73 | +1. Right-click the Elastic SAN disk, and then select **Take Offline**: |
| 74 | + |
| 75 | + :::image type="content" source="media/failover-cluster-instance-azure-elastic-san-manually-configure/take-cluster-disk-offline.png" alt-text="Screenshot of Failover Cluster Manager, with the disk selected and take offline highlighted. "::: |
| 76 | + |
| 77 | +1. Select **Yes** on the **Offline Cluster Shared Volume** dialog box to confirm that you're sure, and want to take the disk offline. |
| 78 | + |
| 79 | +To validate the cluster by using the UI, follow these steps: |
| 80 | + |
| 81 | +1. Right-click the cluster in **Failover Cluster Manager**, select **Validate Cluster** to open the **Validate a Configuration Wizard**. |
| 82 | +1. On the **Validate a Configuration Wizard**, select **Next**. |
| 83 | +1. On the **Select Servers or a Cluster** page, enter the names of both virtual machines. |
| 84 | +1. On the **Testing options** page, select **Run all tests (recommended)** and then select **Next**. |
| 85 | +1. On the **Confirmation** page, select **Next**. The **Validate a Configuration** wizard runs the validation tests. |
| 86 | + |
| 87 | +To validate the cluster by using PowerShell, run the following script from an administrator PowerShell session on one of the virtual machines: |
| 88 | + |
| 89 | +```powershell |
| 90 | +Test-Cluster –Node ("<node1>","<node2>") –Include "Cluster Configuration", "Inventory", "Network", "Storage", "System Configuration" |
| 91 | +``` |
| 92 | + |
| 93 | +After your cluster has been validated, use the **Disks** page for your cluster in **Failover Cluster Manager** to bring your Elastic SAN volume back online. |
| 94 | + |
| 95 | +## Test cluster failover |
| 96 | + |
| 97 | +Test the failover of your cluster. In **Failover Cluster Manager**, right-click your cluster, select **More Actions** > **Move Core Cluster Resource** > **Select node**, and then select the other node of the cluster. Move the core cluster resource to every node of the cluster, and then move it back to the primary node. Ensure you can successfully move the cluster to each node before installing SQL Server. |
| 98 | + |
| 99 | +:::image type="content" source="media/failover-cluster-instance-premium-file-share-manually-configure/test-cluster-failover.png" alt-text="Screenshot of testing cluster failover by moving the core resource to the other nodes."::: |
| 100 | + |
| 101 | + |
| 102 | +## Create SQL Server FCI |
| 103 | + |
| 104 | +After you've configured the failover cluster and all cluster components, including storage, you can create the SQL Server FCI. |
| 105 | + |
| 106 | +### Create first node in the SQL FCI |
| 107 | + |
| 108 | +To create the first node in the SQL Server FCI, follow these steps: |
| 109 | + |
| 110 | +1. Connect to the first virtual machine by using Remote Desktop Protocol (RDP) or Bastion. |
| 111 | + |
| 112 | +1. In **Failover Cluster Manager**, make sure that all core cluster resources are on the first virtual machine. If necessary, move the disks to that virtual machine. |
| 113 | + |
| 114 | +1. Locate the installation media. If the virtual machine uses one of the Azure Marketplace images, the media is located at `C:\SQLServer_<version number>_Full`. |
| 115 | + |
| 116 | +1. Select **Setup**. |
| 117 | + |
| 118 | +1. In **SQL Server Installation Center**, select **Installation**. |
| 119 | + |
| 120 | +1. Select **New SQL Server failover cluster installation**. Follow the instructions in the wizard to install the SQL Server FCI. |
| 121 | + |
| 122 | +1. On the **Cluster Disk Selection** page, select the Azure Elastic SAN volume. |
| 123 | + |
| 124 | +1. On the **Cluster Network Configuration** page, the IP you provide varies depending on if your SQL Server VMs were deployed to a single subnet, or multiple subnets. |
| 125 | + |
| 126 | + 1. For a **single subnet environment**, provide the IP address that you plan to add to the [Azure Load Balancer](failover-cluster-instance-vnn-azure-load-balancer-configure.md) |
| 127 | + 1. For a **multi-subnet environment**, provide the secondary IP address in the subnet of the _first_ SQL Server VM that you previously designated as the [IP address of the failover cluster instance network name](failover-cluster-instance-prepare-vm.md#assign-secondary-ip-addresses): |
| 128 | + |
| 129 | + :::image type="content" source="./media/failover-cluster-instance-azure-shared-disk-manually-configure/sql-install-cluster-network-secondary-ip-vm-1.png" alt-text="Screenshot that provides the secondary IP address in the subnet of the first SQL Server VM."::: |
| 130 | + |
| 131 | +1. On the **Database Engine Configuration** page, ensure the database directories are on the Azure Elastic SAN volume. |
| 132 | + |
| 133 | +1. After you complete the instructions in the wizard, setup installs the SQL Server FCI on the first node. |
| 134 | + |
| 135 | +### Add additional nodes the SQL FCI |
| 136 | + |
| 137 | +To add an additional node to the SQL Server FCI, follow these steps: |
| 138 | + |
| 139 | +1. After FCI installation succeeds on the first node, connect to the second node by using RDP or Bastion. |
| 140 | + |
| 141 | +1. Open the **SQL Server Installation Center**, and then select **Installation**. |
| 142 | + |
| 143 | +1. Select **Add node to a SQL Server failover cluster**. Follow the instructions in the wizard to install SQL Server and add the node to the FCI. |
| 144 | + |
| 145 | +1. For a multi-subnet scenario, in **Cluster Network Configuration**, enter the secondary IP address in the subnet of the _second_ SQL Server VM subnet that you previously designated as the [IP address of the failover cluster instance network name](failover-cluster-instance-prepare-vm.md#assign-secondary-ip-addresses) |
| 146 | + |
| 147 | + :::image type="content" source="./media/failover-cluster-instance-azure-shared-disk-manually-configure/sql-install-cluster-network-secondary-ip-vm-2.png" alt-text="Screenshot that enters the secondary IP address in the subnet of the second SQL Server VM."::: |
| 148 | + |
| 149 | + After selecting **Next** in **Cluster Network Configuration**, setup shows a dialog box indicating that SQL Server Setup detected multiple subnets as in the example image. Select **Yes** to confirm. |
| 150 | + |
| 151 | + :::image type="content" source="./media/failover-cluster-instance-azure-shared-disk-manually-configure/sql-install-multi-subnet-confirmation.png" alt-text="Screenshot that shows the multi-subnet confirmation. "::: |
| 152 | + |
| 153 | +1. After you complete the instructions in the wizard, setup adds the second SQL Server FCI node. |
| 154 | + |
| 155 | +1. Repeat these steps on any other SQL Server VMs you want to participate in the SQL Server failover cluster instance. |
| 156 | + |
| 157 | +>[!NOTE] |
| 158 | +> Azure Marketplace gallery images come with SQL Server Management Studio installed. If you didn't use a marketplace image [Download SQL Server Management Studio (SSMS)](/sql/ssms/download-sql-server-management-studio-ssms). |
| 159 | +
|
| 160 | +## Register with SQL IaaS Agent extension |
| 161 | + |
| 162 | +To manage your SQL Server VM from the portal, register it with the [SQL IaaS Agent extension](sql-agent-extension-manually-register-single-vm.md). Note that only [limited functionality](sql-server-iaas-agent-extension-automate-management.md#feature-benefits) will be available to SQL Server VMs that have failover clustered instances of SQL Server (FCIs). |
| 163 | + |
| 164 | +If your SQL Server VM has already been registered with the SQL IaaS Agent extension and you've enabled any features that require the agent, you'll need to [unregister](sql-agent-extension-manually-register-single-vm.md#unregister-from-extension) the SQL Server VM from the extension and register it again after your FCI is installed. |
| 165 | + |
| 166 | +Register a SQL Server VM with PowerShell (-LicenseType can be `PAYG` or `AHUB`): |
| 167 | + |
| 168 | +```powershell-interactive |
| 169 | +# Get the existing compute VM |
| 170 | +$vm = Get-AzVM -Name <vm_name> -ResourceGroupName <resource_group_name> |
| 171 | +
|
| 172 | +# Register SQL VM with SQL IaaS Agent extension |
| 173 | +New-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -Location $vm.Location ` |
| 174 | + -LicenseType <license_type> |
| 175 | +``` |
| 176 | + |
| 177 | +## Configure connectivity |
| 178 | + |
| 179 | +If you deployed your SQL Server VMs in multiple subnets, skip this step. If you deployed your SQL Server VMs to a single subnet, then you'll need to configure an additional component to route traffic to your FCI. You can configure a virtual network name (VNN) with an Azure Load Balancer, or a distributed network name for a failover cluster instance. [Review the differences between the two](hadr-windows-server-failover-cluster-overview.md#virtual-network-name-vnn) and then deploy either a [distributed network name](failover-cluster-instance-distributed-network-name-dnn-configure.md) or a [virtual network name and Azure Load Balancer](failover-cluster-instance-vnn-azure-load-balancer-configure.md) for your failover cluster instance. |
| 180 | + |
| 181 | +## Limitations |
| 182 | + |
| 183 | +- Azure virtual machines support Microsoft Distributed Transaction Coordinator (MSDTC) on Windows Server 2019 with storage on CSVs and a [standard load balancer](/azure/load-balancer/load-balancer-overview). MSDTC is not supported on Windows Server 2016 and earlier. |
| 184 | +- SQL Server FCIs registered with the SQL IaaS Agent extension don't support features that require the agent, such as automated backup, patching, Microsoft Entra authentication and advanced portal management. See the [table of benefits](sql-server-iaas-agent-extension-automate-management.md#feature-benefits) for more information. |
| 185 | + |
| 186 | +## Next steps |
| 187 | + |
| 188 | +If Azure shared disks are not the appropriate FCI storage solution for you, consider creating your FCI using [premium file shares](failover-cluster-instance-premium-file-share-manually-configure.md) or [Storage Spaces Direct](failover-cluster-instance-storage-spaces-direct-manually-configure.md) instead. |
| 189 | + |
| 190 | +To learn more, see: |
| 191 | + |
| 192 | +- [Windows Server Failover Cluster with SQL Server on Azure VMs](hadr-windows-server-failover-cluster-overview.md) |
| 193 | +- [Failover cluster instances with SQL Server on Azure VMs](failover-cluster-instance-overview.md) |
| 194 | +- [Failover cluster instance overview](/sql/sql-server/failover-clusters/windows/always-on-failover-cluster-instances-sql-server) |
| 195 | +- [HADR settings for SQL Server on Azure VMs](hadr-cluster-best-practices.md) |
0 commit comments