Monday, May 31, 2010

How to add a Node to a Windows 2008 R2 Hyper-V Failover Cluster

Dammit - me and my lack of documentation. Worked with Hyper-V for the first time six months ago (I'm predominantly a VMware dude). I Had to add a node to a failover cluster this morning, and found myself wishing I had documented it better the first time around. Got it sorted after a bit of scratching around; as you'll see below I've also finally gotten round to documenting the process. The below assumes that you've hooked it presented appropriate the appropriate LUNs on the SAN etc. etc....

  1. Install the OS (no sh!t Sherlock). Make sure you run the same edition on all nodes. Also installed any required MPIO software that may be required by your SAN.
  2. Join the server to the same domain that your other Cluster nodes are members of
  3. Enable and configure Windows Updates
  4. Make sure that your network adapter naming convention is the same as on the other nodes. This will make management easier
  5. Install the Hyper-V role, reboot when prompted
  6. Make sure to have naming consistency in your Virtual network. In other words, exactly the same name and capitalization
  7. Install the Failover Clustering feature, reboot when prompted
  8. Physically connect the server to your SAN
  9. Join the node to the cluster. This can be done via the Failover Cluster Management MMC: Right click your cluster name, select Add Node, enter the server name and click OK. The command line alternative is "cluster.exe /cluster:Cluster_Name /add /node:Node_Name"
It might be necessary to change your quorum settings afterwards - this Microsoft webpage explains the options rather nicely. The quorum settings are changed via the Fialover Cluster Manager MMC, in the Actions pane there's a Configure Cluster Quorum Settings link.

How to Expand a VHD on Hyper-V 2008 R2

This is a fairly basic task that needs to be done fairly frequently, but I've never documented it anywhere so it always takes me 10 minutes longer than what it should. The client where I had to do this today happens to run a HP EVA 4400 Fiber SAN, so I will include the instructions for the EVA side of things as well. Without further ado...

Expanding a existing LUN on an HP EVA 4400 SAN
  1. Log into Command View (HP's delightfully named SAN configuration solution)
  2. Navigate to the the Virtual Disks folder, more specifically to the Vdisk you want to expand
  3. Click the Vdisk, and wait 10 seconds for the incredibly laggy Command View interface to catch up
  4. Type your new, preferred size in the box cunningly labelled "Capacity"
  5. Click "Save"
Expanding a VHD
  1. Use Cluster Resource Manager to determine who owns the Disk Resource you wish to expand
  2. Once identified, go to "Disk Management" on the owner
  3. Right-click the Disk Management node, and select "Rescan Disks". The un-allocated space should show up now
  4. Right-click the volume you wish to expand and select "Extend Volume". Click Next 2 times and finally Finish
  5. Fire up SCVMM and shut down the VM whose VHD you want to expand
  6. Click the "Hardware Configuration" tab, and select the Disk you want to expand
  7. Check the "Expand this disk" checkbox and enter the desired size
  8. Click OK
This should take care expanding the VHD, but this does not mean the underlying OS will automatically make use of the added capacity, no sirrreeee. In my case the VM was running Windows 2008 Server R2, and this is what I had to do....

Using Diskpart to Extend a Partition
  1. Click Start, type CMD and press Enter
  2. In the resulting Command Prompt, type "Diskpart"
  3. Select the correct drive and partition to perform the extend operation on. In my case it was Disk 1, Partition 1. The correct commands in my case were "Select disk 1" and "Select Partition 1". The "List disk" and "List partition" commands, surprisingly enough, will list your existing disks and partitions
  4. Now that we've got the correct disks and partitions selected, we simply give the "Extend" command. This will extend the disk using all the contiguous free space available
And with that done, you should be the proud Admin of a newly extended VHD!