Category
Tutorials
Published
November 23, 2015
Sometimes there is a need to increase C: volume. The supported maximum size for a disk in Azure is at the moment of writing 1TB. Although there are no commands or selections in the portal for expanding disks for servers created under the Resource Manager. This guide explains how to expand an existing Windows OS disk (default size 127GB) under a virtual machine which is created under Resource Manager (ARM).
Thanks to Karl for giving me the correct parameters to set the disk size! You can find his excellent work here.
DISCLAIMER. These operations are not officially supported by Microsoft and the steps although should work are done on own risk. Also the steps are tested and verified on Windows 2003R2 and 2012R2.
Create the server if not yet created through your favorite process. When it’s up and running, log in to the portal and write down the following:
If not yet installed, get the latest PowerShell Azure-module from here and install it.
From the client you installed the PowerShell Azure module from, start PowerShell ISE.
Copy the following code:
Paste that in to the script window and change the variables to match the correct VM, resource group and subscription name as written down earlier.
Press the “Play” button and log in with your credentials. If you get unrecognized account, it could be that you have not marked “log in with Microsoft account”)
The script shuts down the VM, set the parameters and starts it up.
You should get “Success” on the output in the command window.
When the above script is complete, log in to the VM.
You should see and similar output as below with the virtual disk having the size of 1023GB but C: volume still the same size.
We will use a third party tool to increase the volume for reasons explained later. Download the software to the VM here and install it.
Start the AOMEI partition program. It should look something like this:
We need to move the system volume (the volume which is 350MB in this example) to the end of the virtual disk since you need the free space for C: to be in direct conjunction with it.Mark the system volume, right click it and select “move partition”
Drag the slider to the furthest right as possible as below:
Click “OK”.You should now have one pending operation in the left column.
Click “Apply” in the top left corner and then “Proceed”.
After the operation completed successfully it should look like this:
Mark C: and right click, select “Resize partition”
Move the slider to the furthest right so the maximum size available is selected:
Click “OK”.
You should now have one pending operation and the “Disk 1” should look like below:
Click “Apply” in the top left corner and then “Proceed”.
The server needs to be rebooted so click “Yes”.
The server reboots.
Once the server is up and running, log in and verify the C: is the new size.It should look like this:
Now you’re done!
Feel free to uninstall the AOMEI partition software.
As said earlier, tested on Windows 2012R2 created under ARM. But could work for other Windows versions and probably Linux for the first PowerShell-part.