User profile disks allow users to save personal settings and files when they are signed in to a session on an RD Session Host server in a collection, and then have access to the same settings and files when signing in to a different RD Session Host server in the collection.
You might face situations in which your users may need more space and for this reason you are then trying to resize the VHDx associated to the UPD disks, stored on your Azure RDSH Server.
Today the only method for easily resizing a VHDx file is by using the Resize-VHD cmdlet.
This cmdlet belong to the Hyper-V Poweshell modules and requires the Hyper-V role in order to work.
If you have tried to install the Hyper-V in Windows Server 2008 R2 or 2012 through Server Manager probably encountered the following message: The following message appears preventing you from continuing the process: Hyper-V can not be installed: The hypervisor is already running.
This means that currently, there is no supported way for resizing VHDx disks inside an Azure VM.
Leveraging the blog post from Gilson Banin, How to Install Hyper-V on a Virtual Machine in Hyper-V, I will present you a workaround for this purpose.
THIS WORKAROUND RELIES ON AN UNSOUPPORTED SCENARIO: WE ARE BASICALLY USING A TEMPORARY VM WITH THE PURPOSE TO HOST HYPER-V ROLE. THIS TEMPORARY ENVIRONMENT IS NOT SUPPORTED BY MICROSOFT. USE IT ONLY AT YOUR OWN RISK.
Make backups of all the VHDX files that you are going to resize, before applying the below steps.
Setup the Management Environment
- Create a new temporary VM (a small size will be fine, like A1) and join this VM to your existing VNET.
- Force Installation of Hyper-V Role using this PowerShell command (from Gilson’s blog post):
Enable-WindowsOptionalFeature –Online -FeatureName Microsoft-Hyper-V –All –NoRestart
- Restart the VM.
- Add the “Hyper-V Management Toos” feature:
- Map the shared folder containing your VHDXs on a local drive.
Log in to the mgmt VM and run the following from an elevated PowerShell prompt:
Resize-VHD -Path <full_path_to_a_vhdx_file_to_reize> -SizeBytes <new_size>
Expanding Volume Size
You can destroy the management VM, once you finished with all the resizings.
The above procedure is based on information provided in this article:
- How to Install Hyper-V on a Virtual Machine in Hyper-V, http://blogs.technet.com/b/gbanin/archive/2013/06/26/how-to-install-hyper-v-on-a-virtual-machine-in-hyper-v.aspx
- Resize-VHD, https://technet.microsoft.com/en-us/library/hh848535(v=wps.630).aspx
Have a good time Resizing!