Present an iSCSI Virtual Disk to Hyper-V host(s) using Storage Spaces for Cluster Shared Volume (CSV)

Cluster Shared Volume (CSV) = shared storage that can be used by multiple nodes in a cluster to simultaneously read and write without corrupting the disk.  This is equivalent to Virtual Machine File System (VMFS) on VMware.

In a very simple form the cluster would have a master node that would commit any changes to the disk.  For example if we had a 4 node cluster as below:

Node 1  – Master

Node 2 – Slave

Node 3 – Slave

Node 4 – Slave

And if Node 3 wanted to commit any changes then these would be executed by Node 1.

We can present shared storage to nodes (hosts) by setting the storage up as an iSCSI target.

Below is a quick example:

Utilising Storage Spaces (previous blog) we can set up a Storage Pool and from the Storage Pool we can carve out a “virtual disk”.

Under Server Manager -> File and Storage Services -> Storage Pool -> New Virtual Disk

VDisk_iSCSI_001

The New Virtual Disk Wizard will start.  Under “Virtual Disk Name” section specify a name you will give this Virtual Disk and a description.

Then click “Next”.

VDisk_iSCSI_002

Specify the “Storage Layout” option either:

Simple, Mirror or Parity (explained in detail in previous blog post).

I have selected “Parity” then click “Next”.

VDisk_iSCSI_003

Specify if you want the disk to dynamically grow (thin provisioned) or fixed in size.  This depends on workload you wish to run.  As this is a lab I have selected “Thin” then click “Next”.

VDisk_iSCSI_004

Decide upon the size of the disk and then click “Next”.

VDisk_iSCSI_005

Verify the information you have selected through each option and click “Create”.

VDisk_iSCSI_006

If no anomalies you should see a successful message of the disk being setup.  Click “Close”.

VDisk_iSCSI_007

The “New Volume” Wizard will pop up straight after.  This can be configured later if required.

Select the “Server” and “Disk” then click “Next”.

VDisk_iSCSI_008

Specify the size of the volume.  We setup a 5GB Virtual Disk.

From this we can set up multiple volumes if need be.

I have chosen the full size 5GB. Then click “Next”.

VDisk_iSCSI_009

Select a “Drive Letter” and click “Next”.

VDisk_iSCSI_010

Give a descriptive “Volume label” for reference point.  Then click “Next”.

VDisk_iSCSI_011

Again if no anomalies then you should see a successful message.  Click “Close”.

VDisk_iSCSI_012

We can now see the VDISK_iSCSI virtual disk (LUN) created and displayed as Volume E:

VDisk_iSCSI_014

Setup an iSCSI virtual disk (LUN) which you will use as shared storage between HV1 (node) and HV2 (node) for CSV.

Under File and Storage Services -> iSCSI -> select “New iSCSI Virtual Disk”.

Underlying delivery mechanism = iSCSI.

VDisk_iSCSI_015

The iSCSI Virtual Disk Wizard will start.  Select “Server” and “Volume” then click “Next”.

VDisk_iSCSI_016

Give the iSCSI virtual disk a name and then click “Next”.

VDisk_iSCSI_017

Specify iSCSI virtual disk size and then click “Next”.

If this was a SAN you would be specifying the LUN size.  As this is a lab I am specifying “Dynamically expanding”.

VDisk_iSCSI_019

Assign iSCSI target.  These are the servers that will be able to use the iSCSI Virtual Disk.  Select “New iSCSI target” and click “Next”.

VDisk_iSCSI_020

Specify name and description.  When connecting later this name will be important for identification!

Click “Next”.

VDisk_iSCSI_021

Recommended to use IQN as this is very unlikely to change in an environment compared to IP and DNS.   This way you minimise disruptions to your storage setup.  Browse for the servers that will have access to the iSCSI disk(s) and click “OK”.

VDisk_iSCSI_022

Once added click “Next”.

VDisk_iSCSI_023

As this is a lab environment I am not setting up CHAP.  In a production environment you would want to make your environment as secure as possible so I would highly recommend using CHAP as an added layer of protection.  Click “Next”.

VDisk_iSCSI_024

Verify your selections and click “Create”.

VDisk_iSCSI_025

If no anomalies you should get a successful message. Click “Close”.

VDisk_iSCSI_026

The iSCSI_LUN or virtual disk will show as “not connected” until there is an active connection from the access servers specified.  In this instance it’s SG-HV1 and SG-HV2.

VDisk_iSCSI_027

Jump over to the Hyper-V host(s) – SG-HV1 and SG-HV2 and start iSCSI Initiator wizard from Start – Run.

Under “Targets” give the Storage server IP or DNS Name and select “Quick Connect”.

VDisk_iSCSI_028

On the pop up window select the “discovery targets” and click “Connect” and then “Done”.

Note the name we gave earlier matches.

VDisk_iSCSI_029

Next go to “Volumes and Devices” and select “Auto Configure” this should mount the iSCSI disk (LUN) onto the server.  Do the same process for all the nodes that you wish to have the LUN present.

i.e. SG-HV1 and SG-HV2.  Then select “OK”.

VDisk_iSCSI_031

Then when you look under Disks section (either SG-HV1 or SG-HV2) you can see the iSCSI “LUN” of 5GB being presented to both nodes.

As you can see the disk is “online” and “usable” as iSCSI target on both SG-HV1 and SG-HV2 which you would expect like a SAN presenting iSCSI LUN to multiple hosts.

VDisk_iSCSI_032

This can be used as a CSV once you have your cluster setup which we will describe in another blog post.

Hopefully I haven’t confused you 🙂

Good Luck!