In this article I will show you how to create a Cluster Shared Volume (CSV), the cluster active/active file system that is at the heart of Hyper-V clusters with shared block storage and the Scale-Out File Server (SOFS) architectures.
Cluster Shared Volume was introduced in Windows Server 2008 R2 (W2008 R2). Before W2008 R2 Hyper-V we pretty much had to deploy one LUN on a SAN for each virtual machine. (It wasn’t a Windows requirement, but it was good practice). As you could imagine, this made self-service an impossibility, and it made SAN administration a nightmare. Careful naming was required, and I would sweat bullets when it came to decommissioning virtual machines and LUNs, hoping that I wasn’t about to accidentally delete a customer’s virtual machine that was placed on the wrong volume.
CSV was added to failover clustering in W2008 R2 to provide a file system that could be shared and active across each node in the cluster. This means that you can store lots of virtual machines one a few easily managed volumes (try to have one per cluster node) and run those virtual machines across any or all of the cluster nodes. The W2008 R2 version of CSV was restricted to being used just for storing Hyper-V virtual machines. Windows Server 2012 (WS2012) expanded this to include the SOFS, and Microsoft continues to evaluate other scenarios where CSV can be of use.
The high level architecture of CSV is as follows:
The Windows concept of “shared nothing” still applies: One node remains the owner of volume. However, the CSV is mounted in C:\ClusterStorage\Volume<IncrementalNumber> on each node in the cluster. The CSV owner, also known as the CSV coordinator, delegates rights to the other cluster nodes to read and right to/from files and folders in the CSV. The volume, formatted with NTFS will appear to now run a file system called CSVFS in administration tools. This indicates to administrators and disk management tools that the CSV is a cluster file system and should be treated differently than a non-shared volume.
Don’t worry about the CSV owner role. It is created by Windows for you and managed by Windows. The role is highly available.
Every CSV has an owner. A node can be the owner of one or any number of the volumes. In older versions of Windows Server the placement of the CSV owner role was best effort but you could manipulate it. In WS2012 R2, the CSV owner roles are balanced across the nodes; this is used in conjunction with SMB connection redirection in the SOFS architecture to obtain the best flow of data from host to physical storage.
If you want to dig much deeper on CSV then the best source of information is a blog post by Microsoft’s Elden Christensen.
There are a number of steps in the process of creating a CSV. By the way, this entire process is much easier if you have deployed System Center Virtual Machine Manager (SCVMM) to manage your hosts and your storage. SCVMM will perform the work with a few clicks, including provisioning the physical storage.
Tip: Create one LUN/CSV at a time so you can track what disk is what volume and name them consistently.
Tip: Name the LUN after the cluster and desired CSV name, for example, HVC1-PetriCSV
Note: If you are using Storage Spaces as the shared storage, then the disk will be automatically added to the cluster after you create the new virtual disk in the pool.
Tip: Edit the properties of the disk and rename it match the desired CSV name, for example, PetriCSV.
You now can deploy virtual machines to your new CSV by specifying the path of the CSV under C:\ClusterStorage. For example, I could deploy a new VM to C:\ClusterStorage\PetriCSV.
Using a CSV for the virtual machine’s files mean that the files are available to each host in my cluster and the virtual machine can fail over or live migrate within the cluster without: