Context

In Windows Server 2012 R2, iSCSI Target Server made significant improvements in its persistence layer by providing larger, resilient, dynamically-growing SCSI Logical Units (LUs) that are based on the VHDX format. For more details on what is new in this release, see my previous blog post iSCSI Target Server in Windows Server 2012 R2. In this blog post, I will focus on what has changed in the persistence layer and what that means to you as the administrator as you migrate up to Windows Server 2012 R2. This also answers the related questions that I frequently hear.

 

First, Some Background

iSCSI Target Server stores each SCSI Logical Unit (LU) as a file in the Windows native file system – either NTFS or ReFS. The iSCSI stack uses the VHD (virtual hard disk) format for these files, which is why we call them ‘iSCSI Virtual Disks’. The VHD format provides good portability across target servers, and across the Hyper-V and iSCSI stacks. In Windows Server 2012, the iSCSI stack was well aware of the VHD file formats as it directly creates and manipulates the VHD files. Although this worked out well in some scenarios, this situation was not ideal for iSCSI stack as we really wanted to take immediate advantage of significant improvements in Hyper-V stack’s VHD capabilities – especially the VHDX format, which was newly introduced in Windows Server 2012.

Therefore, in Windows Server 2012 R2, the iSCSI stack switched to using the native Hyper-V VHD APIs. This update instantly gave the iSCSI stack the ability to support iSCSI Virtual Disks based on VHDX format and dynamic VHDX/VHD formats. In this release, the iSCSI stack also switched to VHDX as the default file format for Virtual Disks, so VHDX is the only format that you can use to create new iSCSI Virtual Disks. The iSCSI stack also takes advantage of the new online shrink/expand functionality in the Hyper-V stack, although you should note that the online shrink is new only for VHDX in Windows Server 2012 R2. Finally, we have made a number of corresponding improvements in the File and Storage Services UI in Server Manager to support these core functional changes.

The following tables summarize all of the Virtual Disk compatibility information for Windows Server 2012 and Windows Server 2012 R2. Although the tables may look daunting on a first glance, they are fairly easy to understand with this background information.

 

iSCSI Virtual Disks & Compatibility in Windows Server 2012

 

 

Create?

Import?

Expand?

Shrink?

Fixed VHD

Yes

Yes

Yes

No

Fixed VHDX

No

No

No

No

Diff VHD

Yes

Yes

Yes

No

Diff VHDX

No

No

No

No

Dynamic VHD

No

No

No

No

Dynamic VHDX

No

No

No

No

 

iSCSI Virtual Disks & Compatibility in Windows Server 2012 R2

 

Create?

Import?

Expand?

Shrink?

Fixed VHD

No

Yes

Offline

No

Fixed VHDX

Yes

Yes

Yes

Yes

Diff VHD

No

Yes

Offline

No

Diff VHDX

Yes

Yes

Yes

Yes

Dynamic VHD

No

Yes

Offline

No

Dynamic VHDX

Yes

Yes

Yes

Yes

 

Thin Provisioning

This is a frequent question that I get – “Does iSCSI Target Server support thin provisioning?” Yes we do support thin provisioning, but not in the precise T10 sense because we do not support the UNMAP SCSI command. Dynamic VHDX-based iSCSI Virtual Disks now supported in Windows Server 2012 R2 are in reality thin-provisioned – which is why Dynamic is the default disk type iSCSI target cmdlets use to provision.

 

Wrap-up

So here is the short summary:

  • Important new functionality only available in Windows Server 2012 R2 includes: iSCSI Virtual Disks for all types of VHDX, all types of dynamic disks, and support for online shrink. On the flip side, creating a new VHD-formatted iSCSI Virtual Disk is no longer supported in Windows Server 2012 R2, although importing one works just fine.
  • Expand/Shrink functionality for iSCSI Virtual Disks may be supported in offline mode (“Offline” in tables) or supported in online mode (“Yes” in tables), or not supported at all (“No” in tables). When an operation is supported in online mode, there is no need to take the Virtual Disk offline to perform the operation. Even when that is the case:
    • With Expand operation, make sure to also increase the partition size (or create a new partition) on the initiator to utilize the additional capacity.
    • With Shrink operation, you can only shrink the unallocated part of the capacity, i.e. make sure you are not trying to shrink the Virtual Disk to a size smaller than the end of the last partition – if you do, it will fail. Check out the Resize-IscsiVirtualDisk cmdlet for the complete guidance.

I hope this blog post serves as a useful reference for you. If you have feedback, drop me a comment on this blog post. Let me also know how the new VHDX-based iSCSI Virtual Disks are working for you so far on Windows Server 2012 R2!