New hyper-v Online resize virtual hard disk in Windows Server 2012 R2

The new Generation 2 Hyper-V that comes with Windows Server 2012 R2 having an extended feature rich capabilities. The summary follows:

Feature or functionality New or updated
Shared virtual hard disk New
Resize virtual hard disk Updated
Storage Quality of Service New
Live migrations Updated
Virtual machine generation New
Integration services Updated
Export Updated
Failover Clustering and Hyper-V Updated
Enhanced session mode New
Hyper-V Replica Updated
Linux support Updated
Management Updated
Automatic Virtual Machine Activation New
Hyper-V Networking Updated

What’s New in Hyper-V for Windows Server 2012 R2: http://technet.microsoft.com/en-us/library/dn282278.aspx

The one crucial feature is that the online/live resize virtual hard disks. This support is only limited to VHDX files, this clearly a limitation. Like if you import a VHD file into the Gen-2 Hyper-V, you won’t be able resize it in live mode. For IT people this feature is somewhat a painful job where you will seek other options or tool which could do this job for you.

I would still go for the Gen-2 editions of Hyper-V to take leverage of the current technology available at hand rather going backwards while having the updated technology. Honestly Microsoft will remove support for it sooner than you think, so why bother with old versions with technical bindings? One catch is there; yeah that’s another one “Shrink disk requires the disk has to be expended earlier”. You will not be able to shrink a VHDX file if the file has NOT been expended before. Consult the following for more information.

Online Virtual Hard Disk Resizing Overview: http://technet.microsoft.com/en-us/library/dn282286.aspx

As you can see from the screenshot below, if you haven’t expended this VHDX file (You can still do it online without shutting down the VM in new Hyper-V) before, the “Edit Virtual Hard Disk Wizard” will not show the Shrink option there. On the context of the following picture “Compact” is not Shrink, and you can only do shrink online, and the size or assigned volume size of the VHDX will remain same. But it’s not compress either 🙂

vhdx_expand_01

So, let’s take a look at the VM, click on the SCSI Controller> Hard Drive and then click on the Edit button. If you haven’t expanded this VM earlier, you will be presented with the following screen.

vhdx_expand_02

As you can see there is no option for shrinking this volume. Click on Expand followed by Next.

vhdx_expand_03

Put in your desired number and hit the finish button. The summary of the action taken will be presented to you.

vhdx_expand_04

Now reopen the Hard Drive and Edit the VM’s size, you will see the following screen:

vhdx_expand_05

And now you will be able to shrink the VHDX. Please be mindful that Shrink option can only be done in Hyper-V manager, SCVMM 2012 R2 does not support that yet. Moreover, when you are adding a new VM or adding a new virtual hard disk file to a VM, you should choose a smaller size, where it would be easier for you to easily expend or shrink it when requirement arises.

Link for the video @ YouTube:

please install flash