Windows Server 2012 Hyper-V Cluster – Part 3: Shared Storage

You’ve already built your domain controller and failover cluster nodes. Now all we need to do is build some shared storage for our Hyper-V cluster before we can kick off with some serious cluster magic.

Sander BerkouwerMVP By Sander Berkouwer - Fri, September 13, 2013 - 0 comments

Sander Berkouwer is a Microsoft Certified Professional and a Microsoft Most Valuable Professional (MVP) with over a decade of experience in IT.

Articles in this series

Windows Server 2012 Hyper-V cluster

Contents of this article
  1. Task 4: Create your shared storage

Task 4: Create your shared storage

In this task, we’ll build a Windows Server 2012 installation with iSCSI targets.

Configure the storage hardware

With two 320GB disks on my shared storage box, I opted to use the hardware RAID capabilities of the box itself to create redundancy and the best performance.

Install Windows Server 2012

I won’t cover installing Windows Server 2012, since this was already covered in Part 2 of this series as part of the installation steps to create a domain controller.

Configure Windows Server 2012

When installation of Windows Server 2012 is finished, you will be presented with the screen to change the password for the local administrator. Change it by performing the same steps as before. Then, perform these steps:

  1. After login, you will be presented with the Server Manager. Click Local Server in the left pane.
  2. In the main pane on the System Properties screen, click the automatically generated name to the left of Computer name, and then click the Change… button. Change the computer name to something more obvious. I chose SAN. Click OK when done. Click OK on the Computer Name / Domain Changes screen to acknowledge the server has to restart to apply these changes. Click Close on the System Properties screen, and then Restart Now on the generic screen.
  3. After the server reboots, log on. Click Local Server again in the left pane of Server Manager; this time, click the text Ipv4 address assigned by DHCP, Ipv6 enabled next to Ethernet. Right-click the Network Interface Card (NIC) on the Network Connections screen and select Properties from the context menu. Double-click IPv4 in the list of items and then select Use the following IP address:. Insert meaningful values for the IP address, subnet mask, and (if necessary) the default gateway. The Use the following DNS server addresses: option will also have changed. Leave the addresses blank.
  4. Back in Server Manager, click the (UTC -8:00) Pacific Time (US & Canada) text next to Time zone. On the Date and Time screen, click the Change time zone… button. Choose your time zone and click OK when done. Click Close on the Date and Time screen.

Note:
I’m not joining the shared storage box to Active Directory. You can join it to the domain created earlier when you add a second NIC to the shared storage box. This would be beneficial if you want to use centrally configured IPSec, for instance.

Install the iSCSI Target Services role

Now it’s time to convert our Windows installation to an iSCSI serving shared storage box. Perform these steps:

  1. In Server Manager, on the grey task bar at the top, click Manage.
  2. Select Add Roles and Features. This will fire up the Add Roles and Features Wizard, which will guide you through the process.
  3. Click Next on the Before you begin screen.
  4. Select Role-based or feature-based installation on the Select installation type screen and click Next.
  5. Select your server from the server pool list on the Select destination server screen and click Next when done.
  6. In the list with Server Roles, scroll down to File and Storage Services (Installed). As you’ll notice, every Windows Server is already equipped with some file and storage services, and the role itself is not (un)installable. That’s OK, because we’re going to add three Role Services to the Server Role. Expand File and Storage Services (Installed) by clicking the triangle to the left of it. Then, expand File and iSCSI Services too.
    iSCSI Target Server role
    Here, select the radio buttons to the right of File Server, iSCSI Target Server and iSCSI Target Storage Provider (VDS and VSS hardware providers). Click Next when done.
  7. Click Next again underneath the Select Features list.
  8. On the Confirm installation selections screen, click Install. Do not bother to select the box next to Restart the server automatically if required, since installing these role services does not require a reboot.
    SAN Add iSCSI Target wizard
  9. When the wizard is done installing, click Close.

Configure the shared storage

Let’s create the two shared disks we need for our failover cluster now:

  1. In the left pane of Server Manager, select File and Storage Services.
  2. In the new sub pane, select iSCSI.
    iSCSI virtual disks
  3. In the main pane, click the link To create an iSCSI virtual disk, start the New iSCSI Virtual Disk Wizard.
  4. On the Select iSCSI virtual disk location screen, select a suitable location for the new iSCSI virtual disk. Since I’ve created one big 320GB (hardware mirrored) C:\ drive, I clicked Next on this screen, accepting the default location.
  5. For Specify iSCSI virtual disk name, I named my first iSCSI virtual disk Quorum and clicked Next.
  6. On the iSCSI Virtual Disk Size screen, I specified 512 MB as the size for this disk and clicked Next.
    Note:
    Microsoft recommends a 512MB Quorum disk for Windows-based failover clusters.
    There’s no need to create a larger Quorum disk.
  7. On the Assign iSCSI target screen, opt for the default New iSCSI target and click Next.
  8. Specify a name for the iSCSI target on the Specify target name screen. I chose the same name for both the disk and the target (Quorum) and clicked Next.
  9. On the Specify access servers screen, add both the Hyper-V Server failover cluster nodes as the iSCSI initiators that will access this iSCSI virtual disk:
    1. Click Add…
    2. Select Enter a value for the selected type.
    3. Change Type: to IP Address.
      SAN iSCSI Add Initiator
    4. Enter the IP Address of the NIC designated as the shared storage connection on the first Hyper-V failover cluster node, and then click OK.
    5. Click Add… again and add the information for the second node.
  10. Click Next.
  11. Since this is a simple failover cluster, we won’t Enable Authentication and thus simply click Next on this screen.
  12. On the Confirmation screen, click Create. When done, click Close.
  13. Run the New iSCSI Virtual Disk Wizard again, by right-clicking in an empty part of the iSCSI Virtual Disks list in the main pane of Server Manager. This time, create a larger iSCSI target that will serve as storage for your virtual machines. I created a 100GB iSCSI target with HVMachines as both the name for the shared disk and the iSCSI target.

Connect the shared storage to your Hyper-V nodes

To use the iSCSI targets for our cluster, we will need to add them to our Hyper-V failover cluster nodes. For this purpose, log on to the console of the first cluster node. Then, perform the following actions:

  1. Start up the iSCSI initiator by typing iSCSIcpl at the command prompt.
    Tip!
    You can Alt+Tab to it when you have sconfig in front of you.
  2. Since this is the first time you’re starting the iSCSI initiator, you’ll receive a pop-up message asking you whether you’d like to start the servers and configure the initiator to automatically start when the server starts. Of course, you want to have the iSCSI service running every time you restart the machine, so choosing Yes would be the obvious choice.
  3. On the iSCSI Initiator Properties window, go to the Discovery tab.
  4. Press the Discover Portal… button to insert the properties of your iSCSI server, hosting the iSCSI targets you need for your cluster.
  5. After pressing OK, you can switch to the Targets tab and hit the Refresh button. Both iSCSI targets (the Quorum and HVMachines targets) should now be available to connect to. Their reported status would be inactive.
  6. To connect to a target select it in the list and press the Connect button. When you connect to a target, it will be automatically configured as a persistent target. This will make the system automatically attempt to restore the connection every time this computer restarts. Press OK when you’re done.
  7. Connect the second iSCSI target.
  8. Press OK to close the iSCSI Initiator Properties window.

You’re now ready to move on to the other node of your soon-to-be Hyper-V cluster. Both iSCSI targets need to be connected on both nodes before you can successfully join them in a real-world-useful failover cluster.

Manage the Quorum disk

Now you need to make a pretty drastic decision: you need to choose between your nodes. One of them will be leading, whereas the other one (initially) will not be very active. I chose HvNode1 as the active node and HvNode2 as the (initial) passive node. This means HvNode1 will be used to access the locations where we will store our witness disk and our virtual machines, while HvNode2 can only dream of accessing them for now.

On HVNode1, you need to switch from the (blue) sconfig.cmd screen to the (black) command prompt window and use diskpart.exe on the iSCSI target designated as Quorum (hvquorum):

Type the following commands:

This will output a list containing the disks in the box. Memorize the disk number corresponding to the HVQuorum target. (This is the small 512 MB disk.)

Manage the storage disk

On the same node, you also need to create a partition on the second iSCSI target. Use the following commands on the disk designated as Virtual Machine Storage (hvstuff) (this is the big disk):

Tip!
You can use the Up arrow on your keyboard to recall the commands you used to create the partition on the previous disk.

Now we can fire up the Cluster Manager to create the cluster containing our Hyper-V Server 2012 R2 nodes. This will make an excellent subject for the last part of this series.

Series NavigationWindows Server 2012 Hyper-V Cluster – Part 2: Hyper-V cluster nodes - Windows Server 2012 Hyper-V Cluster – Part 4: Setup

-1+1 - Rate this post
Loading ... Loading ...
Disclaimer
Your question wasn't answered? Please ask in the new 4sysops forum!
Please share your thoughts in a comment!

Login

Lost your password?