Now that Windows Server 2008 R2 beta 1 is available, I decided to give it a spin. The installation of the Hyper-V role and the Failover Cluster feature is very similar to the current version and is not discussed in this article. This article does not discuss best practices. It merely illustrates the setup process that enables you to live migrate virtual machines with Hyper-V 2.0.

Overview of the steps:

  1. Create a Failover Cluster.
  2. Create a Cluster Shared Volume (CSV).
  3. Create a virtual machine on the CSV.
  4. Make the virtual machine highly available using the Failover Cluster Management tool.

Note: the above overview gives the impression that you need to use Cluster Shared Volumes to enable live migration. This is not the case as live migration works on traditional volumes as well. It is included here because it probably will be the volume type of choice in a cluster because of its additional advantages.

Hardware
I used a desktop with a Core 2 Quad and a laptop with a Core 2 Duo. The desktop has 8GB of RAM and the laptop 4G. These two systems just run Windows Server 2008 x64 R2 Beta 1 with the Hyper-V role. There is another system on the same network that acts as domain controller (domain is r2.local). It runs Windows Server 2008 R2 beta 1 as well and runs as a virtual machine in VMware Workstation 6. Windows 7 and Windows Server 2008 R2 run well under VMware Workstation and ESX.

Storage
As shared storage I used Lefthand Network’s VSA, the laptop version (running as a virtual machine in VMware Workstation). You can download the VSA from their website here: http://www.lefthandnetworks.com/eval_saniq.aspx. You can use their Quick Start Guide to get up to speed quickly. I created two volumes and they show up like this in the management console (or their CMC or centralized management console as they like to call it):

image

The quorum is 5GB and the virtual_machines volume is 50GB. The VSA does not provide 55GB of physical disk space but with thin provisioning you can create the size you want. In reality, the VSA provides 4,5GB physical space out of the box and that is enough to put a Windows XP virtual machine on the virtual_machines volume.

iSCSI
The Windows Server 2008 R2 hosts are connected to their volumes using iSCSI. I renamed the initiators to node1 and node2 and granted access to the volumes on the VSA using the initiator name (click the screenshot below):

image

The iSCSI configuration applet in Windows Server 2008 R2 has changed a bit but the process remains the same. Check the screenshot below for the new look (click to enlarge):

image 

Failover Cluster
I created a cluster called r2clus. The Failover Cluster manager shows the following (click to enlarge):

image

Creating a cluster shared volume (CSV)
Before creating a CSV you need to enable the feature. Right click the cluster name in the Failover Cluster Manager and select Enable Cluster Shared Volumes… You will get the following warning:

image

Indeed, CSVs are only supported for use with Hyper-V 2.0. Other applications are not supported. When you accept the terms and click OK you will see the Cluster Shared Volumes node in the Failover Cluster Manager:

image

Before you can add a CSV you need to make sure the volume is listed as available storage in the Storage node (under Cluster Shared Volumes). Navigate to the storage node and click Add a Disk. If you presented the volume(s) correctly you will be able to select the volume and it will show up as available in the list of disks.

Now go to Cluster Shared Volumes and click Add storage. You should see something like:

image

After the storage has been added, it will show up in the list of Cluster Shared Volumes:

image

If you look closely at the above screenshot, you will see that the mount point for the volume is C:\ClusterStorage\Volume1. Indeed, CSVs are not given a drive letter. If your volume had a drive letter, it is removed. CSVs are accessible from any host in the cluster using the C:\ClusterStorage path. You will need to use this path when you later create a virtual machine that you want to live migrate.

Creating a virtual machine on the CSV
Now that the cluster is operational and the CSV is mounted, we can create a virtual machine on the shared storage. This is the same process as before so you use Hyper-V Manager and create a new virtual machine. When you create the virtual machine, always use the path to the CSV: C:\ClusterStorage\Volume#. Do this for the virtual machine configuration and the disk.

After installation we can make the virtual machine highly available from Failover Cluster Manager. Right click Services and Applications and select Configure a Service or Application… After following the wizard you end up with:

image

From now on you need to control the state of the virtual machine from Failover Cluster Manager. The task pane at the right provides all the options such as Turn Off, Shut Down, Save and so on.

Live Migration
When the virtual machine uses a CSV as shared storage you can use live migration to move it. The live migration option is in the task pane at the right:

image

During live migration you can track its progress:

image

Be aware that quick migration is still available. A quick migration is performed with the option Move virtual machine(s) to another node.

Conclusion
If you want live migration with Hyper-V 2.0 you need a Windows Server 2008 Failover Cluster with some form of shared storage. This is the same requirement as in the current version. Live migration is just an extra feature in an R2 cluster. I configured a Cluster Shared Volume but this is not a hard requirement. You probably will use CSVs because of the added benefits such as I/O redirection and the ability to live migrate individual virtual machines on a volume with several virtual machines running.

Note that live migration will be available in the free version as well (Hyper-V Server 2008 R2). That version is now in beta too and can be downloaded as well from here.