Cloud and Datacenter Management Blog

Microsoft Hybrid Cloud blogsite about Management

#SQL 2014 Guest Cluster with Shared VHDX on #Hyperv 2012 R2 Cluster for #WAPack

Leave a comment


Our configuration and requirements before we begin the Guest SQL 2014 Cluster with Shared VHDX on a Hyper-V Cluster :

  1. Microsoft Hyper-V 2012 R2 Cluster is running with Cluster Shared Volumes.
  2. We made Two virtual Machines with Microsoft Windows Server 2012 R2 called SQL01 and SQL02
  3. Networking Two NICS : One on the Production Switch and NIC two on the Heart Beat Switch.

This step shows how to create and then share a virtual hard disk that is in the .vhdx file format. Repeat this step for each shared .vhdx file that you want to add. For example, you may want to add one or more shared disks that will act as data disks, and a separate shared disk that you can designate as the disk witness for the guest failover cluster.

  1. In Failover Cluster Manager, expand the cluster name, and then click Roles.
  2. In the Roles pane, right-click the virtual machine on which you want to add a shared virtual hard disk, and then click Settings.
  3. In the virtual machine settings, under Hardware, click SCSI Controller.
  4. In the details pane, click Hard Drive, and then click Add.
  5. In the Hard Drive details pane, under Virtual hard disk, click New.The New Virtual Hard Disk Wizard opens.
  6. On the Before You Begin page, click Next.
  7. On the Choose Disk Format page, accept the default format of VHDX, and then click Next.
    noteNote
    To share the virtual hard disk, the format must be .vhdx.
  8. On the Choose Disk Type page, select Fixed size or Dynamically expanding, and then click Next.
    noteNote
    A differencing disk is not supported for a shared virtual hard disk.
  9. On the Specify Name and Location page, do the following:
    1. In the Name box, enter the name of the shared virtual hard disk.
    2. In the Location box, enter the path of the shared storage location.For Scenario 1, where the shared storage is a CSV disk, enter the path:C:\ClusterStorage\VolumeX, where C:\ represents the system drive, and X represents the desired CSV volume number.

      For Scenario 2, where the shared storage is an SMB file share, specify the path:

      \\ServerName\ShareName, where ServerName represents the client access point for the Scale-Out File Server, and ShareName represents the name of the SMB file share.

    3. Click Next.
  10. On the Configure Disk page, accept the default option of Create a new blank virtual hard disk, specify the desired size, and then click Next.
  11. On the Completing the New Virtual Hard Disk Wizard page, review the configuration, and then click Finish.
    ImportantImportant
    If the virtual machine is running, do not click Apply in the virtual machine settings before you continue to the next procedure. If you do click Apply on a running virtual machine, you will need to stop the virtual machine or remove and then add the virtual hard disk without clicking Apply.
Advanced Features
  1. In the virtual machine settings, under SCSI Controller, expand the hard drive that you created in the previous procedure.
  2. Click Advanced Features.
  3. In the details pane, select the Enable virtual hard disk sharing check box.
    noteNote
    If the check box appears dimmed and is unavailable, you can do either of the following:

    • Remove and then add the virtual hard disk to the running virtual machine. When you do, ensure that you do not click Apply when the New Virtual Hard Disk Wizard completes. Instead, immediately configure sharing in Advanced Features.
    • Stop the virtual machine, and then select the Enable virtual hard disk sharing check box.
  4. Click Apply, and then click OK.
  5. Add the virtual hard disk to each virtual machine that will use the shared .vhdx file. When you do, repeat this procedure to enable virtual hard disk sharing for each virtual machine that will use the disk.
TipTip
To share a virtual hard disk by using Windows PowerShell, use the Add-VMHardDiskDrive cmdlet with the –ShareVirtualDisk parameter. You must run this command as an administrator on the Hyper-V host for each virtual machine that will use the shared .vhdx file. For example, the following command adds a shared virtual hard disk (Data1.vhdx) on volume 1 of CSV to a virtual machine that is named VM1.Add-VMHardDiskDrive -VMName VM1 -Path C:\ClusterStorage\Volume1\Data1.vhdx -ShareVirtualDisk The following command adds a shared virtual hard disk (Witness.vhdx) that is stored on an SMB file share (\\Server1\Share1) to a virtual machine that is named VM2.Add-VMHardDiskDrive -VMName VM2 -Path \\Server1\Share1\Witness.vhdx -ShareVirtualDisk

For the Second Guest clusternode you will add the same VHDX files you created on the first Guest clusternode and share them also like on the first clusternode.

Failover Cluster Manager 2

So now we have a Shared Quorum Disk and a Shared Data Disk

The next steps :

  • Bring the disks Online on the first Guest node with Disk Management
  • Install Failover Cluster on both nodes.
  • Make a two node Cluster
  • Install a Microsoft SQL 2014 Guest Cluster.

Disk ManagementShared VHDX disks are Online

Install Microsoft Failover Cluster.

Failover Cluster Manager 3Cluster02 is Online with both Shared VHDX disks for the Guest SQL 2014 Cluster

Install Microsoft SQL 2014 Server for Clustering.

Failover Cluster Manager 3b

Microsoft SQL 2014 Server is installed on the Guest Cluster on top of an Hyper-V 2012 R2 Cluster

Failover Cluster Manager 4

Guest SQL 2014 Cluster is running on Hyper-V 2012 R2.

SQL2014 Studio

So now we are ready for installing Microsoft SPF and Windows Azure Pack for Windows Server 2012 R2 🙂

Author: James van den Berg

I'm Microsoft Architect and ICT Specialist and Microsoft MVP Cloud and Datacenter Management Microsoft MVP Windows Insider Microsoft Tech Community Insider Microsoft Azure Advisor

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.